Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
smpirun: really disable privatization with -no-privatize.
[simgrid.git] / src / bindings / lua / simgrid_lua.cpp
index 61fcd2f..b6ca7a4 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2015. The SimGrid Team.
+/* Copyright (c) 2010-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -6,18 +6,16 @@
 
 /* SimGrid Lua bindings                                                     */
 
-#include "lua_private.h"
-#include "lua_utils.h"
+#include "lua_private.hpp"
+#include "lua_utils.hpp"
 #include "src/surf/xml/platf.hpp"
 
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(lua, "Lua Bindings");
 
-extern "C" {
 #include <lauxlib.h>
 
-int luaopen_simgrid(lua_State *L);
-}
+extern "C" int luaopen_simgrid(lua_State* L);
 
 /* ********************************************************************************* */
 /*                                  simgrid API                                      */
@@ -69,7 +67,7 @@ static int critical(lua_State* L) {
  * @brief Dumps a lua table with XBT_DEBUG
  *
  * This function can be called from within lua via "simgrid.dump(table)". It will
- * then dump the table via XBT_DEBUG 
+ * then dump the table via XBT_DEBUG
  */
 static int dump(lua_State* L) {
   int argc = lua_gettop(L);
@@ -78,7 +76,7 @@ static int dump(lua_State* L) {
     if (lua_istable(L, i)) {
       lua_pushnil(L); /* table nil */
 
-      //lua_next pops the topmost element from the stack and 
+      //lua_next pops the topmost element from the stack and
       //gets the next pair from the table at the specified index
       while (lua_next(L, i)) { /* table key val  */
         // we need to copy here, as a cast from "Number" to "String"
@@ -104,7 +102,7 @@ static const luaL_Reg simgrid_functions[] = {
   {"info", info},
   {"critical", critical},
   {"error", error},
-  {NULL, NULL}
+  {nullptr, nullptr}
 };
 
 /* ********************************************************************************* */