summaryrefslogtreecommitdiff
path: root/scite/debian/patches/use-lua5.4.4.patch
blob: 382df1ab201a1f79f91241fdb83039ea9be8d6ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
Name: Patch scite to use distro package of lua, Devuan
Version: 5.2.3
Lua-Version: 5.4.4
Author: bgstack15@gmail.com
Date-Modified: 2022-05-31
Message: Generated with the following command

    sed -r -e 's/checkint\(/checkinteger\(/g;' -e 's/lua_strlen\(/lua_rawlen\(/g;' scite/src/LuaExtension.cxx > ~/LuaExtension.cxx.new
diff -aur scite/gtk/deps.mak scite/gtk/deps.mak
--- a/scite/gtk/deps.mak	2022-03-30 20:48:24.000000000 -0400
+++ b/scite/gtk/deps.mak	2022-04-04 14:47:39.110529717 -0400
@@ -469,13 +469,6 @@
 	../lua/src/luaconf.h \
 	../lua/src/lauxlib.h \
 	../lua/src/lualib.h
-lbitlib.o: \
-	../lua/src/lbitlib.c \
-	../lua/src/lprefix.h \
-	../lua/src/lua.h \
-	../lua/src/luaconf.h \
-	../lua/src/lauxlib.h \
-	../lua/src/lualib.h
 lcode.o: \
 	../lua/src/lcode.c \
 	../lua/src/lprefix.h \
diff -aur scite/src/LuaExtension.cxx scite/src/LuaExtension.cxx
--- a/scite/src/LuaExtension.cxx	2022-03-30 20:48:24.000000000 -0400
+++ b/scite/src/LuaExtension.cxx	2022-04-04 14:46:35.097978533 -0400
@@ -238,7 +238,7 @@
 
 	constexpr int paneIndex = lua_upvalueindex(1);
 	check_pane_object(L, paneIndex);
-	const int message = luaL_checkint(L, 1);
+	const int message = luaL_checkinteger(L, 1);
 
 	lua_pushvalue(L, paneIndex);
 	lua_replace(L, 1);
