util.strbitop: Reduce scope of functions
authorKim Alvefur <zash@zash.se>
Sat, 23 Apr 2022 14:29:43 +0200
changeset 12473 2b3adaa6d38e
parent 12472 353836684009
child 12474 80f3123053e2
util.strbitop: Reduce scope of functions Equivalent to 'local' in Lua, these functions are exported via the luaopen_ function, which is the only one needing to be visible outside of the file. Pointed out by Link Mauve at some point, but there wasn't really any rush here.
util-src/strbitop.c
--- a/util-src/strbitop.c	Wed Apr 20 22:41:54 2022 +0200
+++ b/util-src/strbitop.c	Sat Apr 23 14:29:43 2022 +0200
@@ -14,7 +14,7 @@
 
 /* TODO Deduplicate code somehow */
 
-int strop_and(lua_State *L) {
+static int strop_and(lua_State *L) {
 	luaL_Buffer buf;
 	size_t a, b, i;
 	const char *str_a = luaL_checklstring(L, 1, &a);
@@ -35,7 +35,7 @@
 	return 1;
 }
 
-int strop_or(lua_State *L) {
+static int strop_or(lua_State *L) {
 	luaL_Buffer buf;
 	size_t a, b, i;
 	const char *str_a = luaL_checklstring(L, 1, &a);
@@ -56,7 +56,7 @@
 	return 1;
 }
 
-int strop_xor(lua_State *L) {
+static int strop_xor(lua_State *L) {
 	luaL_Buffer buf;
 	size_t a, b, i;
 	const char *str_a = luaL_checklstring(L, 1, &a);