Fix build clang 3.9+ (#458)

* clang 4.0: fix ordered comparison between pointer and zero

* clang 4.0: fix taking address of packed member

Maybe someday someone will properly fix it

* clang 3.9: passing an object that undergoes default argument promotion to 'va_start' has undefined behavior

Someday proper fix?
This commit is contained in:
Karol Szuster
2017-09-25 15:22:53 +02:00
committed by Vincent Herbet
parent feba821306
commit 604ecbd31e
3 changed files with 12 additions and 8 deletions

View File

@ -318,19 +318,19 @@ static cell AMX_NATIVE_CALL GetHamItemInfo(AMX *amx, cell *params)
return pItem->iPosition;
case ItemInfo_pszAmmo1:
return MF_SetAmxString( amx, params[3], pItem->pszAmmo1 > 0 ? pItem->pszAmmo1 : "", params[4] );
return MF_SetAmxString( amx, params[3], pItem->pszAmmo1 ? pItem->pszAmmo1 : "", params[4] );
case ItemInfo_iMaxAmmo1:
return pItem->iMaxAmmo1;
case ItemInfo_pszAmmo2:
return MF_SetAmxString( amx, params[3], pItem->pszAmmo2 > 0 ? pItem->pszAmmo2 : "", params[4] );
return MF_SetAmxString( amx, params[3], pItem->pszAmmo2 ? pItem->pszAmmo2 : "", params[4] );
case ItemInfo_iMaxAmmo2:
return pItem->iMaxAmmo2;
case ItemInfo_pszName:
return MF_SetAmxString( amx, params[3], pItem->pszName > 0 ? pItem->pszName : "", params[4] );
return MF_SetAmxString( amx, params[3], pItem->pszName ? pItem->pszName : "", params[4] );
case ItemInfo_iMaxClip:
return pItem->iMaxClip;