@@ -277,7 +277,7 @@
 }
 
 int cf_scite_constname(lua_State *L) {
-	const int message = luaL_checkint(L, 1);
+	const int message = luaL_checkinteger(L, 1);
 	const char *prefix = luaL_optstring(L, 2, nullptr);
 	const std::string constName = IFaceTable::GetConstantName(message, prefix);
 	if (constName.length() > 0) {
@@ -308,7 +308,7 @@
 }
 
 int cf_scite_menu_command(lua_State *L) {
-	const int cmdID = luaL_checkint(L, 1);
+	const int cmdID = luaL_checkinteger(L, 1);
 	if (cmdID) {
 		host->DoMenuCommand(cmdID);
 	}
@@ -330,7 +330,7 @@
 }
 
 int cf_scite_strip_set(lua_State *L) {
-	const int control = luaL_checkint(L, 1);
+	const int control = luaL_checkinteger(L, 1);
 	const char *value = luaL_checkstring(L, 2);
 	if (value) {
 		host->UserStripSet(control, value);
@@ -339,7 +339,7 @@
 }
 
 int cf_scite_strip_set_list(lua_State *L) {
-	const int control = luaL_checkint(L, 1);
+	const int control = luaL_checkinteger(L, 1);
 	const char *value = luaL_checkstring(L, 2);
 	if (value) {
 		host->UserStripSetList(control, value);
@@ -348,7 +348,7 @@
 }
 
 int cf_scite_strip_value(lua_State *L) {
-	const int control = luaL_checkint(L, 1);
+	const int control = luaL_checkinteger(L, 1);
 	std::string value = host->UserStripValue(control);
 	push_string(L, value);
 	return 1;
@@ -438,7 +438,7 @@
 		SA::Position rangeStart = 0;
 		SA::Position rangeEnd = 0;
 
-		const int flags = (nArgs > 2) ? luaL_checkint(L, 3) : 0;
+		const int flags = (nArgs > 2) ? luaL_checkinteger(L, 3) : 0;
 		hasError = (flags == 0 && lua_gettop(L) > nArgs);
 
 		if (!hasError) {
@@ -515,7 +515,7 @@
 
 	SA::ScintillaCall &sc = host->PaneCaller(pmo->pane);
 	sc.SetTarget(pmo->range);
-	sc.ReplaceTarget(lua_strlen(L, 2), replacement);
+	sc.ReplaceTarget(lua_rawlen(L, 2), replacement);
 	pmo->range.end = sc.TargetEnd();
 	return 0;
 }
@@ -601,7 +601,7 @@
 		pmo->endPosOrig = 0;
 		pmo->flags = 0;
 		if (nargs >= 3) {
-			pmo->flags = luaL_checkint(L, 3);
+			pmo->flags = luaL_checkinteger(L, 3);
 			if (nargs >= 4) {
 				pmo->range.end = pmo->endPosOrig = luaL_checkinteger(L, 4);
 				if (pmo->range.end < 0) {
@@ -766,7 +766,7 @@
 	const int nargs = lua_gettop(L);
 	const char *code = luaL_checkstring(L, 1);
 	const char *name = luaL_optstring(L, 2, code);
-	if (0 == luaL_loadbuffer(L, code, lua_strlen(L, 1), name)) {
+	if (0 == luaL_loadbuffer(L, code, lua_rawlen(L, 1), name)) {
 		lua_call(L, 0, LUA_MULTRET);
 		return lua_gettop(L) - nargs;
 	} else {
@@ -897,7 +897,7 @@
 	int loopParamCount = 2;
 
 	if (func.paramType[0] == iface_length && func.paramType[1] == iface_string) {
-		params[0] = lua_strlen(L, arg);
+		params[0] = lua_rawlen(L, arg);
 		params[1] = SptrFromString(params[0] ? lua_tostring(L, arg) : "");
 		loopParamCount = 0;
 	} else if ((func.paramType[1] == iface_stringresult) || (func.returnType == iface_stringresult)) {
@@ -916,8 +916,8 @@
 			const char *s = lua_tostring(L, arg++);
 			params[i] = SptrFromString(s ? s : "");
 		} else if (func.paramType[i] == iface_keymod) {
-			const int keycode = luaL_checkint(L, arg++) & 0xFFFF;
-			const intptr_t modifiers = luaL_checkint(L, arg++) &
+			const int keycode = luaL_checkinteger(L, arg++) & 0xFFFF;
+			const intptr_t modifiers = luaL_checkinteger(L, arg++) &
 					      static_cast<int>(SA::KeyMod::Shift|SA::KeyMod::Ctrl|SA::KeyMod::Alt);
 			params[i] = keycode | (modifiers<<16);
 		} else if (func.paramType[i] == iface_bool) {
@@ -1787,7 +1787,7 @@
 	static int SetLevelAt(lua_State *L) {
 		StylingContext *context = Context(L);
 		const SA::Line line = luaL_checkinteger(L, 2);
-		const int level = luaL_checkint(L, 3);
+		const int level = luaL_checkinteger(L, 3);
 		context->styler->SetLevel(line, static_cast<SA::FoldLevel>(level));
 		return 0;
 	}
@@ -1802,7 +1802,7 @@
 	static int SetLineState(lua_State *L) {
 		StylingContext *context = Context(L);
 		const SA::Line line = luaL_checkinteger(L, 2);
-		const int stateOfLine = luaL_checkint(L, 3);
+		const int stateOfLine = luaL_checkinteger(L, 3);
 		context->styler->SetLineState(line, stateOfLine);
 		return 0;
 	}
@@ -1880,7 +1880,7 @@
 		StylingContext *context = Context(L);
 		const SA::Position startPosStyle = luaL_checkinteger(L, 2);
 		const SA::Position lengthStyle = luaL_checkinteger(L, 3);
-		const int initialStyle = luaL_checkint(L, 4);
+		const int initialStyle = luaL_checkinteger(L, 4);
 		context->StartStyling(startPosStyle, lengthStyle, initialStyle);
 		return 0;
 	}
@@ -1939,7 +1939,7 @@
 	static int SetState(lua_State *L) {
 		StylingContext *context = Context(L);
 		context->Colourize();
-		context->state = luaL_checkint(L, 2);
+		context->state = luaL_checkinteger(L, 2);
 		return 0;
 	}
 
@@ -1947,13 +1947,13 @@
 		StylingContext *context = Context(L);
 		context->Forward();
 		context->Colourize();
-		context->state = luaL_checkint(L, 2);
+		context->state = luaL_checkinteger(L, 2);
 		return 0;
 	}
 
 	static int ChangeState(lua_State *L) {
 		StylingContext *context = Context(L);
-		context->state = luaL_checkint(L, 2);
+		context->state = luaL_checkinteger(L, 2);
 		return 0;
 	}
 

bgstack15