Jérôme Vuarand avatar Jérôme Vuarand committed 6594ea8

Fixed compilation warnings on GCC.

Comments (0)

Files changed (2)

 #include "structs.h"
 
 #include <lauxlib.h>
+#include <string.h>
 #include "compat.h"
 
 static int luausb_generic_index(lua_State* L)
 	lua_pop(L, 1);
 	{
 		size_t size;
-		udata->]]..field.name..[[ = lua_tolstring(L, 2, &size);
+		udata->]]..field.name..[[ = (const ]]..field.ctype..[[)lua_tolstring(L, 2, &size);
 		udata->]]..field.size..[[ = (]]..field.size_ctype..[[)size;
 	}
 	return 0;
 		lua_setfield(L, -2, "]]..field.name..[[");
 		lua_pop(L, 1);
 		memcpy(buffer, value, size);
-		udata->]]..field.name..[[ = buffer;
+		udata->]]..field.name..[[ = (]]..field.ctype..[[)buffer;
 		udata->]]..field.size..[[ = (]]..field.size_ctype..[[)size;
 	}
 	else if (lua_type(L, 2)==LUA_TNUMBER)
 		lua_setfield(L, -2, "]]..field.name..[[");
 		lua_pop(L, 1);
 		memset(buffer, 0, size);
-		udata->]]..field.name..[[ = buffer;
+		udata->]]..field.name..[[ = (]]..field.ctype..[[)buffer;
 		udata->]]..field.size..[[ = (]]..field.size_ctype..[[)size;
 	}
 	else
 #include "structs.h"
 
 #include <lauxlib.h>
+#include <string.h>
 #include "compat.h"
 
 static int luausb_generic_index(lua_State* L)
 	lua_pop(L, 1);
 	{
 		size_t size;
-		udata->extra = lua_tolstring(L, 2, &size);
+		udata->extra = (const unsigned char*)lua_tolstring(L, 2, &size);
 		udata->extra_length = (int)size;
 	}
 	return 0;
 	lua_pop(L, 1);
 	{
 		size_t size;
-		udata->extra = lua_tolstring(L, 2, &size);
+		udata->extra = (const unsigned char*)lua_tolstring(L, 2, &size);
 		udata->extra_length = (int)size;
 	}
 	return 0;
 	lua_pop(L, 1);
 	{
 		size_t size;
-		udata->extra = lua_tolstring(L, 2, &size);
+		udata->extra = (const unsigned char*)lua_tolstring(L, 2, &size);
 		udata->extra_length = (int)size;
 	}
 	return 0;
 		lua_setfield(L, -2, "buffer");
 		lua_pop(L, 1);
 		memcpy(buffer, value, size);
-		udata->buffer = buffer;
+		udata->buffer = (unsigned char*)buffer;
 		udata->length = (int)size;
 	}
 	else if (lua_type(L, 2)==LUA_TNUMBER)
 		lua_setfield(L, -2, "buffer");
 		lua_pop(L, 1);
 		memset(buffer, 0, size);
-		udata->buffer = buffer;
+		udata->buffer = (unsigned char*)buffer;
 		udata->length = (int)size;
 	}
 	else
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.