Commit d9b300af authored by Paul Eggert's avatar Paul Eggert
Browse files

Omit ‘const’ on locals

Remove ‘const’ qualifier from locals that were newly added.
We don’t normally bother declaring locals with ‘const’ even
though they are not modified, for the same reason we don’t
bother declaring them with ‘register’ even though their
addresses are not taken; the advantage in compile-time
checking isn’t worth the loss of readability.
* modules/mod-test/mod-test.c (Fmod_test_non_local_exit_funcall)
(Fmod_test_vector_fill, Fmod_test_vector_eq):
* src/emacs-module.c (MODULE_SETJMP_1)
(module_make_global_ref, module_free_global_ref)
(module_non_local_exit_get, module_make_function)
(module_extract_integer, module_extract_float)
(module_get_user_ptr, module_set_user_ptr)
(module_get_user_finalizer, module_set_user_finalizer)
(module_vec_get, Fmodule_call)
(module_non_local_exit_signal_1)
(module_non_local_exit_throw_1, lisp_to_value)
(finalize_storage, allocate_emacs_value, mark_modules)
(module_handle_signal, module_handle_throw)
(module_format_fun_env):
* src/eval.c (push_handler, push_handler_nosignal)
(init_handler):
* src/lread.c (suffix_p):
Omit unnecessary ‘const’.
parent 68d58e69
...@@ -78,7 +78,7 @@ Fmod_test_non_local_exit_funcall (emacs_env *env, int nargs, emacs_value args[], ...@@ -78,7 +78,7 @@ Fmod_test_non_local_exit_funcall (emacs_env *env, int nargs, emacs_value args[],
void *data) void *data)
{ {
assert (nargs == 1); assert (nargs == 1);
const emacs_value result = env->funcall (env, args[0], 0, NULL); emacs_value result = env->funcall (env, args[0], 0, NULL);
emacs_value non_local_exit_symbol, non_local_exit_data; emacs_value non_local_exit_symbol, non_local_exit_data;
enum emacs_funcall_exit code enum emacs_funcall_exit code
= env->non_local_exit_get (env, &non_local_exit_symbol, = env->non_local_exit_get (env, &non_local_exit_symbol,
...@@ -90,7 +90,7 @@ Fmod_test_non_local_exit_funcall (emacs_env *env, int nargs, emacs_value args[], ...@@ -90,7 +90,7 @@ Fmod_test_non_local_exit_funcall (emacs_env *env, int nargs, emacs_value args[],
case emacs_funcall_exit_signal: case emacs_funcall_exit_signal:
{ {
env->non_local_exit_clear (env); env->non_local_exit_clear (env);
const emacs_value Flist = env->intern (env, "list"); emacs_value Flist = env->intern (env, "list");
emacs_value list_args[] = {env->intern (env, "signal"), emacs_value list_args[] = {env->intern (env, "signal"),
non_local_exit_symbol, non_local_exit_data}; non_local_exit_symbol, non_local_exit_data};
return env->funcall (env, Flist, 3, list_args); return env->funcall (env, Flist, 3, list_args);
...@@ -98,7 +98,7 @@ Fmod_test_non_local_exit_funcall (emacs_env *env, int nargs, emacs_value args[], ...@@ -98,7 +98,7 @@ Fmod_test_non_local_exit_funcall (emacs_env *env, int nargs, emacs_value args[],
case emacs_funcall_exit_throw: case emacs_funcall_exit_throw:
{ {
env->non_local_exit_clear (env); env->non_local_exit_clear (env);
const emacs_value Flist = env->intern (env, "list"); emacs_value Flist = env->intern (env, "list");
emacs_value list_args[] = {env->intern (env, "throw"), emacs_value list_args[] = {env->intern (env, "throw"),
non_local_exit_symbol, non_local_exit_data}; non_local_exit_symbol, non_local_exit_data};
return env->funcall (env, Flist, 3, list_args); return env->funcall (env, Flist, 3, list_args);
...@@ -191,7 +191,7 @@ Fmod_test_vector_fill (emacs_env *env, int nargs, emacs_value args[], void *data ...@@ -191,7 +191,7 @@ Fmod_test_vector_fill (emacs_env *env, int nargs, emacs_value args[], void *data
{ {
emacs_value vec = args[0]; emacs_value vec = args[0];
emacs_value val = args[1]; emacs_value val = args[1];
const size_t size = env->vec_size (env, vec); size_t size = env->vec_size (env, vec);
for (size_t i = 0; i < size; i++) for (size_t i = 0; i < size; i++)
env->vec_set (env, vec, i, val); env->vec_set (env, vec, i, val);
return env->intern (env, "t"); return env->intern (env, "t");
...@@ -205,7 +205,7 @@ Fmod_test_vector_eq (emacs_env *env, int nargs, emacs_value args[], void *data) ...@@ -205,7 +205,7 @@ Fmod_test_vector_eq (emacs_env *env, int nargs, emacs_value args[], void *data)
{ {
emacs_value vec = args[0]; emacs_value vec = args[0];
emacs_value val = args[1]; emacs_value val = args[1];
const size_t size = env->vec_size (env, vec); size_t size = env->vec_size (env, vec);
for (size_t i = 0; i < size; i++) for (size_t i = 0; i < size; i++)
if (!env->eq (env, env->vec_get (env, vec, i), val)) if (!env->eq (env, env->vec_get (env, vec, i), val))
return env->intern (env, "nil"); return env->intern (env, "nil");
......
...@@ -141,7 +141,7 @@ static void check_main_thread (void); ...@@ -141,7 +141,7 @@ static void check_main_thread (void);
static void finalize_environment (struct env_storage *); static void finalize_environment (struct env_storage *);
static void initialize_environment (struct env_storage *); static void initialize_environment (struct env_storage *);
static void module_args_out_of_range (emacs_env *, Lisp_Object, Lisp_Object); static void module_args_out_of_range (emacs_env *, Lisp_Object, Lisp_Object);
static void module_handle_signal (emacs_env *, const Lisp_Object); static void module_handle_signal (emacs_env *, Lisp_Object);
static void module_handle_throw (emacs_env *, Lisp_Object); static void module_handle_throw (emacs_env *, Lisp_Object);
static void module_non_local_exit_signal_1 (emacs_env *, Lisp_Object, Lisp_Object); static void module_non_local_exit_signal_1 (emacs_env *, Lisp_Object, Lisp_Object);
static void module_non_local_exit_throw_1 (emacs_env *, Lisp_Object, Lisp_Object); static void module_non_local_exit_throw_1 (emacs_env *, Lisp_Object, Lisp_Object);
...@@ -201,7 +201,7 @@ static void module_wrong_type (emacs_env *, Lisp_Object, Lisp_Object); ...@@ -201,7 +201,7 @@ static void module_wrong_type (emacs_env *, Lisp_Object, Lisp_Object);
return retval; \ return retval; \
} \ } \
verify (module_has_cleanup); \ verify (module_has_cleanup); \
const int dummy __attribute__ ((cleanup (module_reset_handlerlist))); \ int dummy __attribute__ ((cleanup (module_reset_handlerlist))); \
if (sys_setjmp (c->jmp)) \ if (sys_setjmp (c->jmp)) \
{ \ { \
(handlerfunc) (env, c->val); \ (handlerfunc) (env, c->val); \
...@@ -263,7 +263,7 @@ module_make_global_ref (emacs_env *env, emacs_value ref) ...@@ -263,7 +263,7 @@ module_make_global_ref (emacs_env *env, emacs_value ref)
{ {
Lisp_Object value = HASH_VALUE (h, i); Lisp_Object value = HASH_VALUE (h, i);
eassert (NATNUMP (value)); eassert (NATNUMP (value));
const EMACS_UINT refcount = XFASTINT (value); EMACS_UINT refcount = XFASTINT (value);
if (refcount >= MOST_POSITIVE_FIXNUM) if (refcount >= MOST_POSITIVE_FIXNUM)
{ {
module_non_local_exit_signal_1 (env, Qoverflow_error, Qnil); module_non_local_exit_signal_1 (env, Qoverflow_error, Qnil);
...@@ -297,7 +297,7 @@ module_free_global_ref (emacs_env *env, emacs_value ref) ...@@ -297,7 +297,7 @@ module_free_global_ref (emacs_env *env, emacs_value ref)
{ {
Lisp_Object value = HASH_VALUE (h, i); Lisp_Object value = HASH_VALUE (h, i);
eassert (NATNUMP (value)); eassert (NATNUMP (value));
const EMACS_UINT refcount = XFASTINT (value); EMACS_UINT refcount = XFASTINT (value);
eassert (refcount > 0); eassert (refcount > 0);
if (refcount > 1) if (refcount > 1)
{ {
...@@ -329,7 +329,7 @@ static enum emacs_funcall_exit ...@@ -329,7 +329,7 @@ static enum emacs_funcall_exit
module_non_local_exit_get (emacs_env *env, emacs_value *sym, emacs_value *data) module_non_local_exit_get (emacs_env *env, emacs_value *sym, emacs_value *data)
{ {
check_main_thread (); check_main_thread ();
struct emacs_env_private *const p = env->private_members; struct emacs_env_private *p = env->private_members;
if (p->pending_non_local_exit != emacs_funcall_exit_return) if (p->pending_non_local_exit != emacs_funcall_exit_return)
{ {
*sym = &p->non_local_exit_symbol; *sym = &p->non_local_exit_symbol;
...@@ -366,7 +366,7 @@ module_non_local_exit_throw (emacs_env *env, emacs_value tag, emacs_value value) ...@@ -366,7 +366,7 @@ module_non_local_exit_throw (emacs_env *env, emacs_value tag, emacs_value value)
static emacs_value static emacs_value
module_make_function (emacs_env *env, int min_arity, int max_arity, module_make_function (emacs_env *env, int min_arity, int max_arity,
emacs_subr subr, const char *const documentation, emacs_subr subr, const char *documentation,
void *data) void *data)
{ {
check_main_thread (); check_main_thread ();
...@@ -456,7 +456,7 @@ module_extract_integer (emacs_env *env, emacs_value n) ...@@ -456,7 +456,7 @@ module_extract_integer (emacs_env *env, emacs_value n)
{ {
check_main_thread (); check_main_thread ();
eassert (module_non_local_exit_check (env) == emacs_funcall_exit_return); eassert (module_non_local_exit_check (env) == emacs_funcall_exit_return);
const Lisp_Object l = value_to_lisp (n); Lisp_Object l = value_to_lisp (n);
if (! INTEGERP (l)) if (! INTEGERP (l))
{ {
module_wrong_type (env, Qintegerp, l); module_wrong_type (env, Qintegerp, l);
...@@ -483,7 +483,7 @@ module_extract_float (emacs_env *env, emacs_value f) ...@@ -483,7 +483,7 @@ module_extract_float (emacs_env *env, emacs_value f)
{ {
check_main_thread (); check_main_thread ();
eassert (module_non_local_exit_check (env) == emacs_funcall_exit_return); eassert (module_non_local_exit_check (env) == emacs_funcall_exit_return);
const Lisp_Object lisp = value_to_lisp (f); Lisp_Object lisp = value_to_lisp (f);
if (! FLOATP (lisp)) if (! FLOATP (lisp))
{ {
module_wrong_type (env, Qfloatp, lisp); module_wrong_type (env, Qfloatp, lisp);
...@@ -562,7 +562,7 @@ module_get_user_ptr (emacs_env *env, emacs_value uptr) ...@@ -562,7 +562,7 @@ module_get_user_ptr (emacs_env *env, emacs_value uptr)
{ {
check_main_thread (); check_main_thread ();
eassert (module_non_local_exit_check (env) == emacs_funcall_exit_return); eassert (module_non_local_exit_check (env) == emacs_funcall_exit_return);
const Lisp_Object lisp = value_to_lisp (uptr); Lisp_Object lisp = value_to_lisp (uptr);
if (! USER_PTRP (lisp)) if (! USER_PTRP (lisp))
{ {
module_wrong_type (env, Quser_ptr, lisp); module_wrong_type (env, Quser_ptr, lisp);
...@@ -576,8 +576,9 @@ module_set_user_ptr (emacs_env *env, emacs_value uptr, void *ptr) ...@@ -576,8 +576,9 @@ module_set_user_ptr (emacs_env *env, emacs_value uptr, void *ptr)
{ {
check_main_thread (); check_main_thread ();
eassert (module_non_local_exit_check (env) == emacs_funcall_exit_return); eassert (module_non_local_exit_check (env) == emacs_funcall_exit_return);
const Lisp_Object lisp = value_to_lisp (uptr); Lisp_Object lisp = value_to_lisp (uptr);
if (! USER_PTRP (lisp)) module_wrong_type (env, Quser_ptr, lisp); if (! USER_PTRP (lisp))
module_wrong_type (env, Quser_ptr, lisp);
XUSER_PTR (lisp)->p = ptr; XUSER_PTR (lisp)->p = ptr;
} }
...@@ -586,7 +587,7 @@ module_get_user_finalizer (emacs_env *env, emacs_value uptr) ...@@ -586,7 +587,7 @@ module_get_user_finalizer (emacs_env *env, emacs_value uptr)
{ {
check_main_thread (); check_main_thread ();
eassert (module_non_local_exit_check (env) == emacs_funcall_exit_return); eassert (module_non_local_exit_check (env) == emacs_funcall_exit_return);
const Lisp_Object lisp = value_to_lisp (uptr); Lisp_Object lisp = value_to_lisp (uptr);
if (! USER_PTRP (lisp)) if (! USER_PTRP (lisp))
{ {
module_wrong_type (env, Quser_ptr, lisp); module_wrong_type (env, Quser_ptr, lisp);
...@@ -601,8 +602,9 @@ module_set_user_finalizer (emacs_env *env, emacs_value uptr, ...@@ -601,8 +602,9 @@ module_set_user_finalizer (emacs_env *env, emacs_value uptr,
{ {
check_main_thread (); check_main_thread ();
eassert (module_non_local_exit_check (env) == emacs_funcall_exit_return); eassert (module_non_local_exit_check (env) == emacs_funcall_exit_return);
const Lisp_Object lisp = value_to_lisp (uptr); Lisp_Object lisp = value_to_lisp (uptr);
if (! USER_PTRP (lisp)) module_wrong_type (env, Quser_ptr, lisp); if (! USER_PTRP (lisp))
module_wrong_type (env, Quser_ptr, lisp);
XUSER_PTR (lisp)->finalizer = fin; XUSER_PTR (lisp)->finalizer = fin;
} }
...@@ -649,7 +651,7 @@ module_vec_get (emacs_env *env, emacs_value vec, size_t i) ...@@ -649,7 +651,7 @@ module_vec_get (emacs_env *env, emacs_value vec, size_t i)
return NULL; return NULL;
} }
/* Prevent error-prone comparison between types of different signedness. */ /* Prevent error-prone comparison between types of different signedness. */
const size_t size = ASIZE (lvec); size_t size = ASIZE (lvec);
eassert (size >= 0); eassert (size >= 0);
if (i >= size) if (i >= size)
{ {
...@@ -734,8 +736,8 @@ ENVOBJ is a save pointer to a module_fun_env structure. ...@@ -734,8 +736,8 @@ ENVOBJ is a save pointer to a module_fun_env structure.
ARGLIST is a list of arguments passed to SUBRPTR. */) ARGLIST is a list of arguments passed to SUBRPTR. */)
(Lisp_Object envobj, Lisp_Object arglist) (Lisp_Object envobj, Lisp_Object arglist)
{ {
const struct module_fun_env *const envptr = XSAVE_POINTER (envobj, 0); struct module_fun_env *envptr = XSAVE_POINTER (envobj, 0);
const EMACS_INT len = XINT (Flength (arglist)); EMACS_INT len = XINT (Flength (arglist));
eassert (len >= 0); eassert (len >= 0);
if (len > MOST_POSITIVE_FIXNUM) if (len > MOST_POSITIVE_FIXNUM)
xsignal0 (Qoverflow_error); xsignal0 (Qoverflow_error);
...@@ -771,14 +773,14 @@ ARGLIST is a list of arguments passed to SUBRPTR. */) ...@@ -771,14 +773,14 @@ ARGLIST is a list of arguments passed to SUBRPTR. */)
case emacs_funcall_exit_signal: case emacs_funcall_exit_signal:
{ {
Lisp_Object symbol = value_to_lisp (&env.priv.non_local_exit_symbol); Lisp_Object symbol = value_to_lisp (&env.priv.non_local_exit_symbol);
const Lisp_Object data = value_to_lisp (&env.priv.non_local_exit_data); Lisp_Object data = value_to_lisp (&env.priv.non_local_exit_data);
finalize_environment (&env); finalize_environment (&env);
xsignal (symbol, data); xsignal (symbol, data);
} }
case emacs_funcall_exit_throw: case emacs_funcall_exit_throw:
{ {
const Lisp_Object tag = value_to_lisp (&env.priv.non_local_exit_symbol); Lisp_Object tag = value_to_lisp (&env.priv.non_local_exit_symbol);
const Lisp_Object value = value_to_lisp (&env.priv.non_local_exit_data); Lisp_Object value = value_to_lisp (&env.priv.non_local_exit_data);
finalize_environment (&env); finalize_environment (&env);
Fthrow (tag, value); Fthrow (tag, value);
} }
...@@ -810,7 +812,7 @@ static void ...@@ -810,7 +812,7 @@ static void
module_non_local_exit_signal_1 (emacs_env *env, Lisp_Object sym, module_non_local_exit_signal_1 (emacs_env *env, Lisp_Object sym,
Lisp_Object data) Lisp_Object data)
{ {
struct emacs_env_private *const p = env->private_members; struct emacs_env_private *p = env->private_members;
eassert (p->pending_non_local_exit == emacs_funcall_exit_return); eassert (p->pending_non_local_exit == emacs_funcall_exit_return);
p->pending_non_local_exit = emacs_funcall_exit_signal; p->pending_non_local_exit = emacs_funcall_exit_signal;
p->non_local_exit_symbol.v = sym; p->non_local_exit_symbol.v = sym;
...@@ -821,7 +823,7 @@ static void ...@@ -821,7 +823,7 @@ static void
module_non_local_exit_throw_1 (emacs_env *env, Lisp_Object tag, module_non_local_exit_throw_1 (emacs_env *env, Lisp_Object tag,
Lisp_Object value) Lisp_Object value)
{ {
struct emacs_env_private *const p = env->private_members; struct emacs_env_private *p = env->private_members;
eassert (p->pending_non_local_exit == emacs_funcall_exit_return); eassert (p->pending_non_local_exit == emacs_funcall_exit_return);
p->pending_non_local_exit = emacs_funcall_exit_throw; p->pending_non_local_exit = emacs_funcall_exit_throw;
p->non_local_exit_symbol.v = tag; p->non_local_exit_symbol.v = tag;
...@@ -869,7 +871,7 @@ value_to_lisp (emacs_value v) ...@@ -869,7 +871,7 @@ value_to_lisp (emacs_value v)
static emacs_value static emacs_value
lisp_to_value (emacs_env *env, Lisp_Object o) lisp_to_value (emacs_env *env, Lisp_Object o)
{ {
struct emacs_env_private *const p = env->private_members; struct emacs_env_private *p = env->private_members;
if (p->pending_non_local_exit != emacs_funcall_exit_return) if (p->pending_non_local_exit != emacs_funcall_exit_return)
return NULL; return NULL;
return allocate_emacs_value (env, &p->storage, o); return allocate_emacs_value (env, &p->storage, o);
...@@ -903,7 +905,7 @@ finalize_storage (struct emacs_value_storage *storage) ...@@ -903,7 +905,7 @@ finalize_storage (struct emacs_value_storage *storage)
struct emacs_value_frame *next = storage->initial.next; struct emacs_value_frame *next = storage->initial.next;
while (next != NULL) while (next != NULL)
{ {
struct emacs_value_frame *const current = next; struct emacs_value_frame *current = next;
next = current->next; next = current->next;
free (current); free (current);
} }
...@@ -929,7 +931,7 @@ allocate_emacs_value (emacs_env *env, struct emacs_value_storage *storage, ...@@ -929,7 +931,7 @@ allocate_emacs_value (emacs_env *env, struct emacs_value_storage *storage,
initialize_frame (storage->current->next); initialize_frame (storage->current->next);
storage->current = storage->current->next; storage->current = storage->current->next;
} }
const emacs_value value = storage->current->objects + storage->current->offset; emacs_value value = storage->current->objects + storage->current->offset;
value->v = obj; value->v = obj;
++storage->current->offset; ++storage->current->offset;
return value; return value;
...@@ -941,8 +943,8 @@ void mark_modules (void) ...@@ -941,8 +943,8 @@ void mark_modules (void)
{ {
for (Lisp_Object tem = Vmodule_environments; CONSP (tem); tem = XCDR (tem)) for (Lisp_Object tem = Vmodule_environments; CONSP (tem); tem = XCDR (tem))
{ {
const struct env_storage *const env = XSAVE_POINTER (tem, 0); struct env_storage *env = XSAVE_POINTER (tem, 0);
for (const struct emacs_value_frame *frame = &env->priv.storage.initial; for (struct emacs_value_frame *frame = &env->priv.storage.initial;
frame != NULL; frame != NULL;
frame = frame->next) frame = frame->next)
for (size_t i = 0; i < frame->offset; ++i) for (size_t i = 0; i < frame->offset; ++i)
...@@ -1016,7 +1018,7 @@ module_reset_handlerlist (const int *dummy) ...@@ -1016,7 +1018,7 @@ module_reset_handlerlist (const int *dummy)
/* Called on `signal'. ERR is a pair (SYMBOL . DATA), which gets /* Called on `signal'. ERR is a pair (SYMBOL . DATA), which gets
stored in the environment. Set the pending non-local exit flag. */ stored in the environment. Set the pending non-local exit flag. */
static void static void
module_handle_signal (emacs_env *const env, const Lisp_Object err) module_handle_signal (emacs_env *env, Lisp_Object err)
{ {
module_non_local_exit_signal_1 (env, XCAR (err), XCDR (err)); module_non_local_exit_signal_1 (env, XCAR (err), XCDR (err));
} }
...@@ -1024,7 +1026,7 @@ module_handle_signal (emacs_env *const env, const Lisp_Object err) ...@@ -1024,7 +1026,7 @@ module_handle_signal (emacs_env *const env, const Lisp_Object err)
/* Called on `throw'. TAG_VAL is a pair (TAG . VALUE), which gets /* Called on `throw'. TAG_VAL is a pair (TAG . VALUE), which gets
stored in the environment. Set the pending non-local exit flag. */ stored in the environment. Set the pending non-local exit flag. */
static void static void
module_handle_throw (emacs_env *const env, const Lisp_Object tag_val) module_handle_throw (emacs_env *env, Lisp_Object tag_val)
{ {
module_non_local_exit_throw_1 (env, XCAR (tag_val), XCDR (tag_val)); module_non_local_exit_throw_1 (env, XCAR (tag_val), XCDR (tag_val));
} }
...@@ -1035,14 +1037,14 @@ module_handle_throw (emacs_env *const env, const Lisp_Object tag_val) ...@@ -1035,14 +1037,14 @@ module_handle_throw (emacs_env *const env, const Lisp_Object tag_val)
/* Return a string object that contains a user-friendly /* Return a string object that contains a user-friendly
representation of the function environment. */ representation of the function environment. */
static Lisp_Object static Lisp_Object
module_format_fun_env (const struct module_fun_env *const env) module_format_fun_env (const struct module_fun_env *env)
{ {
/* Try to print a function name if possible. */ /* Try to print a function name if possible. */
const char *path, *sym; const char *path, *sym;
if (dynlib_addr (env->subr, &path, &sym)) if (dynlib_addr (env->subr, &path, &sym))
{ {
const char *const format = "#<module function %s from %s>"; static char const format[] = "#<module function %s from %s>";
const int size = snprintf (NULL, 0, format, sym, path); int size = snprintf (NULL, 0, format, sym, path);
eassert (size > 0); eassert (size > 0);
char buffer[size + 1]; char buffer[size + 1];
snprintf (buffer, sizeof buffer, format, sym, path); snprintf (buffer, sizeof buffer, format, sym, path);
...@@ -1050,9 +1052,9 @@ module_format_fun_env (const struct module_fun_env *const env) ...@@ -1050,9 +1052,9 @@ module_format_fun_env (const struct module_fun_env *const env)
} }
else else
{ {
const char *const format = "#<module function at %p>"; static char const format[] = "#<module function at %p>";
const void *const subr = env->subr; void *subr = env->subr;
const int size = snprintf (NULL, 0, format, subr); int size = snprintf (NULL, 0, format, subr);
eassert (size > 0); eassert (size > 0);
char buffer[size + 1]; char buffer[size + 1];
snprintf (buffer, sizeof buffer, format, subr); snprintf (buffer, sizeof buffer, format, subr);
......
...@@ -1399,8 +1399,9 @@ internal_condition_case_n (Lisp_Object (*bfun) (ptrdiff_t, Lisp_Object *), ...@@ -1399,8 +1399,9 @@ internal_condition_case_n (Lisp_Object (*bfun) (ptrdiff_t, Lisp_Object *),
static void init_handler (struct handler *c, Lisp_Object tag_ch_val, static void init_handler (struct handler *c, Lisp_Object tag_ch_val,
enum handlertype handlertype); enum handlertype handlertype);
void push_handler (struct handler **const c, const Lisp_Object tag_ch_val, void
const enum handlertype handlertype) push_handler (struct handler **c, Lisp_Object tag_ch_val,
enum handlertype handlertype)
{ {
if (handlerlist->nextfree) if (handlerlist->nextfree)
*c = handlerlist->nextfree; *c = handlerlist->nextfree;
...@@ -1413,14 +1414,15 @@ void push_handler (struct handler **const c, const Lisp_Object tag_ch_val, ...@@ -1413,14 +1414,15 @@ void push_handler (struct handler **const c, const Lisp_Object tag_ch_val,
init_handler (*c, tag_ch_val, handlertype); init_handler (*c, tag_ch_val, handlertype);
} }
bool push_handler_nosignal (struct handler **const c, const Lisp_Object tag_ch_val, bool
const enum handlertype handlertype) push_handler_nosignal (struct handler **c, Lisp_Object tag_ch_val,
enum handlertype handlertype)
{ {
if (handlerlist->nextfree) if (handlerlist->nextfree)
*c = handlerlist->nextfree; *c = handlerlist->nextfree;
else else
{ {
struct handler *const h = malloc (sizeof (struct handler)); struct handler *h = malloc (sizeof (struct handler));
if (! h) return false; if (! h) return false;
*c = h; *c = h;
h->nextfree = NULL; h->nextfree = NULL;
...@@ -1430,8 +1432,9 @@ bool push_handler_nosignal (struct handler **const c, const Lisp_Object tag_ch_v ...@@ -1430,8 +1432,9 @@ bool push_handler_nosignal (struct handler **const c, const Lisp_Object tag_ch_v
return true; return true;
} }
static void init_handler (struct handler *const c, const Lisp_Object tag_ch_val, static void
const enum handlertype handlertype) init_handler (struct handler *c, Lisp_Object tag_ch_val,
enum handlertype handlertype)
{ {
c->type = handlertype; c->type = handlertype;
c->tag_or_ch = tag_ch_val; c->tag_or_ch = tag_ch_val;
......
...@@ -979,8 +979,8 @@ This uses the variables `load-suffixes' and `load-file-rep-suffixes'. */) ...@@ -979,8 +979,8 @@ This uses the variables `load-suffixes' and `load-file-rep-suffixes'. */)
static bool static bool
suffix_p (Lisp_Object string, const char *suffix) suffix_p (Lisp_Object string, const char *suffix)
{ {
const size_t suffix_len = strlen (suffix); size_t suffix_len = strlen (suffix);
const size_t string_len = SBYTES (string); size_t string_len = SBYTES (string);
return string_len >= suffix_len && !strcmp (SSDATA (string) + string_len - suffix_len, suffix); return string_len >= suffix_len && !strcmp (SSDATA (string) + string_len - suffix_len, suffix);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment