static void module_non_local_exit_throw_1 (emacs_env *,
Lisp_Object, Lisp_Object);
static void module_out_of_memory (emacs_env *);
-static void module_reset_handlerlist (struct handler **);
+static void module_reset_handlerlist (struct handler *);
static bool value_storage_contains_p (const struct emacs_value_storage *,
emacs_value, ptrdiff_t *);
module_handle_nonlocal_exit (env, \
internal_cleanup->nonlocal_exit, \
internal_cleanup->val); \
- module_reset_handlerlist (&internal_cleanup); \
+ module_reset_handlerlist (internal_cleanup); \
return retval; \
} \
do { } while (false)
-#define MODULE_INTERNAL_CLEANUP \
- module_reset_handlerlist (&internal_cleanup)
+#define MODULE_INTERNAL_CLEANUP() \
+ module_reset_handlerlist (internal_cleanup)
\f
/* Implementation of runtime and environment functions.
bool overflow = INT_ADD_WRAPV (ref->refcount, 1, &ref->refcount);
if (overflow)
overflow_error ();
- MODULE_INTERNAL_CLEANUP;
+ MODULE_INTERNAL_CLEANUP ();
return &ref->value;
}
else
Lisp_Object value;
XSETPSEUDOVECTOR (value, ref, PVEC_OTHER);
hash_put (h, new_obj, value, hashcode);
- MODULE_INTERNAL_CLEANUP;
+ MODULE_INTERNAL_CLEANUP ();
return &ref->value;
}
}
hash_remove_from_table (h, obj);
}
- MODULE_INTERNAL_CLEANUP;
+ MODULE_INTERNAL_CLEANUP ();
}
static enum emacs_funcall_exit
eassert (MODULE_FUNCTIONP (result));
value = lisp_to_value (env, result);
- MODULE_INTERNAL_CLEANUP;
+ MODULE_INTERNAL_CLEANUP ();
return value;
}
MODULE_FUNCTION_BEGIN (NULL);
Lisp_Object lisp = value_to_lisp (arg);
CHECK_MODULE_FUNCTION (lisp);
- MODULE_INTERNAL_CLEANUP;
+ MODULE_INTERNAL_CLEANUP ();
return XMODULE_FUNCTION (lisp)->finalizer;
}
Lisp_Object lisp = value_to_lisp (arg);
CHECK_MODULE_FUNCTION (lisp);
XMODULE_FUNCTION (lisp)->finalizer = fin;
- MODULE_INTERNAL_CLEANUP;
+ MODULE_INTERNAL_CLEANUP ();
}
void
/* Normalize (interactive nil) to (interactive). */
XMODULE_FUNCTION (lisp_fun)->interactive_form
= NILP (lisp_spec) ? list1 (Qinteractive) : list2 (Qinteractive, lisp_spec);
- MODULE_INTERNAL_CLEANUP;
+ MODULE_INTERNAL_CLEANUP ();
}
Lisp_Object
newargs[1 + i] = value_to_lisp (args[i]);
emacs_value result = lisp_to_value (env, Ffuncall (nargs1, newargs));
SAFE_FREE ();
- MODULE_INTERNAL_CLEANUP;
+ MODULE_INTERNAL_CLEANUP ();
return result;
}
MODULE_FUNCTION_BEGIN (NULL);
tem = lisp_to_value (env, intern (name));
- MODULE_INTERNAL_CLEANUP;
+ MODULE_INTERNAL_CLEANUP ();
return tem;
}
MODULE_FUNCTION_BEGIN (NULL);
tem = lisp_to_value (env, Ftype_of (value_to_lisp (arg)));
- MODULE_INTERNAL_CLEANUP;
+ MODULE_INTERNAL_CLEANUP ();
return tem;
}
intmax_t i;
if (! integer_to_intmax (lisp, &i))
xsignal1 (Qoverflow_error, lisp);
- MODULE_INTERNAL_CLEANUP;
+ MODULE_INTERNAL_CLEANUP ();
return i;
}
MODULE_FUNCTION_BEGIN (NULL);
value = lisp_to_value (env, make_int (n));
- MODULE_INTERNAL_CLEANUP;
+ MODULE_INTERNAL_CLEANUP ();
return value;
}
MODULE_FUNCTION_BEGIN (0);
Lisp_Object lisp = value_to_lisp (arg);
CHECK_TYPE (FLOATP (lisp), Qfloatp, lisp);
- MODULE_INTERNAL_CLEANUP;
+ MODULE_INTERNAL_CLEANUP ();
return XFLOAT_DATA (lisp);
}
MODULE_FUNCTION_BEGIN (NULL);
value = lisp_to_value (env, make_float (d));
- MODULE_INTERNAL_CLEANUP;
+ MODULE_INTERNAL_CLEANUP ();
return value;
}
if (buf == NULL)
{
*len = required_buf_size;
- MODULE_INTERNAL_CLEANUP;
+ MODULE_INTERNAL_CLEANUP ();
return true;
}
*len = required_buf_size;
memcpy (buf, SDATA (lisp_str_utf8), raw_size + 1);
- MODULE_INTERNAL_CLEANUP;
+ MODULE_INTERNAL_CLEANUP ();
return true;
}
Lisp_Object lstr
= len == 0 ? empty_multibyte_string : module_decode_utf_8 (str, len);
value = lisp_to_value (env, lstr);
- MODULE_INTERNAL_CLEANUP;
+ MODULE_INTERNAL_CLEANUP ();
return value;
}
Lisp_Object lstr
= length == 0 ? empty_unibyte_string : make_unibyte_string (str, length);
value = lisp_to_value (env, lstr);
- MODULE_INTERNAL_CLEANUP;
+ MODULE_INTERNAL_CLEANUP ();
return value;
}
MODULE_FUNCTION_BEGIN (NULL);
value = lisp_to_value (env, make_user_ptr (fin, ptr));
- MODULE_INTERNAL_CLEANUP;
+ MODULE_INTERNAL_CLEANUP ();
return value;
}
MODULE_FUNCTION_BEGIN (NULL);
Lisp_Object lisp = value_to_lisp (arg);
CHECK_USER_PTR (lisp);
- MODULE_INTERNAL_CLEANUP;
+ MODULE_INTERNAL_CLEANUP ();
return XUSER_PTR (lisp)->p;
}
Lisp_Object lisp = value_to_lisp (arg);
CHECK_USER_PTR (lisp);
XUSER_PTR (lisp)->p = ptr;
- MODULE_INTERNAL_CLEANUP;
+ MODULE_INTERNAL_CLEANUP ();
}
static emacs_finalizer
MODULE_FUNCTION_BEGIN (NULL);
Lisp_Object lisp = value_to_lisp (arg);
CHECK_USER_PTR (lisp);
- MODULE_INTERNAL_CLEANUP;
+ MODULE_INTERNAL_CLEANUP ();
return XUSER_PTR (lisp)->finalizer;
}
Lisp_Object lisp = value_to_lisp (arg);
CHECK_USER_PTR (lisp);
XUSER_PTR (lisp)->finalizer = fin;
- MODULE_INTERNAL_CLEANUP;
+ MODULE_INTERNAL_CLEANUP ();
}
static void
Lisp_Object lisp = value_to_lisp (vector);
check_vec_index (lisp, index);
ASET (lisp, index, value_to_lisp (value));
- MODULE_INTERNAL_CLEANUP;
+ MODULE_INTERNAL_CLEANUP ();
}
static emacs_value
Lisp_Object lisp = value_to_lisp (vector);
check_vec_index (lisp, index);
value = lisp_to_value (env, AREF (lisp, index));
- MODULE_INTERNAL_CLEANUP;
+ MODULE_INTERNAL_CLEANUP ();
return value;
}
MODULE_FUNCTION_BEGIN (0);
Lisp_Object lisp = value_to_lisp (vector);
CHECK_VECTOR (lisp);
- MODULE_INTERNAL_CLEANUP;
+ MODULE_INTERNAL_CLEANUP ();
return ASIZE (lisp);
}
MODULE_FUNCTION_BEGIN (emacs_process_input_quit);
maybe_quit ();
rc = emacs_process_input_continue;
- MODULE_INTERNAL_CLEANUP;
+ MODULE_INTERNAL_CLEANUP ();
return rc;
}
MODULE_FUNCTION_BEGIN ((struct timespec) {0});
value = lisp_time_argument (value_to_lisp (arg));
- MODULE_INTERNAL_CLEANUP;
+ MODULE_INTERNAL_CLEANUP ();
return value;
}
MODULE_FUNCTION_BEGIN (NULL);
value = lisp_to_value (env, timespec_to_lisp (time));
- MODULE_INTERNAL_CLEANUP;
+ MODULE_INTERNAL_CLEANUP ();
return value;
}
*sign = (0 < x) - (x < 0);
if (x == 0 || count == NULL)
{
- MODULE_INTERNAL_CLEANUP;
+ MODULE_INTERNAL_CLEANUP ();
return true;
}
/* As a simplification we don't check how many array elements
if (magnitude == NULL)
{
*count = required;
- MODULE_INTERNAL_CLEANUP;
+ MODULE_INTERNAL_CLEANUP ();
return true;
}
if (*count < required)
verify (required * bits < PTRDIFF_MAX);
for (ptrdiff_t i = 0; i < required; ++i)
magnitude[i] = (emacs_limb_t) (u >> (i * bits));
- MODULE_INTERNAL_CLEANUP;
+ MODULE_INTERNAL_CLEANUP ();
return true;
}
const mpz_t *x = xbignum_val (o);
*sign = mpz_sgn (*x);
if (count == NULL)
{
- MODULE_INTERNAL_CLEANUP;
+ MODULE_INTERNAL_CLEANUP ();
return true;
}
size_t required_size = (mpz_sizeinbase (*x, 2) + numb - 1) / numb;
if (magnitude == NULL)
{
*count = required;
- MODULE_INTERNAL_CLEANUP;
+ MODULE_INTERNAL_CLEANUP ();
return true;
}
if (*count < required)
size_t written;
mpz_export (magnitude, &written, order, size, endian, nails, *x);
eassert (written == required_size);
- MODULE_INTERNAL_CLEANUP;
+ MODULE_INTERNAL_CLEANUP ();
return true;
}
if (sign == 0)
{
value = lisp_to_value (env, make_fixed_natnum (0));
- MODULE_INTERNAL_CLEANUP;
+ MODULE_INTERNAL_CLEANUP ();
return value;
}
enum { order = -1, size = sizeof *magnitude, endian = 0, nails = 0 };
if (sign < 0)
mpz_neg (mpz[0], mpz[0]);
value = lisp_to_value (env, make_integer_mpz ());
- MODULE_INTERNAL_CLEANUP;
+ MODULE_INTERNAL_CLEANUP ();
return value;
}
MODULE_FUNCTION_BEGIN (-1);
rc = open_channel_for_module (value_to_lisp (pipe_process));
- MODULE_INTERNAL_CLEANUP;
+ MODULE_INTERNAL_CLEANUP ();
return rc;
}
/* Must be called after setting up a handler immediately before
returning from the function. See the comments in lisp.h and the
code in eval.c for details. The macros below arrange for this
- function to be called automatically. PHANDLERLIST points to a word
- containing the handler list, for sanity checking. */
+ function to be called automatically. HANDLERLIST points to the
+ handler list. */
+
static void
-module_reset_handlerlist (struct handler **phandlerlist)
+module_reset_handlerlist (struct handler *handlerlist)
{
- eassert (handlerlist == *phandlerlist);
+ eassert (handlerlist == handlerlist);
handlerlist = handlerlist->next;
}