A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Avoid using memset to initialize structs.
[simgrid.git]
/
src
/
bindings
/
lua
/
lua_platf.cpp
diff --git
a/src/bindings/lua/lua_platf.cpp
b/src/bindings/lua/lua_platf.cpp
index
6f45328
..
471e322
100644
(file)
--- a/
src/bindings/lua/lua_platf.cpp
+++ b/
src/bindings/lua/lua_platf.cpp
@@
-140,8
+140,7
@@
int console_add_host___link(lua_State *L) {
}
int console_add_host(lua_State *L) {
}
int console_add_host(lua_State *L) {
- s_sg_platf_host_cbarg_t host;
- memset(&host,0,sizeof(host));
+ s_sg_platf_host_cbarg_t host{};
int type;
// we get values from the table passed as argument
int type;
// we get values from the table passed as argument
@@
-303,8
+302,7
@@
int console_add_router(lua_State* L) {
int console_add_route(lua_State *L) {
XBT_DEBUG("Adding route");
int console_add_route(lua_State *L) {
XBT_DEBUG("Adding route");
- s_sg_platf_route_cbarg_t route;
- memset(&route,0,sizeof(route));
+ s_sg_platf_route_cbarg_t route{};
int type;
lua_ensure(lua_istable(L, -1), "Bad Arguments to add a route. Should be a table with named arguments");
int type;
lua_ensure(lua_istable(L, -1), "Bad Arguments to add a route. Should be a table with named arguments");
@@
-377,8
+375,7
@@
int console_add_route(lua_State *L) {
}
int console_add_ASroute(lua_State *L) {
}
int console_add_ASroute(lua_State *L) {
- s_sg_platf_route_cbarg_t ASroute;
- memset(&ASroute,0,sizeof(ASroute));
+ s_sg_platf_route_cbarg_t ASroute{};
lua_pushstring(L, "src");
lua_gettable(L, -2);
lua_pushstring(L, "src");
lua_gettable(L, -2);