Changeset 406 for trunk/src/lib/lua.cc


Ignore:
Timestamp:
06/20/15 00:05:17 (10 years ago)
Author:
epyon
Message:
  • code compiles cleanly on maximum warning level
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/lua.cc

    r395 r406  
    128128static const lua_Number *lua_version_51 (lua_State*)
    129129{
    130         static const lua_Number version = (lua_Number)LUA_VERSION_NUM;
     130        static const lua_Number version = lua_Number( LUA_VERSION_NUM );
    131131        return &version;
    132132}
     
    227227#endif
    228228
    229 #       define NV_LUA_FUN( rtype, fname, fparams ) *(void **) (&fname) = lua_library.get(#fname);
     229#       define NV_LUA_FUN( rtype, fname, fparams ) void_assign( fname, lua_library.get(#fname) );
    230230#       if NV_LUA_VERSION == NV_LUA_52
    231231#               define NV_LUA_FUN_51( rtype, fname, fparams )
     
    246246
    247247#if NV_LUA_VERSION == NV_LUA_5C
    248 #       define NV_LUA_LOAD( fname ) *(void **) (&fname) = lua_library.get(#fname);
    249 #       define NV_LUA_LOAD_AS( fname,fname2 ) *(void **) (&fname) = lua_library.get(#fname2);
     248#       define NV_LUA_LOAD( fname ) void_assign( fname, lua_library.get(#fname) );
     249#       define NV_LUA_LOAD_AS( fname,fname2 ) void_assign( fname, lua_library.get(#fname2) );
    250250        bool version_52 = lua_library.try_get("luaL_checkversion_") != nullptr;
    251251        if (version_52)
    252252        {
    253253#       define NV_LUA_COMPAT_FUN( u1, fn, u2, u3, fn2, u5, u6, u7 ) \
    254         *(void **) (&(fn2##_compat)) = lua_library.get(#fn2); \
     254        void_assign( fn2##_compat, lua_library.get(#fn2) ); \
    255255        fn = call_##fn2##_compat;
    256256#       include <nv/lib/detail/lua_functions_compat.inc>
     
    280280        {
    281281#       define NV_LUA_COMPAT_FUN( u1, fn, u2, u3, u4, u5, u6, u7 ) \
    282                 *(void **) (&fn) = lua_library.get(#fn);
     282                void_assign(fn, lua_library.get(#fn) );
    283283#       include <nv/lib/detail/lua_functions_compat.inc>
    284284#       undef NV_LUA_COMPAT_FUN
Note: See TracChangeset for help on using the changeset viewer.