Skip to content

Commit a8611b3

Browse files
committed
[fix] module_ffi_call: Can jump to `fail' label when result is not yet set [fix] INIT_TYPE_ALIAS: typofix [fix] `emacs_subr' is not public type in newer Emacs
1 parent 481034f commit a8611b3

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

ffi-module.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -509,9 +509,9 @@ module_ffi_call (emacs_env *env, ptrdiff_t nargs, emacs_value *args,
509509
result = &result_holder;
510510
}
511511

512-
fail:
513512
if (result != &result_holder)
514513
free (result);
514+
fail:
515515
free (values);
516516
free (holders);
517517

@@ -889,12 +889,15 @@ module_ffi_define_union (emacs_env *env, ptrdiff_t nargs, emacs_value *args,
889889
}
890890

891891

892+
/* Function prototype for the module Lisp functions. */
893+
typedef emacs_value (*emacs_subr_t) (emacs_env *, ptrdiff_t,
894+
emacs_value [], void *);
892895

893896
struct descriptor
894897
{
895898
const char *name;
896899
int min, max;
897-
emacs_subr subr;
900+
emacs_subr_t subr;
898901
const char *docstring;
899902
};
900903

@@ -989,7 +992,7 @@ init_type_alias (const char *name, bool is_unsigned, int size)
989992
#define INIT_TYPE_ALIAS(Type) \
990993
do \
991994
{ \
992-
Type val = (val) -1L; \
995+
Type val = (Type) -1L; \
993996
init_type_alias (":" #Type, val > 0, sizeof (Type)); \
994997
} \
995998
while (0)

0 commit comments

Comments
 (0)