• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TFS 0.X OTX 2 compile warining

mRefaat

Marketing and Coding
Joined
Jan 18, 2014
Messages
854
Solutions
3
Reaction score
141
Location
Egypt
Hello

while compiling otx 2, i got this warning
1>..\luascript.cpp(11672): warning C4319: '~': zero extending 'uint32_t' to 'lua_Number' of greater size
what does it mean and how to fix it?

luascript.cpp
 
Solution
Does it compile? If it does, ignore that warning.

If it does not compile, you can try to replace:
Code:
int32_t LuaInterface::luaBitUNot(lua_State* L)
{
    uint32_t number = (uint32_t)popNumber(L);
    lua_pushnumber(L, ~number);
    return 1;
}
With:
Code:
int32_t LuaInterface::luaBitUNot(lua_State* L)
{
    uint64_t number = (uint64_t)popNumber(L);
    lua_pushnumber(L, ~number);
    return 1;
}
I cannot test, if this fix that warning. It looks like this warning is only reported by VisualStudio compiler, not Linux one.

If this does not help, you can remove whole function. I'm 99% sure, there is no LUA code that does 'bitwise operations' in your 'data' directory.

Problem description...
Does it compile? If it does, ignore that warning.

If it does not compile, you can try to replace:
Code:
int32_t LuaInterface::luaBitUNot(lua_State* L)
{
    uint32_t number = (uint32_t)popNumber(L);
    lua_pushnumber(L, ~number);
    return 1;
}
With:
Code:
int32_t LuaInterface::luaBitUNot(lua_State* L)
{
    uint64_t number = (uint64_t)popNumber(L);
    lua_pushnumber(L, ~number);
    return 1;
}
I cannot test, if this fix that warning. It looks like this warning is only reported by VisualStudio compiler, not Linux one.

If this does not help, you can remove whole function. I'm 99% sure, there is no LUA code that does 'bitwise operations' in your 'data' directory.

Problem description:
 
Solution
Does it compile? If it does, ignore that warning.

If it does not compile, you can try to replace:
Code:
int32_t LuaInterface::luaBitUNot(lua_State* L)
{
    uint32_t number = (uint32_t)popNumber(L);
    lua_pushnumber(L, ~number);
    return 1;
}
With:
Code:
int32_t LuaInterface::luaBitUNot(lua_State* L)
{
    uint64_t number = (uint64_t)popNumber(L);
    lua_pushnumber(L, ~number);
    return 1;
}
I cannot test, if this fix that warning. It looks like this warning is only reported by VisualStudio compiler, not Linux one.

If this does not help, you can remove whole function. I'm 99% sure, there is no LUA code that does 'bitwise operations' in your 'data' directory.

Problem description:
It compiles and working with the warning also like you said it is only from Visual Studio not Linux (it is doesn't appear on Linux)
I just wanted to understand more about it.
Thanks for reply, i will ignore it then.
 
Back
Top