From 9b82c7871d8d9a8561812d5c2d5a67e151d8fcb6 Mon Sep 17 00:00:00 2001 From: Joris Clement Date: Mon, 6 Aug 2018 15:30:13 +0200 Subject: Fix gcc-8.1.0 warning. --- src/mime.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mime.c') diff --git a/src/mime.c b/src/mime.c index ed44104..db356fc 100644 --- a/src/mime.c +++ b/src/mime.c @@ -689,6 +689,7 @@ static size_t dot(int c, size_t state, luaL_Buffer *buffer) case '.': if (state == 2) luaL_addchar(buffer, '.'); + /* Falls through. */ default: return 0; } -- cgit v1.2.3-55-g6feb From 288219fd6b53ce2e709745c9918aa4c4b7f715c9 Mon Sep 17 00:00:00 2001 From: Diego Nehab Date: Wed, 22 Aug 2018 17:37:32 -0300 Subject: Update to Visual Studio 2017. --- .gitignore | 1 - Lua.props | 28 +++++++++ Lua51.props | 28 --------- Lua52.props | 28 --------- mime.vcxproj | 61 ++++++++++---------- socket.vcxproj | 173 ++++++++++++++++++++++++++++---------------------------- src/luasocket.c | 2 +- src/makefile | 2 +- src/mime.c | 2 +- src/wsocket.c | 4 +- 10 files changed, 151 insertions(+), 178 deletions(-) create mode 100755 Lua.props delete mode 100644 Lua51.props delete mode 100644 Lua52.props mode change 100644 => 100755 src/luasocket.c mode change 100644 => 100755 src/mime.c mode change 100644 => 100755 src/wsocket.c (limited to 'src/mime.c') diff --git a/.gitignore b/.gitignore index 8307483..9ed661c 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,6 @@ *.dll* *.user *.sdf -Lua.props Debug Release *.manifest diff --git a/Lua.props b/Lua.props new file mode 100755 index 0000000..bdfca40 --- /dev/null +++ b/Lua.props @@ -0,0 +1,28 @@ + + + + + z:\data\build\vc14\ + $(BUILD)\bin\lua\5.3\ + $(BUILD)\lib\lua\5.3\ + $(BUILD)\include\lua\5.3\ + + + <_PropertySheetDisplayName>Lua53 + + + + + $(LUALIB) + + + $(LUAINC) + + + $(LUABIN) + + + $(BUILD) + + + diff --git a/Lua51.props b/Lua51.props deleted file mode 100644 index 1bd6256..0000000 --- a/Lua51.props +++ /dev/null @@ -1,28 +0,0 @@ - - - - - ..\build\vc12\bin\lua\5.1\ - ..\build\vc12\bin\lua\5.1\ - ..\build\vc12\include\lua\5.1\ - lua51.lib - - - <_PropertySheetDisplayName>Lua51 - - - - - $(LUALIB_PATH) - - - $(LUABIN_PATH) - - - $(LUAINC_PATH) - - - $(LUALIB) - - - diff --git a/Lua52.props b/Lua52.props deleted file mode 100644 index 01afcfa..0000000 --- a/Lua52.props +++ /dev/null @@ -1,28 +0,0 @@ - - - - - ..\build\vc12\bin\lua\5.2\ - ..\build\vc12\bin\lua\5.2\ - ..\build\vc12\include\lua\5.2\ - lua52.lib - - - <_PropertySheetDisplayName>Lua52 - - - - - $(LUALIB_PATH) - - - $(LUABIN_PATH) - - - $(LUAINC_PATH) - - - $(LUALIB) - - - diff --git a/mime.vcxproj b/mime.vcxproj index c77d611..74bba0c 100755 --- a/mime.vcxproj +++ b/mime.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -24,39 +24,40 @@ Document - copy %(FullPath) $(LUABIN_PATH)$(Configuration) - $(LUABIN_PATH)$(Configuration)\%(Filename)%(Extension) - copy %(FullPath) $(LUABIN_PATH)$(Configuration) - $(LUABIN_PATH)$(Configuration)\%(Filename)%(Extension) - copy %(FullPath) $(LUALIB_PATH)$(Platform)\$(Configuration) - copy %(FullPath) $(LUALIB_PATH)$(Platform)\$(Configuration) - $(LUABIN_PATH)$(Platform)\$(Configuration)\%(Filename)%(Extension) - $(LUABIN_PATH)$(Platform)\$(Configuration)\%(Filename)%(Extension) + copy %(FullPath) $(LUABIN)$(Configuration) + copy %(FullPath) $(LUABIN)$(Configuration) + copy %(FullPath) $(LUABIN)$(Platform)\$(Configuration) + copy %(FullPath) $(LUABIN)$(Platform)\$(Configuration) + $(LUABIN)$(Configuration)\%(Filename)%(Extension) + $(LUABIN)$(Configuration)\%(Filename)%(Extension) + $(LUABIN)$(Platform)\$(Configuration)\%(Filename)%(Extension) + $(LUABIN)$(Platform)\$(Configuration)\%(Filename)%(Extension) {128E8BD0-174A-48F0-8771-92B1E8D18713} Win32Proj + 10.0.15063.0 DynamicLibrary - v110 + v141 MultiByte DynamicLibrary - v110 + v141 MultiByte DynamicLibrary - v110 + v141 MultiByte DynamicLibrary - v110 + v141 MultiByte @@ -87,7 +88,7 @@ <_ProjectFileVersion>11.0.50727.1 - $(LUABIN_PATH)$(Configuration)\mime\ + $(LUABIN)$(Configuration)\mime\ $(Configuration)\ true core @@ -95,23 +96,23 @@ true core - $(LUABIN_PATH)$(Platform)\$(Configuration)\mime\ + $(LUABIN)$(Platform)\$(Configuration)\mime\ - $(LUABIN_PATH)$(Configuration)\mime\ + $(LUABIN)$(Configuration)\mime\ $(Configuration)\ false core false - $(LUABIN_PATH)$(Platform)\$(Configuration)\mime\ + $(LUABIN)$(Platform)\$(Configuration)\mime\ core Disabled - $(LUAINC_PATH);%(AdditionalIncludeDirectories) + $(LUAINC);%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;_USRDLL;MIME_API=__declspec(dllexport);_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true EnableFastChecks @@ -122,9 +123,9 @@ $(IntDir)$(TargetName)$(PlatformToolsetVersion).pdb - $(LUALIB);%(AdditionalDependencies) + lualib.lib;%(AdditionalDependencies) $(OutDir)$(TargetName).dll - $(LUALIB_PATH)$(Configuration);%(AdditionalLibraryDirectories) + $(LUALIB)$(Configuration);%(AdditionalLibraryDirectories) true $(OutDir)mime.pdb Windows @@ -138,7 +139,7 @@ Disabled - $(LUAINC_PATH);%(AdditionalIncludeDirectories) + $(LUAINC);%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;_USRDLL;MIME_API=__declspec(dllexport);_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebugDLL @@ -149,9 +150,9 @@ $(IntDir)$(TargetName)$(PlatformToolsetVersion).pdb - $(LUALIB);%(AdditionalDependencies) + lualib.lib;%(AdditionalDependencies) $(OutDir)$(TargetName).dll - $(LUALIB_PATH)$(Platform)\$(Configuration);%(AdditionalLibraryDirectories) + $(LUALIB)$(Platform)\$(Configuration);%(AdditionalLibraryDirectories) true $(OutDir)mime.pdb Windows @@ -163,7 +164,7 @@ - $(LUAINC_PATH);%(AdditionalIncludeDirectories) + $(LUAINC);%(AdditionalIncludeDirectories) WIN32;NDEBUG;_WINDOWS;_USRDLL;MIME_API=__declspec(dllexport);_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) MultiThreadedDLL @@ -172,9 +173,9 @@ $(IntDir)$(TargetName)$(PlatformToolsetVersion).pdb - $(LUALIB);%(AdditionalDependencies) + lualib.lib;%(AdditionalDependencies) $(OutDir)$(TargetName).dll - $(LUALIB_PATH)$(Configuration);%(AdditionalLibraryDirectories) + $(LUALIB)$(Configuration);%(AdditionalLibraryDirectories) true Windows true @@ -187,7 +188,7 @@ - $(LUAINC_PATH);%(AdditionalIncludeDirectories) + $(LUAINC);%(AdditionalIncludeDirectories) WIN32;NDEBUG;_WINDOWS;_USRDLL;MIME_API=__declspec(dllexport);_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) MultiThreadedDLL @@ -198,9 +199,9 @@ $(IntDir)$(TargetName)$(PlatformToolsetVersion).pdb - $(LUALIB);%(AdditionalDependencies) + lualib.lib;%(AdditionalDependencies) $(OutDir)$(TargetName).dll - $(LUALIB_PATH)$(Platform)\$(Configuration);%(AdditionalLibraryDirectories) + $(LUALIB)$(Platform)\$(Configuration);%(AdditionalLibraryDirectories) true Windows true @@ -214,4 +215,4 @@ - \ No newline at end of file + diff --git a/socket.vcxproj b/socket.vcxproj index 16daeef..cfa32b3 100755 --- a/socket.vcxproj +++ b/socket.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -35,118 +35,119 @@ Document - copy %(FullPath) $(LUABIN_PATH)$(Configuration) - copy %(FullPath) $(LUABIN_PATH)$(Configuration) - copy %(FullPath) $(LUABIN_PATH)$(Platform)\$(Configuration) - copy %(FullPath) $(LUABIN_PATH)$(Platform)\$(Configuration) - $(LUABIN_PATH)$(Configuration)\%(Filename)%(Extension) - $(LUABIN_PATH)$(Configuration)\%(Filename)%(Extension) - $(LUABIN_PATH)$(Platform)\$(Configuration)\%(Filename)%(Extension) - $(LUABIN_PATH)$(Platform)\$(Configuration)\%(Filename)%(Extension) + copy %(FullPath) $(LUABIN)$(Configuration) + copy %(FullPath) $(LUABIN)$(Configuration) + copy %(FullPath) $(LUABIN)$(Platform)\$(Configuration) + copy %(FullPath) $(LUABIN)$(Platform)\$(Configuration) + $(LUABIN)$(Configuration)\%(Filename)%(Extension) + $(LUABIN)$(Configuration)\%(Filename)%(Extension) + $(LUABIN)$(Platform)\$(Configuration)\%(Filename)%(Extension) + $(LUABIN)$(Platform)\$(Configuration)\%(Filename)%(Extension) Document - copy %(FullPath) $(LUABIN_PATH)$(Configuration) - copy %(FullPath) $(LUABIN_PATH)$(Configuration) - copy %(FullPath) $(LUABIN_PATH)$(Platform)\$(Configuration) - copy %(FullPath) $(LUABIN_PATH)$(Platform)\$(Configuration) - $(LUABIN_PATH)$(Configuration)\%(Filename)%(Extension) - $(LUABIN_PATH)$(Configuration)\%(Filename)%(Extension) - $(LUABIN_PATH)$(Platform)\$(Configuration)\%(Filename)%(Extension) - $(LUABIN_PATH)$(Platform)\$(Configuration)\%(Filename)%(Extension) + copy %(FullPath) $(LUABIN)$(Configuration) + copy %(FullPath) $(LUABIN)$(Configuration) + copy %(FullPath) $(LUABIN)$(Platform)\$(Configuration) + copy %(FullPath) $(LUABIN)$(Platform)\$(Configuration) + $(LUABIN)$(Configuration)\%(Filename)%(Extension) + $(LUABIN)$(Configuration)\%(Filename)%(Extension) + $(LUABIN)$(Platform)\$(Configuration)\%(Filename)%(Extension) + $(LUABIN)$(Platform)\$(Configuration)\%(Filename)%(Extension) Document - $(LUABIN_PATH)$(Platform)\$(Configuration)\socket\%(Filename)%(Extension) - $(LUABIN_PATH)$(Platform)\$(Configuration)\socket\%(Filename)%(Extension) - $(LUABIN_PATH)$(Configuration)\socket\%(Filename)%(Extension) - $(LUABIN_PATH)$(Configuration)\socket\%(Filename)%(Extension) - copy %(FullPath) $(LUABIN_PATH)$(Platform)\$(Configuration)\socket - copy %(FullPath) $(LUABIN_PATH)$(Platform)\$(Configuration)\socket - copy %(FullPath) $(LUABIN_PATH)$(Configuration)\socket - copy %(FullPath) $(LUABIN_PATH)$(Configuration)\socket + copy %(FullPath) $(LUABIN)$(Configuration) + copy %(FullPath) $(LUABIN)$(Configuration) + copy %(FullPath) $(LUABIN)$(Platform)\$(Configuration) + copy %(FullPath) $(LUABIN)$(Platform)\$(Configuration) + $(LUABIN)$(Configuration)\%(Filename)%(Extension) + $(LUABIN)$(Configuration)\%(Filename)%(Extension) + $(LUABIN)$(Platform)\$(Configuration)\%(Filename)%(Extension) + $(LUABIN)$(Platform)\$(Configuration)\%(Filename)%(Extension) Document - $(LUABIN_PATH)$(Platform)\$(Configuration)\socket\%(Filename)%(Extension) - $(LUABIN_PATH)$(Platform)\$(Configuration)\socket\%(Filename)%(Extension) - $(LUABIN_PATH)$(Configuration)\socket\%(Filename)%(Extension) - $(LUABIN_PATH)$(Configuration)\socket\%(Filename)%(Extension) - copy %(FullPath) $(LUABIN_PATH)$(Platform)\$(Configuration)\socket - copy %(FullPath) $(LUABIN_PATH)$(Platform)\$(Configuration)\socket - copy %(FullPath) $(LUABIN_PATH)$(Configuration)\socket - copy %(FullPath) $(LUABIN_PATH)$(Configuration)\socket + copy %(FullPath) $(LUABIN)$(Configuration) + copy %(FullPath) $(LUABIN)$(Configuration) + copy %(FullPath) $(LUABIN)$(Platform)\$(Configuration) + copy %(FullPath) $(LUABIN)$(Platform)\$(Configuration) + $(LUABIN)$(Configuration)\%(Filename)%(Extension) + $(LUABIN)$(Configuration)\%(Filename)%(Extension) + $(LUABIN)$(Platform)\$(Configuration)\%(Filename)%(Extension) + $(LUABIN)$(Platform)\$(Configuration)\%(Filename)%(Extension) Document - $(LUABIN_PATH)$(Platform)\$(Configuration)\socket\%(Filename)%(Extension) - $(LUABIN_PATH)$(Platform)\$(Configuration)\socket\%(Filename)%(Extension) - $(LUABIN_PATH)$(Configuration)\socket\%(Filename)%(Extension) - $(LUABIN_PATH)$(Configuration)\socket\%(Filename)%(Extension) - copy %(FullPath) $(LUABIN_PATH)$(Platform)\$(Configuration)\socket - copy %(FullPath) $(LUABIN_PATH)$(Platform)\$(Configuration)\socket - copy %(FullPath) $(LUABIN_PATH)$(Configuration)\socket - copy %(FullPath) $(LUABIN_PATH)$(Configuration)\socket + copy %(FullPath) $(LUABIN)$(Configuration) + copy %(FullPath) $(LUABIN)$(Configuration) + copy %(FullPath) $(LUABIN)$(Platform)\$(Configuration) + copy %(FullPath) $(LUABIN)$(Platform)\$(Configuration) + $(LUABIN)$(Configuration)\%(Filename)%(Extension) + $(LUABIN)$(Configuration)\%(Filename)%(Extension) + $(LUABIN)$(Platform)\$(Configuration)\%(Filename)%(Extension) + $(LUABIN)$(Platform)\$(Configuration)\%(Filename)%(Extension) Document - $(LUABIN_PATH)$(Platform)\$(Configuration)\socket\%(Filename)%(Extension) - $(LUABIN_PATH)$(Platform)\$(Configuration)\socket\%(Filename)%(Extension) - $(LUABIN_PATH)$(Configuration)\socket\%(Filename)%(Extension) - $(LUABIN_PATH)$(Configuration)\socket\%(Filename)%(Extension) - copy %(FullPath) $(LUABIN_PATH)$(Platform)\$(Configuration)\socket - copy %(FullPath) $(LUABIN_PATH)$(Platform)\$(Configuration)\socket - copy %(FullPath) $(LUABIN_PATH)$(Configuration)\socket - copy %(FullPath) $(LUABIN_PATH)$(Configuration)\socket + copy %(FullPath) $(LUABIN)$(Configuration) + copy %(FullPath) $(LUABIN)$(Configuration) + copy %(FullPath) $(LUABIN)$(Platform)\$(Configuration) + copy %(FullPath) $(LUABIN)$(Platform)\$(Configuration) + $(LUABIN)$(Configuration)\%(Filename)%(Extension) + $(LUABIN)$(Configuration)\%(Filename)%(Extension) + $(LUABIN)$(Platform)\$(Configuration)\%(Filename)%(Extension) + $(LUABIN)$(Platform)\$(Configuration)\%(Filename)%(Extension) Document - $(LUABIN_PATH)$(Platform)\$(Configuration)\socket\%(Filename)%(Extension) - $(LUABIN_PATH)$(Platform)\$(Configuration)\socket\%(Filename)%(Extension) - $(LUABIN_PATH)$(Configuration)\socket\%(Filename)%(Extension) - $(LUABIN_PATH)$(Configuration)\socket\%(Filename)%(Extension) - copy %(FullPath) $(LUABIN_PATH)$(Platform)\$(Configuration)\socket - copy %(FullPath) $(LUABIN_PATH)$(Platform)\$(Configuration)\socket - copy %(FullPath) $(LUABIN_PATH)$(Configuration)\socket - copy %(FullPath) $(LUABIN_PATH)$(Configuration)\socket + copy %(FullPath) $(LUABIN)$(Configuration) + copy %(FullPath) $(LUABIN)$(Configuration) + copy %(FullPath) $(LUABIN)$(Platform)\$(Configuration) + copy %(FullPath) $(LUABIN)$(Platform)\$(Configuration) + $(LUABIN)$(Configuration)\%(Filename)%(Extension) + $(LUABIN)$(Configuration)\%(Filename)%(Extension) + $(LUABIN)$(Platform)\$(Configuration)\%(Filename)%(Extension) + $(LUABIN)$(Platform)\$(Configuration)\%(Filename)%(Extension) Document - $(LUABIN_PATH)$(Platform)\$(Configuration)\socket\%(Filename)%(Extension) - $(LUABIN_PATH)$(Platform)\$(Configuration)\socket\%(Filename)%(Extension) - $(LUABIN_PATH)$(Configuration)\socket\%(Filename)%(Extension) - $(LUABIN_PATH)$(Configuration)\socket\%(Filename)%(Extension) - copy %(FullPath) $(LUABIN_PATH)$(Platform)\$(Configuration)\socket - copy %(FullPath) $(LUABIN_PATH)$(Platform)\$(Configuration)\socket - copy %(FullPath) $(LUABIN_PATH)$(Configuration)\socket - copy %(FullPath) $(LUABIN_PATH)$(Configuration)\socket + copy %(FullPath) $(LUABIN)$(Configuration) + copy %(FullPath) $(LUABIN)$(Configuration) + copy %(FullPath) $(LUABIN)$(Platform)\$(Configuration) + copy %(FullPath) $(LUABIN)$(Platform)\$(Configuration) + $(LUABIN)$(Configuration)\%(Filename)%(Extension) + $(LUABIN)$(Configuration)\%(Filename)%(Extension) + $(LUABIN)$(Platform)\$(Configuration)\%(Filename)%(Extension) + $(LUABIN)$(Platform)\$(Configuration)\%(Filename)%(Extension) {66E3CE14-884D-4AEA-9F20-15A0BEAF8C5A} Win32Proj + 10.0.15063.0 DynamicLibrary - v110 + v141 MultiByte DynamicLibrary - v110 + v141 MultiByte DynamicLibrary - v110 + v141 MultiByte DynamicLibrary - v110 + v141 MultiByte @@ -177,7 +178,7 @@ <_ProjectFileVersion>11.0.50727.1 - $(LUALIB_PATH)$(Configuration)\socket\ + $(LUABIN)$(Configuration)\socket\ $(Configuration)\ true core @@ -185,23 +186,23 @@ true core - $(LUABIN_PATH)$(Platform)\$(Configuration)\socket\ + $(LUABIN)$(Platform)\$(Configuration)\socket\ - $(LUALIB_PATH)$(Configuration)\socket\ + $(LUABIN)$(Configuration)\socket\ $(Configuration)\ false core false - $(LUABIN_PATH)$(Platform)\$(Configuration)\socket\ + $(LUABIN)$(Platform)\$(Configuration)\socket\ core Disabled - $(LUAINC_PATH);%(AdditionalIncludeDirectories) + $(LUAINC);%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;_USRDLL;LUASOCKET_API=__declspec(dllexport);_CRT_SECURE_NO_WARNINGS;LUASOCKET_DEBUG;%(PreprocessorDefinitions) true EnableFastChecks @@ -212,9 +213,9 @@ $(IntDir)$(TargetName)$(PlatformToolsetVersion).pdb - $(LUALIB);ws2_32.lib;%(AdditionalDependencies) + lualib.lib;ws2_32.lib;%(AdditionalDependencies) $(OutDir)$(TargetName).dll - $(LUALIB_PATH)$(Configuration);%(AdditionalLibraryDirectories) + $(LUALIB)$(Configuration);%(AdditionalLibraryDirectories) true $(OutDir)mime.pdb Windows @@ -228,7 +229,7 @@ Disabled - $(LUAINC_PATH);%(AdditionalIncludeDirectories) + $(LUAINC);%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;_USRDLL;LUASOCKET_API=__declspec(dllexport);_CRT_SECURE_NO_WARNINGS;LUASOCKET_DEBUG;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebugDLL @@ -239,9 +240,9 @@ $(IntDir)$(TargetName)$(PlatformToolsetVersion).pdb - $(LUALIB);ws2_32.lib;%(AdditionalDependencies) + lualib.lib;ws2_32.lib;%(AdditionalDependencies) $(OutDir)$(TargetName).dll - $(LUALIB_PATH)$(Platform)\$(Configuration);%(AdditionalLibraryDirectories) + $(LUALIB)$(Platform)\$(Configuration);%(AdditionalLibraryDirectories) true $(OutDir)mime.pdb Windows @@ -253,7 +254,7 @@ - $(LUAINC_PATH);%(AdditionalIncludeDirectories) + $(LUAINC);%(AdditionalIncludeDirectories) WIN32;NDEBUG;_WINDOWS;_USRDLL;LUASOCKET_API=__declspec(dllexport);_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) MultiThreadedDLL @@ -262,9 +263,9 @@ $(IntDir)$(TargetName)$(PlatformToolsetVersion).pdb - $(LUALIB);ws2_32.lib;%(AdditionalDependencies) + lualib.lib;ws2_32.lib;%(AdditionalDependencies) $(OutDir)$(TargetName).dll - $(LUALIB_PATH)$(Configuration);%(AdditionalLibraryDirectories) + $(LUALIB)$(Configuration);%(AdditionalLibraryDirectories) true Windows true @@ -277,7 +278,7 @@ - $(LUAINC_PATH);%(AdditionalIncludeDirectories) + $(LUAINC);%(AdditionalIncludeDirectories) WIN32;NDEBUG;_WINDOWS;_USRDLL;LUASOCKET_API=__declspec(dllexport);_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) MultiThreadedDLL @@ -288,9 +289,9 @@ $(IntDir)$(TargetName)$(PlatformToolsetVersion).pdb - $(LUALIB);ws2_32.lib;%(AdditionalDependencies) + lualib.lib;ws2_32.lib;%(AdditionalDependencies) $(OutDir)$(TargetName).dll - $(LUALIB_PATH)$(Platform)\$(Configuration);%(AdditionalLibraryDirectories) + $(LUALIB)$(Platform)\$(Configuration);%(AdditionalLibraryDirectories) true Windows true @@ -304,4 +305,4 @@ - \ No newline at end of file + diff --git a/src/luasocket.c b/src/luasocket.c old mode 100644 new mode 100755 index 7d9c802..d2752a7 --- a/src/luasocket.c +++ b/src/luasocket.c @@ -64,7 +64,7 @@ static luaL_Reg func[] = { * Skip a few arguments \*-------------------------------------------------------------------------*/ static int global_skip(lua_State *L) { - int amount = luaL_checkinteger(L, 1); + int amount = (int) luaL_checkinteger(L, 1); int ret = lua_gettop(L) - amount - 1; return ret >= 0 ? ret : 0; } diff --git a/src/makefile b/src/makefile index 494baab..1ed3f4f 100644 --- a/src/makefile +++ b/src/makefile @@ -386,7 +386,7 @@ $(UNIX_SO): $(UNIX_OBJS) $(SERIAL_SO): $(SERIAL_OBJS) $(LD) $(SERIAL_OBJS) $(LDFLAGS)$@ -install: +install: $(INSTALL_DIR) $(INSTALL_TOP_LDIR) $(INSTALL_DATA) $(TO_TOP_LDIR) $(INSTALL_TOP_LDIR) $(INSTALL_DIR) $(INSTALL_SOCKET_LDIR) diff --git a/src/mime.c b/src/mime.c old mode 100644 new mode 100755 index db356fc..338ecd4 --- a/src/mime.c +++ b/src/mime.c @@ -654,7 +654,7 @@ static int eolprocess(int c, int last, const char *marker, \*-------------------------------------------------------------------------*/ static int mime_global_eol(lua_State *L) { - int ctx = luaL_checkinteger(L, 1); + int ctx = (int) luaL_checkinteger(L, 1); size_t isize = 0; const char *input = luaL_optlstring(L, 2, NULL, &isize); const char *last = input + isize; diff --git a/src/wsocket.c b/src/wsocket.c old mode 100644 new mode 100755 index 8ecb0fc..ac8411f --- a/src/wsocket.c +++ b/src/wsocket.c @@ -131,11 +131,11 @@ int socket_connect(p_socket ps, SA *addr, socklen_t len, p_timeout tm) { /* we wait until something happens */ err = socket_waitfd(ps, WAITFD_C, tm); if (err == IO_CLOSED) { - int len = sizeof(err); + int elen = sizeof(err); /* give windows time to set the error (yes, disgusting) */ Sleep(10); /* find out why we failed */ - getsockopt(*ps, SOL_SOCKET, SO_ERROR, (char *)&err, &len); + getsockopt(*ps, SOL_SOCKET, SO_ERROR, (char *)&err, &elen); /* we KNOW there was an error. if 'why' is 0, we will return * "unknown error", but it's not really our fault */ return err > 0? err: IO_UNKNOWN; -- cgit v1.2.3-55-g6feb From 1f6035070fd5e2185dfb3a3bf48e1d12668c6599 Mon Sep 17 00:00:00 2001 From: "E. Westbrook" Date: Mon, 25 Feb 2019 15:56:17 -0700 Subject: mime.c: use LUASOCKET_API --- src/mime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mime.c') diff --git a/src/mime.c b/src/mime.c index 338ecd4..6e359af 100755 --- a/src/mime.c +++ b/src/mime.c @@ -76,7 +76,7 @@ static UC b64unbase[256]; /*-------------------------------------------------------------------------*\ * Initializes module \*-------------------------------------------------------------------------*/ -MIME_API int luaopen_mime_core(lua_State *L) +LUASOCKET_API int luaopen_mime_core(lua_State *L) { lua_newtable(L); luaL_setfuncs(L, func, 0); -- cgit v1.2.3-55-g6feb From 03b72d8f7ee5e35f76f97da299ce676946023725 Mon Sep 17 00:00:00 2001 From: Diego Nehab Date: Sat, 9 Mar 2019 23:23:48 -0300 Subject: Use static initialization This helps with multi-threaded apps. --- src/makefile | 3 +- src/mime.c | 152 +++++++++++++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 145 insertions(+), 10 deletions(-) (limited to 'src/mime.c') diff --git a/src/makefile b/src/makefile index e6baf78..b9e2f93 100755 --- a/src/makefile +++ b/src/makefile @@ -35,7 +35,8 @@ DEBUG?=NODEBUG # LUAINC_macosx: # /opt/local/include LUAINC_macosx_base?=/opt/local/include -LUAINC_macosx?=$(LUAINC_macosx_base)/lua/$(LUAV) $(LUAINC_macosx_base)/lua$(LUAV) +LUAINC_macosx?=$(LUAINC_macosx_base)/lua/$(LUAV) $(LUAINC_macosx_base)/lua$(LUAV) $(LUAINC_macosx_base)/lua-$(LUAV) + # FIXME default should this default to fink or to macports? # What happens when more than one Lua version is installed? LUAPREFIX_macosx?=/opt/local diff --git a/src/mime.c b/src/mime.c index 6e359af..ce28826 100755 --- a/src/mime.c +++ b/src/mime.c @@ -3,6 +3,7 @@ * LuaSocket toolkit \*=========================================================================*/ #include +#include #include "lua.h" #include "lauxlib.h" @@ -30,12 +31,12 @@ static int mime_global_eol(lua_State *L); static int mime_global_dot(lua_State *L); static size_t dot(int c, size_t state, luaL_Buffer *buffer); -static void b64setup(UC *base); +//static void b64setup(UC *base); static size_t b64encode(UC c, UC *input, size_t size, luaL_Buffer *buffer); static size_t b64pad(const UC *input, size_t size, luaL_Buffer *buffer); static size_t b64decode(UC c, UC *input, size_t size, luaL_Buffer *buffer); -static void qpsetup(UC *class, UC *unbase); +//static void qpsetup(UC *class, UC *unbase); static void qpquote(UC c, luaL_Buffer *buffer); static size_t qpdecode(UC c, UC *input, size_t size, luaL_Buffer *buffer); static size_t qpencode(UC c, UC *input, size_t size, @@ -58,17 +59,111 @@ static luaL_Reg func[] = { /*-------------------------------------------------------------------------*\ * Quoted-printable globals \*-------------------------------------------------------------------------*/ -static UC qpclass[256]; -static UC qpbase[] = "0123456789ABCDEF"; -static UC qpunbase[256]; enum {QP_PLAIN, QP_QUOTED, QP_CR, QP_IF_LAST}; +static UC qpclass[] = { + QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, + QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_IF_LAST, QP_QUOTED, QP_QUOTED, + QP_QUOTED, QP_CR, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, + QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, + QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, + QP_QUOTED, QP_QUOTED, QP_IF_LAST, QP_PLAIN, QP_PLAIN, QP_PLAIN, + QP_PLAIN, QP_PLAIN, QP_PLAIN, QP_PLAIN, QP_PLAIN, QP_PLAIN, + QP_PLAIN, QP_PLAIN, QP_PLAIN, QP_PLAIN, QP_PLAIN, QP_PLAIN, + QP_PLAIN, QP_PLAIN, QP_PLAIN, QP_PLAIN, QP_PLAIN, QP_PLAIN, + QP_PLAIN, QP_PLAIN, QP_PLAIN, QP_PLAIN, QP_PLAIN, QP_PLAIN, + QP_PLAIN, QP_QUOTED, QP_PLAIN, QP_PLAIN, QP_PLAIN, QP_PLAIN, + QP_PLAIN, QP_PLAIN, QP_PLAIN, QP_PLAIN, QP_PLAIN, QP_PLAIN, + QP_PLAIN, QP_PLAIN, QP_PLAIN, QP_PLAIN, QP_PLAIN, QP_PLAIN, + QP_PLAIN, QP_PLAIN, QP_PLAIN, QP_PLAIN, QP_PLAIN, QP_PLAIN, + QP_PLAIN, QP_PLAIN, QP_PLAIN, QP_PLAIN, QP_PLAIN, QP_PLAIN, + QP_PLAIN, QP_PLAIN, QP_PLAIN, QP_PLAIN, QP_PLAIN, QP_PLAIN, + QP_PLAIN, QP_PLAIN, QP_PLAIN, QP_PLAIN, QP_PLAIN, QP_PLAIN, + QP_PLAIN, QP_PLAIN, QP_PLAIN, QP_PLAIN, QP_PLAIN, QP_PLAIN, + QP_PLAIN, QP_PLAIN, QP_PLAIN, QP_PLAIN, QP_PLAIN, QP_PLAIN, + QP_PLAIN, QP_PLAIN, QP_PLAIN, QP_PLAIN, QP_PLAIN, QP_PLAIN, + QP_PLAIN, QP_PLAIN, QP_PLAIN, QP_PLAIN, QP_PLAIN, QP_PLAIN, + QP_PLAIN, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, + QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, + QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, + QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, + QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, + QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, + QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, + QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, + QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, + QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, + QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, + QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, + QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, + QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, + QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, + QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, + QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, + QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, + QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, + QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, + QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, + QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED +}; + +static const UC qpbase[] = "0123456789ABCDEF"; + +static const UC qpunbase[] = { + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 255, + 255, 255, 255, 255, 255, 255, 10, 11, 12, 13, 14, 15, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 10, 11, 12, 13, 14, 15, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255 +}; + /*-------------------------------------------------------------------------*\ * Base64 globals \*-------------------------------------------------------------------------*/ static const UC b64base[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; -static UC b64unbase[256]; + +static const UC b64unbase[] = { + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 62, 255, 255, 255, 63, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 255, 255, 255, 0, + 255, 255, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 255, 255, + 255, 255, 255, 255, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255 +}; /*=========================================================================*\ * Exported functions @@ -85,8 +180,8 @@ LUASOCKET_API int luaopen_mime_core(lua_State *L) lua_pushstring(L, MIME_VERSION); lua_rawset(L, -3); /* initialize lookup tables */ - qpsetup(qpclass, qpunbase); - b64setup(b64unbase); + // qpsetup(qpclass, qpunbase); + // b64setup(b64unbase); return 1; } @@ -145,13 +240,21 @@ static int mime_global_wrp(lua_State *L) /*-------------------------------------------------------------------------*\ * Fill base64 decode map. \*-------------------------------------------------------------------------*/ +#if 0 static void b64setup(UC *unbase) { int i; for (i = 0; i <= 255; i++) unbase[i] = (UC) 255; for (i = 0; i < 64; i++) unbase[b64base[i]] = (UC) i; unbase['='] = 0; + + printf("static const UC b64unbase[] = {\n"); + for (int i = 0; i < 256; i++) { + printf("%d, ", unbase[i]); + } + printf("\n}\n;"); } +#endif /*-------------------------------------------------------------------------*\ * Acumulates bytes in input buffer until 3 bytes are available. @@ -349,8 +452,10 @@ static int mime_global_unb64(lua_State *L) * Split quoted-printable characters into classes * Precompute reverse map for encoding \*-------------------------------------------------------------------------*/ +#if 0 static void qpsetup(UC *cl, UC *unbase) { + int i; for (i = 0; i < 256; i++) cl[i] = QP_QUOTED; for (i = 33; i <= 60; i++) cl[i] = QP_PLAIN; @@ -367,7 +472,37 @@ static void qpsetup(UC *cl, UC *unbase) unbase['c'] = 12; unbase['D'] = 13; unbase['d'] = 13; unbase['E'] = 14; unbase['e'] = 14; unbase['F'] = 15; unbase['f'] = 15; + +printf("static UC qpclass[] = {"); + for (int i = 0; i < 256; i++) { + if (i % 6 == 0) { + printf("\n "); + } + switch(cl[i]) { + case QP_QUOTED: + printf("QP_QUOTED, "); + break; + case QP_PLAIN: + printf("QP_PLAIN, "); + break; + case QP_CR: + printf("QP_CR, "); + break; + case QP_IF_LAST: + printf("QP_IF_LAST, "); + break; + } + } +printf("\n};\n"); + +printf("static const UC qpunbase[] = {"); + for (int i = 0; i < 256; i++) { + int c = qpunbase[i]; + printf("%d, ", c); + } +printf("\";\n"); } +#endif /*-------------------------------------------------------------------------*\ * Output one character in form =XX @@ -447,7 +582,6 @@ static size_t qppad(UC *input, size_t size, luaL_Buffer *buffer) \*-------------------------------------------------------------------------*/ static int mime_global_qp(lua_State *L) { - size_t asize = 0, isize = 0; UC atom[3]; const UC *input = (const UC *) luaL_optlstring(L, 1, NULL, &isize); -- cgit v1.2.3-55-g6feb From 2af4872a401cbd0c1255e19ee26620f0431dd9f5 Mon Sep 17 00:00:00 2001 From: Diego Nehab Date: Sun, 10 Mar 2019 00:47:17 -0300 Subject: Fix formatting. --- src/mime.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/mime.c') diff --git a/src/mime.c b/src/mime.c index ce28826..0e9863b 100755 --- a/src/mime.c +++ b/src/mime.c @@ -61,7 +61,7 @@ static luaL_Reg func[] = { \*-------------------------------------------------------------------------*/ enum {QP_PLAIN, QP_QUOTED, QP_CR, QP_IF_LAST}; -static UC qpclass[] = { +static const UC qpclass[] = { QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_IF_LAST, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_CR, QP_QUOTED, QP_QUOTED, QP_QUOTED, QP_QUOTED, @@ -237,10 +237,10 @@ static int mime_global_wrp(lua_State *L) return 2; } +#if 0 /*-------------------------------------------------------------------------*\ * Fill base64 decode map. \*-------------------------------------------------------------------------*/ -#if 0 static void b64setup(UC *unbase) { int i; @@ -448,11 +448,11 @@ static int mime_global_unb64(lua_State *L) * To encode one byte, we need to see the next two. * Worst case is when we see a space, and wonder if a CRLF is comming \*-------------------------------------------------------------------------*/ +#if 0 /*-------------------------------------------------------------------------*\ * Split quoted-printable characters into classes * Precompute reverse map for encoding \*-------------------------------------------------------------------------*/ -#if 0 static void qpsetup(UC *cl, UC *unbase) { -- cgit v1.2.3-55-g6feb From 83648f8df2a6ec6d3061b2642ae8739da94eadbe Mon Sep 17 00:00:00 2001 From: "E. Westbrook" Date: Wed, 27 Feb 2019 20:58:27 -0700 Subject: mime: include reorg --- src/mime.c | 8 ++------ src/mime.h | 1 - 2 files changed, 2 insertions(+), 7 deletions(-) (limited to 'src/mime.c') diff --git a/src/mime.c b/src/mime.c index 0e9863b..6c210e4 100755 --- a/src/mime.c +++ b/src/mime.c @@ -2,15 +2,11 @@ * MIME support functions * LuaSocket toolkit \*=========================================================================*/ +#include "luasocket.h" +#include "mime.h" #include #include -#include "lua.h" -#include "lauxlib.h" -#include "compat.h" - -#include "mime.h" - /*=========================================================================*\ * Don't want to trust escape character constants \*=========================================================================*/ diff --git a/src/mime.h b/src/mime.h index e57fc9c..4d938f4 100644 --- a/src/mime.h +++ b/src/mime.h @@ -9,7 +9,6 @@ * provide a higher level interface to this functionality. \*=========================================================================*/ #include "luasocket.h" -#include "lua.h" /*-------------------------------------------------------------------------*\ * Current MIME library version -- cgit v1.2.3-55-g6feb From 6952262e6a1315b14935ddd0ea511c202c0154ba Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Fri, 18 Mar 2022 17:54:11 +0300 Subject: style: Use C-style comment syntax throughout (#309) Co-authored-by: Denise Cullassnekuff <19711487+BlackCutpoint@users.noreply.github.com> --- src/mime.c | 8 ++++---- src/options.c | 45 +++++++++++++++++++++++---------------------- src/unixdgram.c | 2 +- src/wsocket.c | 20 ++++++++++---------- 4 files changed, 38 insertions(+), 37 deletions(-) (limited to 'src/mime.c') diff --git a/src/mime.c b/src/mime.c index 6c210e4..05602f5 100755 --- a/src/mime.c +++ b/src/mime.c @@ -27,12 +27,12 @@ static int mime_global_eol(lua_State *L); static int mime_global_dot(lua_State *L); static size_t dot(int c, size_t state, luaL_Buffer *buffer); -//static void b64setup(UC *base); +/*static void b64setup(UC *base);*/ static size_t b64encode(UC c, UC *input, size_t size, luaL_Buffer *buffer); static size_t b64pad(const UC *input, size_t size, luaL_Buffer *buffer); static size_t b64decode(UC c, UC *input, size_t size, luaL_Buffer *buffer); -//static void qpsetup(UC *class, UC *unbase); +/*static void qpsetup(UC *class, UC *unbase);*/ static void qpquote(UC c, luaL_Buffer *buffer); static size_t qpdecode(UC c, UC *input, size_t size, luaL_Buffer *buffer); static size_t qpencode(UC c, UC *input, size_t size, @@ -176,8 +176,8 @@ LUASOCKET_API int luaopen_mime_core(lua_State *L) lua_pushstring(L, MIME_VERSION); lua_rawset(L, -3); /* initialize lookup tables */ - // qpsetup(qpclass, qpunbase); - // b64setup(b64unbase); + /*qpsetup(qpclass, qpunbase);*/ + /*b64setup(b64unbase);*/ return 1; } diff --git a/src/options.c b/src/options.c index 06ab58d..2b53c67 100644 --- a/src/options.c +++ b/src/options.c @@ -54,7 +54,7 @@ int opt_meth_getoption(lua_State *L, p_opt opt, p_socket ps) return opt->func(L, ps); } -// ------------------------------------------------------- +/*------------------------------------------------------*/ /* enables reuse of local address */ int opt_set_reuseaddr(lua_State *L, p_socket ps) { @@ -66,7 +66,7 @@ int opt_get_reuseaddr(lua_State *L, p_socket ps) return opt_getboolean(L, ps, SOL_SOCKET, SO_REUSEADDR); } -// ------------------------------------------------------- +/*------------------------------------------------------*/ /* enables reuse of local port */ int opt_set_reuseport(lua_State *L, p_socket ps) { @@ -78,7 +78,7 @@ int opt_get_reuseport(lua_State *L, p_socket ps) return opt_getboolean(L, ps, SOL_SOCKET, SO_REUSEPORT); } -// ------------------------------------------------------- +/*------------------------------------------------------*/ /* disables the Nagle algorithm */ int opt_set_tcp_nodelay(lua_State *L, p_socket ps) { @@ -90,7 +90,7 @@ int opt_get_tcp_nodelay(lua_State *L, p_socket ps) return opt_getboolean(L, ps, IPPROTO_TCP, TCP_NODELAY); } -// ------------------------------------------------------- +/*------------------------------------------------------*/ #ifdef TCP_KEEPIDLE int opt_get_tcp_keepidle(lua_State *L, p_socket ps) @@ -105,7 +105,7 @@ int opt_set_tcp_keepidle(lua_State *L, p_socket ps) #endif -// ------------------------------------------------------- +/*------------------------------------------------------*/ #ifdef TCP_KEEPCNT int opt_get_tcp_keepcnt(lua_State *L, p_socket ps) @@ -120,7 +120,7 @@ int opt_set_tcp_keepcnt(lua_State *L, p_socket ps) #endif -// ------------------------------------------------------- +/*------------------------------------------------------*/ #ifdef TCP_KEEPINTVL int opt_get_tcp_keepintvl(lua_State *L, p_socket ps) @@ -135,7 +135,7 @@ int opt_set_tcp_keepintvl(lua_State *L, p_socket ps) #endif -// ------------------------------------------------------- +/*------------------------------------------------------*/ int opt_set_keepalive(lua_State *L, p_socket ps) { return opt_setboolean(L, ps, SOL_SOCKET, SO_KEEPALIVE); @@ -146,7 +146,7 @@ int opt_get_keepalive(lua_State *L, p_socket ps) return opt_getboolean(L, ps, SOL_SOCKET, SO_KEEPALIVE); } -// ------------------------------------------------------- +/*------------------------------------------------------*/ int opt_set_dontroute(lua_State *L, p_socket ps) { return opt_setboolean(L, ps, SOL_SOCKET, SO_DONTROUTE); @@ -157,7 +157,7 @@ int opt_get_dontroute(lua_State *L, p_socket ps) return opt_getboolean(L, ps, SOL_SOCKET, SO_DONTROUTE); } -// ------------------------------------------------------- +/*------------------------------------------------------*/ int opt_set_broadcast(lua_State *L, p_socket ps) { return opt_setboolean(L, ps, SOL_SOCKET, SO_BROADCAST); @@ -168,7 +168,7 @@ int opt_get_broadcast(lua_State *L, p_socket ps) return opt_getboolean(L, ps, SOL_SOCKET, SO_BROADCAST); } -// ------------------------------------------------------- +/*------------------------------------------------------*/ int opt_set_recv_buf_size(lua_State *L, p_socket ps) { return opt_setint(L, ps, SOL_SOCKET, SO_RCVBUF); @@ -179,7 +179,7 @@ int opt_get_recv_buf_size(lua_State *L, p_socket ps) return opt_getint(L, ps, SOL_SOCKET, SO_RCVBUF); } -// ------------------------------------------------------- +/*------------------------------------------------------*/ int opt_get_send_buf_size(lua_State *L, p_socket ps) { return opt_getint(L, ps, SOL_SOCKET, SO_SNDBUF); @@ -190,7 +190,7 @@ int opt_set_send_buf_size(lua_State *L, p_socket ps) return opt_setint(L, ps, SOL_SOCKET, SO_SNDBUF); } -// ------------------------------------------------------- +/*------------------------------------------------------*/ int opt_set_ip6_unicast_hops(lua_State *L, p_socket ps) { return opt_setint(L, ps, IPPROTO_IPV6, IPV6_UNICAST_HOPS); @@ -201,7 +201,7 @@ int opt_get_ip6_unicast_hops(lua_State *L, p_socket ps) return opt_getint(L, ps, IPPROTO_IPV6, IPV6_UNICAST_HOPS); } -// ------------------------------------------------------- +/*------------------------------------------------------*/ int opt_set_ip6_multicast_hops(lua_State *L, p_socket ps) { return opt_setint(L, ps, IPPROTO_IPV6, IPV6_MULTICAST_HOPS); @@ -212,7 +212,7 @@ int opt_get_ip6_multicast_hops(lua_State *L, p_socket ps) return opt_getint(L, ps, IPPROTO_IPV6, IPV6_MULTICAST_HOPS); } -// ------------------------------------------------------- +/*------------------------------------------------------*/ int opt_set_ip_multicast_loop(lua_State *L, p_socket ps) { return opt_setboolean(L, ps, IPPROTO_IP, IP_MULTICAST_LOOP); @@ -223,7 +223,7 @@ int opt_get_ip_multicast_loop(lua_State *L, p_socket ps) return opt_getboolean(L, ps, IPPROTO_IP, IP_MULTICAST_LOOP); } -// ------------------------------------------------------- +/*------------------------------------------------------*/ int opt_set_ip6_multicast_loop(lua_State *L, p_socket ps) { return opt_setboolean(L, ps, IPPROTO_IPV6, IPV6_MULTICAST_LOOP); @@ -234,7 +234,7 @@ int opt_get_ip6_multicast_loop(lua_State *L, p_socket ps) return opt_getboolean(L, ps, IPPROTO_IPV6, IPV6_MULTICAST_LOOP); } -// ------------------------------------------------------- +/*------------------------------------------------------*/ int opt_set_linger(lua_State *L, p_socket ps) { struct linger li; /* obj, name, table */ @@ -267,13 +267,13 @@ int opt_get_linger(lua_State *L, p_socket ps) return 1; } -// ------------------------------------------------------- +/*------------------------------------------------------*/ int opt_set_ip_multicast_ttl(lua_State *L, p_socket ps) { return opt_setint(L, ps, IPPROTO_IP, IP_MULTICAST_TTL); } -// ------------------------------------------------------- +/*------------------------------------------------------*/ int opt_set_ip_multicast_if(lua_State *L, p_socket ps) { const char *address = luaL_checkstring(L, 3); /* obj, name, ip */ @@ -298,7 +298,7 @@ int opt_get_ip_multicast_if(lua_State *L, p_socket ps) return 1; } -// ------------------------------------------------------- +/*------------------------------------------------------*/ int opt_set_ip_add_membership(lua_State *L, p_socket ps) { return opt_setmembership(L, ps, IPPROTO_IP, IP_ADD_MEMBERSHIP); @@ -309,7 +309,7 @@ int opt_set_ip_drop_membersip(lua_State *L, p_socket ps) return opt_setmembership(L, ps, IPPROTO_IP, IP_DROP_MEMBERSHIP); } -// ------------------------------------------------------- +/*------------------------------------------------------*/ int opt_set_ip6_add_membership(lua_State *L, p_socket ps) { return opt_ip6_setmembership(L, ps, IPPROTO_IPV6, IPV6_ADD_MEMBERSHIP); @@ -319,7 +319,8 @@ int opt_set_ip6_drop_membersip(lua_State *L, p_socket ps) { return opt_ip6_setmembership(L, ps, IPPROTO_IPV6, IPV6_DROP_MEMBERSHIP); } -// ------------------------------------------------------- + +/*------------------------------------------------------*/ int opt_get_ip6_v6only(lua_State *L, p_socket ps) { return opt_getboolean(L, ps, IPPROTO_IPV6, IPV6_V6ONLY); @@ -330,7 +331,7 @@ int opt_set_ip6_v6only(lua_State *L, p_socket ps) return opt_setboolean(L, ps, IPPROTO_IPV6, IPV6_V6ONLY); } -// ------------------------------------------------------- +/*------------------------------------------------------*/ int opt_get_error(lua_State *L, p_socket ps) { int val = 0; diff --git a/src/unixdgram.c b/src/unixdgram.c index 3ac3c5e..69093d7 100644 --- a/src/unixdgram.c +++ b/src/unixdgram.c @@ -16,7 +16,7 @@ #define UNIXDGRAM_DATAGRAMSIZE 8192 -// provide a SUN_LEN macro if sys/un.h doesn't (e.g. Android) +/* provide a SUN_LEN macro if sys/un.h doesn't (e.g. Android) */ #ifndef SUN_LEN #define SUN_LEN(ptr) \ ((size_t) (((struct sockaddr_un *) 0)->sun_path) \ diff --git a/src/wsocket.c b/src/wsocket.c index 20da330..7cd4115 100755 --- a/src/wsocket.c +++ b/src/wsocket.c @@ -360,7 +360,7 @@ const char *socket_ioerror(p_socket ps, int err) { static const char *wstrerror(int err) { switch (err) { case WSAEINTR: return "Interrupted function call"; - case WSAEACCES: return PIE_ACCESS; // "Permission denied"; + case WSAEACCES: return PIE_ACCESS; /* "Permission denied"; */ case WSAEFAULT: return "Bad address"; case WSAEINVAL: return "Invalid argument"; case WSAEMFILE: return "Too many open files"; @@ -373,23 +373,23 @@ static const char *wstrerror(int err) { case WSAEPROTOTYPE: return "Protocol wrong type for socket"; case WSAENOPROTOOPT: return "Bad protocol option"; case WSAEPROTONOSUPPORT: return "Protocol not supported"; - case WSAESOCKTNOSUPPORT: return PIE_SOCKTYPE; // "Socket type not supported"; + case WSAESOCKTNOSUPPORT: return PIE_SOCKTYPE; /* "Socket type not supported"; */ case WSAEOPNOTSUPP: return "Operation not supported"; case WSAEPFNOSUPPORT: return "Protocol family not supported"; - case WSAEAFNOSUPPORT: return PIE_FAMILY; // "Address family not supported by protocol family"; - case WSAEADDRINUSE: return PIE_ADDRINUSE; // "Address already in use"; + case WSAEAFNOSUPPORT: return PIE_FAMILY; /* "Address family not supported by protocol family"; */ + case WSAEADDRINUSE: return PIE_ADDRINUSE; /* "Address already in use"; */ case WSAEADDRNOTAVAIL: return "Cannot assign requested address"; case WSAENETDOWN: return "Network is down"; case WSAENETUNREACH: return "Network is unreachable"; case WSAENETRESET: return "Network dropped connection on reset"; case WSAECONNABORTED: return "Software caused connection abort"; - case WSAECONNRESET: return PIE_CONNRESET; // "Connection reset by peer"; + case WSAECONNRESET: return PIE_CONNRESET; /* "Connection reset by peer"; */ case WSAENOBUFS: return "No buffer space available"; - case WSAEISCONN: return PIE_ISCONN; // "Socket is already connected"; + case WSAEISCONN: return PIE_ISCONN; /* "Socket is already connected"; */ case WSAENOTCONN: return "Socket is not connected"; case WSAESHUTDOWN: return "Cannot send after socket shutdown"; - case WSAETIMEDOUT: return PIE_TIMEDOUT; // "Connection timed out"; - case WSAECONNREFUSED: return PIE_CONNREFUSED; // "Connection refused"; + case WSAETIMEDOUT: return PIE_TIMEDOUT; /* "Connection timed out"; */ + case WSAECONNREFUSED: return PIE_CONNREFUSED; /* "Connection refused"; */ case WSAEHOSTDOWN: return "Host is down"; case WSAEHOSTUNREACH: return "No route to host"; case WSAEPROCLIM: return "Too many processes"; @@ -398,9 +398,9 @@ static const char *wstrerror(int err) { case WSANOTINITIALISED: return "Successful WSAStartup not yet performed"; case WSAEDISCON: return "Graceful shutdown in progress"; - case WSAHOST_NOT_FOUND: return PIE_HOST_NOT_FOUND; // "Host not found"; + case WSAHOST_NOT_FOUND: return PIE_HOST_NOT_FOUND; /* "Host not found"; */ case WSATRY_AGAIN: return "Nonauthoritative host not found"; - case WSANO_RECOVERY: return PIE_FAIL; // "Nonrecoverable name lookup error"; + case WSANO_RECOVERY: return PIE_FAIL; /* "Nonrecoverable name lookup error"; */ case WSANO_DATA: return "Valid name, no data record of requested type"; default: return "Unknown error"; } -- cgit v1.2.3-55-g6feb