Comparison

util-src/strbitop.c @ 11167:ba32b9a6d75b 0.11

util.strbitop: Reformat code astyle \ --indent=tab \ --attach-classes \ --indent-switches \ --break-blocks \ --pad-oper \ --unpad-paren \ --add-braces \ --align-pointer=name \ --lineend=linux \ *.c
author Kim Alvefur <zash@zash.se>
date Thu, 15 Oct 2020 16:26:56 +0200
parent 11163:37a6a535343e
child 11169:6dde2c9fa272
comparison
equal deleted inserted replaced
11165:eae8046d51fc 11167:ba32b9a6d75b
12 #define luaL_setfuncs(L, R, N) luaL_register(L, NULL, R) 12 #define luaL_setfuncs(L, R, N) luaL_register(L, NULL, R)
13 #endif 13 #endif
14 14
15 /* TODO Deduplicate code somehow */ 15 /* TODO Deduplicate code somehow */
16 16
17 int strop_and(lua_State* L) { 17 int strop_and(lua_State *L) {
18 luaL_Buffer buf; 18 luaL_Buffer buf;
19 size_t a, b, i; 19 size_t a, b, i;
20 const char* str_a = luaL_checklstring(L, 1, &a); 20 const char *str_a = luaL_checklstring(L, 1, &a);
21 const char* str_b = luaL_checklstring(L, 2, &b); 21 const char *str_b = luaL_checklstring(L, 2, &b);
22 22
23 luaL_buffinit(L, &buf); 23 luaL_buffinit(L, &buf);
24 24
25 if(a == 0 || b == 0) { 25 if(a == 0 || b == 0) {
26 lua_settop(L, 1); 26 lua_settop(L, 1);
33 33
34 luaL_pushresult(&buf); 34 luaL_pushresult(&buf);
35 return 1; 35 return 1;
36 } 36 }
37 37
38 int strop_or(lua_State* L) { 38 int strop_or(lua_State *L) {
39 luaL_Buffer buf; 39 luaL_Buffer buf;
40 size_t a, b, i; 40 size_t a, b, i;
41 const char* str_a = luaL_checklstring(L, 1, &a); 41 const char *str_a = luaL_checklstring(L, 1, &a);
42 const char* str_b = luaL_checklstring(L, 2, &b); 42 const char *str_b = luaL_checklstring(L, 2, &b);
43 43
44 luaL_buffinit(L, &buf); 44 luaL_buffinit(L, &buf);
45 45
46 if(a == 0 || b == 0) { 46 if(a == 0 || b == 0) {
47 lua_settop(L, 1); 47 lua_settop(L, 1);
54 54
55 luaL_pushresult(&buf); 55 luaL_pushresult(&buf);
56 return 1; 56 return 1;
57 } 57 }
58 58
59 int strop_xor(lua_State* L) { 59 int strop_xor(lua_State *L) {
60 luaL_Buffer buf; 60 luaL_Buffer buf;
61 size_t a, b, i; 61 size_t a, b, i;
62 const char* str_a = luaL_checklstring(L, 1, &a); 62 const char *str_a = luaL_checklstring(L, 1, &a);
63 const char* str_b = luaL_checklstring(L, 2, &b); 63 const char *str_b = luaL_checklstring(L, 2, &b);
64 64
65 luaL_buffinit(L, &buf); 65 luaL_buffinit(L, &buf);
66 66
67 if(a == 0 || b == 0) { 67 if(a == 0 || b == 0) {
68 lua_settop(L, 1); 68 lua_settop(L, 1);