From 3e9fcacf070001c34c7b447642ea23cf251dbe50 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Sun, 20 Oct 2013 04:02:09 -0300 Subject: [PATCH] Code style fixes --- src/libraries/luasocket/luasocket.cpp | 129 +++++++++++++------------- src/libraries/luasocket/luasocket.h | 25 ++--- src/modules/audio/null/Audio.cpp | 3 +- src/modules/audio/openal/Audio.cpp | 3 +- 4 files changed, 82 insertions(+), 78 deletions(-) diff --git a/src/libraries/luasocket/luasocket.cpp b/src/libraries/luasocket/luasocket.cpp index 13af3eaec..7e467ad63 100644 --- a/src/libraries/luasocket/luasocket.cpp +++ b/src/libraries/luasocket/luasocket.cpp @@ -39,82 +39,83 @@ namespace love { namespace luasocket { - int __open(lua_State * L) - { - // Preload code from LuaSocket. - PRELOAD("socket.core", luaopen_socket_core); - PRELOAD("mime.core", luaopen_mime_core); +int __open(lua_State * L) +{ - PRELOAD("socket", __open_luasocket_socket); - PRELOAD("socket.ftp", __open_luasocket_ftp) - PRELOAD("socket.http", __open_luasocket_http); - PRELOAD("ltn12", __open_luasocket_ltn12); - PRELOAD("mime", __open_luasocket_mime) - PRELOAD("socket.smtp", __open_luasocket_smtp); - PRELOAD("socket.tp", __open_luasocket_tp) - PRELOAD("socket.url", __open_luasocket_url) + // Preload code from LuaSocket. + PRELOAD("socket.core", luaopen_socket_core); + PRELOAD("mime.core", luaopen_mime_core); - // No need to register garbage collector function. + PRELOAD("socket", __open_luasocket_socket); + PRELOAD("socket.ftp", __open_luasocket_ftp) + PRELOAD("socket.http", __open_luasocket_http); + PRELOAD("ltn12", __open_luasocket_ltn12); + PRELOAD("mime", __open_luasocket_mime) + PRELOAD("socket.smtp", __open_luasocket_smtp); + PRELOAD("socket.tp", __open_luasocket_tp) + PRELOAD("socket.url", __open_luasocket_url) - return 0; - } + // No need to register garbage collector function. - int __open_luasocket_socket(lua_State * L) - { - #include "libluasocket/socket.lua.h" - lua_getglobal(L, "socket"); - return 1; - } + return 0; +} - int __open_luasocket_ftp(lua_State * L) - { - #include "libluasocket/ftp.lua.h" - lua_getglobal(L, "socket.ftp"); - return 1; - } +int __open_luasocket_socket(lua_State * L) +{ + #include "libluasocket/socket.lua.h" + lua_getglobal(L, "socket"); + return 1; +} - int __open_luasocket_http(lua_State * L) - { - #include "libluasocket/http.lua.h" - lua_getglobal(L, "socket.http"); - return 1; - } +int __open_luasocket_ftp(lua_State * L) +{ + #include "libluasocket/ftp.lua.h" + lua_getglobal(L, "socket.ftp"); + return 1; +} - int __open_luasocket_ltn12(lua_State * L) - { - #include "libluasocket/ltn12.lua.h" - lua_getglobal(L, "ltn12"); - return 1; - } +int __open_luasocket_http(lua_State * L) +{ + #include "libluasocket/http.lua.h" + lua_getglobal(L, "socket.http"); + return 1; +} - int __open_luasocket_mime(lua_State * L) - { - #include "libluasocket/mime.lua.h" - lua_getglobal(L, "mime"); - return 1; - } +int __open_luasocket_ltn12(lua_State * L) +{ + #include "libluasocket/ltn12.lua.h" + lua_getglobal(L, "ltn12"); + return 1; +} - int __open_luasocket_smtp(lua_State * L) - { - #include "libluasocket/smtp.lua.h" - lua_getglobal(L, "socket.smtp"); - return 1; - } +int __open_luasocket_mime(lua_State * L) +{ + #include "libluasocket/mime.lua.h" + lua_getglobal(L, "mime"); + return 1; +} - int __open_luasocket_tp(lua_State * L) - { - #include "libluasocket/tp.lua.h" - lua_getglobal(L, "socket.tp"); - return 1; - } +int __open_luasocket_smtp(lua_State * L) +{ + #include "libluasocket/smtp.lua.h" + lua_getglobal(L, "socket.smtp"); + return 1; +} - int __open_luasocket_url(lua_State * L) - { - #include "libluasocket/url.lua.h" - lua_getglobal(L, "socket.url"); - return 1; - } +int __open_luasocket_tp(lua_State * L) +{ + #include "libluasocket/tp.lua.h" + lua_getglobal(L, "socket.tp"); + return 1; +} + +int __open_luasocket_url(lua_State * L) +{ + #include "libluasocket/url.lua.h" + lua_getglobal(L, "socket.url"); + return 1; +} } // luasocket } // love diff --git a/src/libraries/luasocket/luasocket.h b/src/libraries/luasocket/luasocket.h index d0319e105..8f13cee3f 100644 --- a/src/libraries/luasocket/luasocket.h +++ b/src/libraries/luasocket/luasocket.h @@ -28,19 +28,20 @@ namespace love { namespace luasocket { - int __open(lua_State * L); - // Loaders for all lua files. We want to be able - // to load these dynamically. (Identical in the LuaSocket - // documentation. These functions wrap the parsing of code, etc). - int __open_luasocket_socket(lua_State * L); - int __open_luasocket_ftp(lua_State * L); - int __open_luasocket_http(lua_State * L); - int __open_luasocket_ltn12(lua_State * L); - int __open_luasocket_mime(lua_State * L); - int __open_luasocket_smtp(lua_State * L); - int __open_luasocket_tp(lua_State * L); - int __open_luasocket_url(lua_State * L); +int __open(lua_State * L); + +// Loaders for all lua files. We want to be able +// to load these dynamically. (Identical in the LuaSocket +// documentation. These functions wrap the parsing of code, etc). +int __open_luasocket_socket(lua_State * L); +int __open_luasocket_ftp(lua_State * L); +int __open_luasocket_http(lua_State * L); +int __open_luasocket_ltn12(lua_State * L); +int __open_luasocket_mime(lua_State * L); +int __open_luasocket_smtp(lua_State * L); +int __open_luasocket_tp(lua_State * L); +int __open_luasocket_url(lua_State * L); } // luasocket } // love diff --git a/src/modules/audio/null/Audio.cpp b/src/modules/audio/null/Audio.cpp index a96125ab8..328a8c573 100644 --- a/src/modules/audio/null/Audio.cpp +++ b/src/modules/audio/null/Audio.cpp @@ -27,7 +27,8 @@ namespace audio namespace null { -Audio::Audio() : distanceModel(DISTANCE_NONE) +Audio::Audio() + : distanceModel(DISTANCE_NONE) { } diff --git a/src/modules/audio/openal/Audio.cpp b/src/modules/audio/openal/Audio.cpp index 645f61e1d..0fac2f574 100644 --- a/src/modules/audio/openal/Audio.cpp +++ b/src/modules/audio/openal/Audio.cpp @@ -68,7 +68,8 @@ void Audio::PoolThread::setFinish() finish = true; } -Audio::Audio() : distanceModel(DISTANCE_INVERSE_CLAMPED) +Audio::Audio() + : distanceModel(DISTANCE_INVERSE_CLAMPED) { // Passing zero for default device. device = alcOpenDevice(0);