case LUA_TTHREAD:
snprintf(buff, 7, "thread");
break;
+
+ default:
+ snprintf(buff, 64, "unknown(%d)", lua_type(L, index));
+ break;
}
return buff;
}
* @param size number of bytes of data
* @param userdata the memory buffer to write
*/
-int sglua_memory_writer(lua_State* L, const void* source, size_t size, void* userdata)
+int sglua_memory_writer(lua_State* /*L*/, const void* source, size_t size, void* userdata)
{
sglua_buffer_t buffer = static_cast<sglua_buffer_t>(userdata);
while (buffer->capacity < buffer->size + size) {
}
}
-int console_open(lua_State *L) {
+int console_open(lua_State*)
+{
sg_platf_init();
simgrid::s4u::on_platform_creation();
return 0;
}
-int console_close(lua_State *L) {
+int console_close(lua_State*)
+{
simgrid::s4u::on_platform_created();
sg_platf_exit();
return 0;
lua_pushstring(L, "gw_src");
lua_gettable(L, -2);
- const char *name = lua_tostring(L, -1);
- ASroute.gw_src = sg_netpoint_by_name_or_null(name);
- lua_ensure(ASroute.gw_src, "Attribute 'gw_src=%s' of AS route does not name a valid node", name);
+ const char* pname = lua_tostring(L, -1);
+ ASroute.gw_src = sg_netpoint_by_name_or_null(pname);
+ lua_ensure(ASroute.gw_src, "Attribute 'gw_src=%s' of AS route does not name a valid node", pname);
lua_pop(L, 1);
lua_pushstring(L, "gw_dst");
lua_gettable(L, -2);
- name = lua_tostring(L, -1);
- ASroute.gw_dst = sg_netpoint_by_name_or_null(name);
- lua_ensure(ASroute.gw_dst, "Attribute 'gw_dst=%s' of AS route does not name a valid node", name);
+ pname = lua_tostring(L, -1);
+ ASroute.gw_dst = sg_netpoint_by_name_or_null(pname);
+ lua_ensure(ASroute.gw_dst, "Attribute 'gw_dst=%s' of AS route does not name a valid node", pname);
lua_pop(L, 1);
lua_pushstring(L,"links");
return 1;
}
-int console_AS_seal(lua_State *L) {
+
+int console_AS_seal(lua_State*)
+{
XBT_DEBUG("Sealing AS");
sg_platf_new_Zone_seal();
return 0;
#include "lua_private.hpp"
#include "lua_utils.hpp"
#include "src/surf/xml/platf.hpp"
-
+#include <lauxlib.h>
XBT_LOG_NEW_DEFAULT_CATEGORY(lua, "Lua Bindings");
-#include <lauxlib.h>
-
extern "C" int luaopen_simgrid(lua_State* L);
/* ********************************************************************************* */