Params and redundant test: constant expression is non-zero
#8

Quote:
Originally Posted by ******
Посмотреть сообщение
It will give the warning AND true - warnings still compile. The reason it comes up is that "if" is evaluated at run-time, so takes time while your code is executing. That check "10 > 2" is ALWAYS true, so you are wasting time testing something that can never fail! That's why the warning exists.
This solved me that problem
pawn Код:
#if USE_TEXTDRAW_SET == 2
format(string,sizeof(string),"Listening to: ~n~~w~%s",r_RadioInfo[playingid][r_Name]);
TextDrawSetString(v_VehicleInfo[vehicleid][r_Draw],string);
#else
TextDrawSetString(v_VehicleInfo[vehicleid][r_Draw],r_RadioInfo[playingid][r_Name]);
#endif
TextDrawShowForPlayer(playerid,v_VehicleInfo[vehicleid][r_Draw]);
SetPVarInt(playerid,"ID_HideRadioTextdraw",SetTimerEx("HideRadioTextdraw",TEXTDRAW_DISAPPEAR_TIME,false,"ii",playerid,vehicleid));
PlayAudioStreamForPlayer(playerid,r_RadioInfo[playingid][r_Link]);
SetPVarInt(playerid,"ID_OldVehicle",vehicleid);
But still can you tell why i added:
Line 266
Код:
#pragma unused params
and it gives me an error:
Код:
(266) : error 017: undefined symbol "params"
Perhaps the params warnings are still there.
Код:
warning 203: symbol is never used: "params"
warning 203: symbol is never used: "params"
warning 203: symbol is never used: "params"
warning 203: symbol is never used: "params"
Quote:
Originally Posted by _Zeus
Посмотреть сообщение
Is it like this?
pawn Код:
// For example:
dcmd_kill(playerid, params[])
{
    #pragma unused params
    SetPlayerHealth(playerid, 0.0);
    return 1;
}
No, i added the #pragma unused params at the top of the script. [Line 266]
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)