Software /
code /
prosody
Comparison
util-src/hashes.c @ 441:4089b62b510c
Minor changes to C files (to prevent compiler warnings)
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Thu, 27 Nov 2008 21:47:13 +0500 |
parent | 432:fb19a5c14d44 |
child | 520:e96ac4bb6dd8 |
comparison
equal
deleted
inserted
replaced
438:193f9dd64f17 | 441:4089b62b510c |
---|---|
24 size_t len; \ | 24 size_t len; \ |
25 const char *s = luaL_checklstring(L, 1, &len); \ | 25 const char *s = luaL_checklstring(L, 1, &len); \ |
26 int hex_out = lua_toboolean(L, 2); \ | 26 int hex_out = lua_toboolean(L, 2); \ |
27 char hash[size]; \ | 27 char hash[size]; \ |
28 char result[size*2]; \ | 28 char result[size*2]; \ |
29 func(s, len, hash); \ | 29 func((const unsigned char*)s, len, (unsigned char*)hash); \ |
30 if (hex_out) { \ | 30 if (hex_out) { \ |
31 toHex(hash, size, result); \ | 31 toHex(hash, size, result); \ |
32 lua_pushlstring(L, result, size*2); \ | 32 lua_pushlstring(L, result, size*2); \ |
33 } else { \ | 33 } else { \ |
34 lua_pushlstring(L, hash, size);\ | 34 lua_pushlstring(L, hash, size);\ |