alliedmodders / sourcepawn

A small, statically typed scripting language.
Other
363 stars 62 forks source link

Compiler warning related to bit operations #954

Closed A1mDev closed 7 months ago

A1mDev commented 7 months ago

This is due to yesterday's sourcepawn updates, the code stopped working correctly: 2312009 6300000004_image

accelerator74 commented 7 months ago

There are also some more errors image image

dvander commented 7 months ago

Please attach reproducible test cases.

A1mDev commented 7 months ago

This was the code with the OnPlayerRunCmd:

public Action OnPlayerRunCmd(int client, int& buttons, int& impulse, float vel[3], float angles[3], int& weapon, int& subtype, int& cmdnum, int& tickcount, int& seed, int mouse[2])
{
    buttons &= ~IN_ATTACK;

    return Plugin_Changled;
}

I can’t check it now, since I deleted that sourcemod build, but it seems that it can be reproduced using the usual function:

void Foo(int &buttons)
{
    buttons &= ~IN_ATTACK;
}
A1mDev commented 7 months ago

Case 2:

void Foo()
{
    float vMins[3];
    float vMaxs[3];
    vMins = view_as<float>({-14.0, -25.0, -12.0});
    vMaxs = view_as<float>({13.0, 25.0, 12.0});
}
dvander commented 7 months ago

Thanks! These have both been fixed on master.