Mass reformat

This commit is contained in:
Imbus 2025-08-18 14:59:16 +02:00
parent 4d27def35e
commit df11e34235
27 changed files with 121 additions and 136 deletions

View file

@ -1,19 +1,19 @@
#include <lua.h>
#include <lauxlib.h>
#include <lua.h>
#include <stdint.h>
uint32_t lookup3(const void *key, size_t length, uint32_t initval);
// Lua wrapper
static int l_lookup3(lua_State *L) {
size_t len;
const char *str = luaL_checklstring(L, 1, &len); // get string + length
uint32_t initval = (uint32_t)luaL_checkinteger(L, 2); // get initval
size_t len;
const char *str = luaL_checklstring(L, 1, &len); // get string + length
uint32_t initval = (uint32_t)luaL_checkinteger(L, 2); // get initval
uint32_t hash = lookup3(str, len, initval);
lua_pushinteger(L, hash); // return the hash
return 1; // number of return values
lua_pushinteger(L, hash); // return the hash
return 1; // number of return values
}
// Module open function
@ -23,5 +23,5 @@ int luaopen_lookup3(lua_State *L) {
lua_pushcfunction(L, l_lookup3);
lua_setfield(L, -2, "lookup3");
return 1; // return the table
return 1; // return the table
}