>DansTonCode();

Tous les codes sources "Travail d'équipe"page 6

PHP
 15 June, 2014 à 07:27
#212
// Who said that PrestaShop is easy to understand ?? Here are some snippets from some files.

$this->isLogged = (bool)((int)(self::$cookie->id_customer) AND Customer::customerIdExistsStatic((int)(self::$cookie->id_customer)));

// WTF ! controllers/cartController.php
(int)$producToAdd->out_of_stock == 2 ? !(int)Configuration::get(‘PS_ORDER_OUT_OF_STOCK’) : !(int)$producToAdd->out_of_stock;

// Why int cast before abs() ??? controllers/cartController.php
$qty = (int)(abs(Tools::getValue(‘qty’, 1)))

// Double cast ! modules/productcomments/productcomments-ajax.php
(bool)((int)Tools::getValue(‘value’));
C++
 12 June, 2014 à 03:36
#115
retu(rp->p_addr);
sureg();
/*
 * (...)
 * You are not expected to understand this.
 */
if(rp->p_flag&SSWAP) {
	rp->p_flag =& ~SSWAP;
	aretu(u.u_ssav);
}
C++
  7 June, 2014 à 02:30
#162
        if ((o = memwrap_realloc(o, sizeof (*o) + (max - 1) * sizeof (*o->item))) == NULL)
            return;    /* COVERAGE EXCLUSION: We don't test memwrap_realloc() failures */
        if ((len = snprintf(buf, bufsz, "%s%u", i ? "," : "", list->item[i])) >= bufsz)
            break;    /* COVERAGE EXCLUSION: We don't test overflows */