diff options
Diffstat (limited to 'xmake/templates/c++/module.shared')
| -rw-r--r-- | xmake/templates/c++/module.shared/project/modules/shared/foo/src/foo.cpp | 13 | ||||
| -rw-r--r-- | xmake/templates/c++/module.shared/project/src/main.cpp | 2 |
2 files changed, 5 insertions, 10 deletions
diff --git a/xmake/templates/c++/module.shared/project/modules/shared/foo/src/foo.cpp b/xmake/templates/c++/module.shared/project/modules/shared/foo/src/foo.cpp index a98baca02..adde214ca 100644 --- a/xmake/templates/c++/module.shared/project/modules/shared/foo/src/foo.cpp +++ b/xmake/templates/c++/module.shared/project/modules/shared/foo/src/foo.cpp @@ -1,27 +1,22 @@ #include <xmi.h> -static int add(lua_State* lua) { +static int add(lua_State *lua) { int a = lua_tointeger(lua, 1); int b = lua_tointeger(lua, 2); lua_pushinteger(lua, a + b); return 1; } -static int sub(lua_State* lua) { +static int sub(lua_State *lua) { int a = lua_tointeger(lua, 1); int b = lua_tointeger(lua, 2); lua_pushinteger(lua, a - b); return 1; } -int luaopen(foo, lua_State* lua) { - static const luaL_Reg funcs[] = { - {"add", add}, - {"sub", sub}, - {NULL, NULL} - }; +int luaopen(foo, lua_State *lua) { + static const luaL_Reg funcs[] = { { "add", add }, { "sub", sub }, { NULL, NULL } }; lua_newtable(lua); luaL_setfuncs(lua, funcs, 0); return 1; } - diff --git a/xmake/templates/c++/module.shared/project/src/main.cpp b/xmake/templates/c++/module.shared/project/src/main.cpp index 7c775d288..9b6abffea 100644 --- a/xmake/templates/c++/module.shared/project/src/main.cpp +++ b/xmake/templates/c++/module.shared/project/src/main.cpp @@ -1,6 +1,6 @@ #include <iostream> -int main(int argc, char** argv) { +int main(int argc, char **argv) { std::cout << "hello world!" << std::endl; return 0; } |
