Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports-kde
Path: blob/main/editors/fxite/files/patch-src_luafx.cpp
16461 views
1
--- src/luafx.cpp.orig 2013-10-03 09:22:51 UTC
2
+++ src/luafx.cpp
3
@@ -36,6 +36,10 @@
4
#include "intl.h"
5
#include "luafx.h"
6
7
+#if LUA_VERSION_NUM<502
8
+# define lua_rawlen lua_objlen
9
+#endif
10
+
11
static FXWindow*main_window=NULL;
12
13
static const char*default_title;
14
@@ -173,7 +177,7 @@ static int input(lua_State*L)
15
switch (toupper(type[0])) {
16
case 'I' : {
17
if (!lua_isnil(L,3)) {
18
- txt.format(sizeof(lua_Integer)>4?"%ld":"%d", luaL_checkinteger(L,3));
19
+ txt.format("%ld", luaL_checkinteger(L,3));
20
}
21
opt=INPUTDIALOG_INTEGER;
22
break;
23
@@ -248,7 +252,7 @@ static int choose(lua_State*L) {
24
FXString fmsg;
25
int i,n;
26
luaL_argcheck(L, lua_istable(L,argtbl), argtbl, _("table expected") );
27
- n=lua_objlen(L,argtbl);
28
+ n=lua_rawlen(L,argtbl);
29
luaL_argcheck(L, n>0, argtbl, _("table can't be empty"));
30
for (i=1;i<=n; i++) {
31
lua_rawgeti(L,argtbl,i);
32
@@ -599,7 +603,7 @@ static int pid(lua_State* L)
33
34
35
36
-static const struct luaL_reg fx_util_funcs[] = {
37
+static const struct luaL_Reg fx_util_funcs[] = {
38
{"message", message},
39
{"confirm", confirm},
40
{"input", input},
41
@@ -620,7 +624,7 @@ static const struct luaL_reg fx_util_funcs[] = {
42
43
44
45
-const luaL_reg* LuaFxUtils(FXWindow*topwin, const char*exe_name)
46
+const luaL_Reg* LuaFxUtils(FXWindow*topwin, const char*exe_name)
47
{
48
default_title=exe_name;
49
if (!main_window) { main_window=topwin; }
50
51