1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

[lua] more const

This commit is contained in:
Witold Filipczyk 2022-01-30 17:34:36 +01:00
parent 9bbe2eb4ed
commit acae461bf8
2 changed files with 8 additions and 8 deletions

View File

@ -80,9 +80,9 @@ static sigjmp_buf errjmp;
#define L lua_state #define L lua_state
#define LS lua_State *S #define LS lua_State *S
static void handle_standard_lua_returns(char *from); static void handle_standard_lua_returns(const char *from);
static void handle_ref(LS, struct session *ses, int func_ref, static void handle_ref(LS, struct session *ses, int func_ref,
char *from, int num_args, int unref); const char *from, int num_args, int unref);
/* /*
@ -92,7 +92,7 @@ static void handle_ref(LS, struct session *ses, int func_ref,
static int static int
l_alert(LS) l_alert(LS)
{ {
char *msg = (char *) lua_tostring(S, 1); const char *msg = (const char *)lua_tostring(S, 1);
/* Don't crash if a script calls e.g. error(nil) or error(error). */ /* Don't crash if a script calls e.g. error(nil) or error(error). */
if (msg == NULL) if (msg == NULL)
@ -804,7 +804,7 @@ alert_lua_error(const char *msg)
} }
void void
alert_lua_error2(const char *msg, char *msg2) alert_lua_error2(const char *msg, const char *msg2)
{ {
char *tmp = stracpy(msg); char *tmp = stracpy(msg);
@ -865,7 +865,7 @@ handle_ret_goto_url(struct session *ses)
} }
static void static void
handle_standard_lua_returns(char *from) handle_standard_lua_returns(const char *from)
{ {
const char *act = lua_tostring(L, -2); const char *act = lua_tostring(L, -2);
@ -886,7 +886,7 @@ handle_standard_lua_returns(char *from)
} }
static void static void
handle_ref_on_stack(LS, struct session *ses, char *from, int num_args) handle_ref_on_stack(LS, struct session *ses, const char *from, int num_args)
{ {
int err; int err;
@ -898,7 +898,7 @@ handle_ref_on_stack(LS, struct session *ses, char *from, int num_args)
} }
static void static void
handle_ref(LS, struct session *ses, int func_ref, char *from, handle_ref(LS, struct session *ses, int func_ref, const char *from,
int num_args, int unref) int num_args, int unref)
{ {
lua_rawgeti(S, LUA_REGISTRYINDEX, func_ref); lua_rawgeti(S, LUA_REGISTRYINDEX, func_ref);

View File

@ -23,7 +23,7 @@ int prepare_lua(struct session *);
void finish_lua(void); void finish_lua(void);
void alert_lua_error(const char *); void alert_lua_error(const char *);
void alert_lua_error2(const char *, char *); void alert_lua_error2(const char *, const char *);
enum evhook_status dialog_lua_console(va_list ap, void *data); enum evhook_status dialog_lua_console(va_list ap, void *data);
enum evhook_status free_lua_console_history(va_list ap, void *data); enum evhook_status free_lua_console_history(va_list ap, void *data);