/* Call a function F that accepts many args, passing it the remaining args,
E.g., 'return CALLN (Fformat, fmt, text);' is less error-prone than
'{ Lisp_Object a[2]; a[0] = fmt; a[1] = text; return Fformat (2, a); }'.
- CALLN is overkill for simple usages like 'Finsert (1, &text);'. */
+ CALLN requires at least one function argument (as C99 prohibits
+ empty initializers), and is overkill for simple usages like
+ 'Finsert (1, &text);'. */
#define CALLN(f, ...) CALLMANY (f, ((Lisp_Object []) {__VA_ARGS__}))
extern void defvar_lisp (struct Lisp_Objfwd const *, char const *);
}
#ifdef HAVE_MODULES
+/* A function pointer type good enough for lisp.h. Actual module
+ function pointers are of a different type that relies on details
+ internal to emacs-module.c. */
+typedef void (*module_funcptr) (void);
+
/* Defined in alloc.c. */
extern Lisp_Object make_user_ptr (void (*finalizer) (void *), void *p);
/* Defined in emacs-module.c. */
extern Lisp_Object funcall_module (Lisp_Object, ptrdiff_t, Lisp_Object *);
extern Lisp_Object module_function_arity (const struct Lisp_Module_Function *);
-extern Lisp_Object module_function_documentation (const struct Lisp_Module_Function *);
-extern void *module_function_address (const struct Lisp_Module_Function *);
+extern Lisp_Object module_function_documentation
+ (struct Lisp_Module_Function const *);
+extern module_funcptr module_function_address
+ (struct Lisp_Module_Function const *);
extern void mark_modules (void);
extern void init_module_assertions (bool);
extern void syms_of_module (void);
#ifdef HAVE_PDUMPER
-#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)
+#if GNUC_PREREQ (4, 7, 0)
# pragma GCC diagnostic error "-Wconversion"
+# pragma GCC diagnostic ignored "-Wsign-conversion"
# pragma GCC diagnostic error "-Wshadow"
# define ALLOW_IMPLICIT_CONVERSION \
_Pragma ("GCC diagnostic push") \
_Pragma ("GCC diagnostic ignored \"-Wconversion\"")
- _Pragma ("GCC diagnostic ignored \"-Wsign-conversion\"")
# define DISALLOW_IMPLICIT_CONVERSION \
_Pragma ("GCC diagnostic pop")
#else
-# define ALLOW_IMPLICIT_CONVERSION ((void)0)
-# define DISALLOW_IMPLICIT_CONVERSION ((void)0)
+# define ALLOW_IMPLICIT_CONVERSION ((void) 0)
+# define DISALLOW_IMPLICIT_CONVERSION ((void) 0)
#endif
#define VM_POSIX 1
general-purpose computer made after 1990. */
verify (sizeof (ptrdiff_t) == sizeof (void *));
verify (sizeof (intptr_t) == sizeof (ptrdiff_t));
-verify (sizeof (void (*)(void)) == sizeof (void *));
+verify (sizeof (void (*) (void)) == sizeof (void *));
verify (sizeof (ptrdiff_t) <= sizeof (Lisp_Object));
verify (sizeof (ptrdiff_t) <= sizeof (EMACS_INT));
verify (CHAR_BIT == 8);
#define DUMP_OFF_MIN INT_LEAST32_MIN
#define DUMP_OFF_MAX INT_LEAST32_MAX
-__attribute__((format (printf,1,2)))
-static void
+static void ATTRIBUTE_FORMAT ((printf, 1, 2))
dump_trace (const char *fmt, ...)
{
if (0)
static bool
dump_object_self_representing_p (Lisp_Object object)
{
- bool result;
- ALLOW_IMPLICIT_CONVERSION;
- result = FIXNUMP (object) || dump_builtin_symbol_p (object);
- DISALLOW_IMPLICIT_CONVERSION;
- return result;
+ return FIXNUMP (object) || dump_builtin_symbol_p (object);
}
#define DEFINE_FROMLISP_FUNC(fn, type) \
if (FIXNUMP (value)) \
return XFIXNUM (value); \
eassert (BIGNUMP (value)); \
- return TYPE_SIGNED (type) \
- ? bignum_to_intmax (value) \
- : bignum_to_uintmax (value); \
+ type result; \
+ if (TYPE_SIGNED (type)) \
+ result = bignum_to_intmax (value); \
+ else \
+ result = bignum_to_uintmax (value); \
DISALLOW_IMPLICIT_CONVERSION; \
+ return result; \
}
#define DEFINE_TOLISP_FUNC(fn, type) \
return INT_TO_INTEGER (value); \
}
-DEFINE_FROMLISP_FUNC (intmax_t_from_lisp, intmax_t);
-DEFINE_TOLISP_FUNC (intmax_t_to_lisp, intmax_t);
-DEFINE_FROMLISP_FUNC (dump_off_from_lisp, dump_off);
-DEFINE_TOLISP_FUNC (dump_off_to_lisp, dump_off);
+DEFINE_FROMLISP_FUNC (intmax_t_from_lisp, intmax_t)
+DEFINE_TOLISP_FUNC (intmax_t_to_lisp, intmax_t)
+DEFINE_FROMLISP_FUNC (dump_off_from_lisp, dump_off)
+DEFINE_TOLISP_FUNC (dump_off_to_lisp, dump_off)
static void
dump_write (struct dump_context *ctx, const void *buf, dump_off nbyte)
return tailq->length;
}
-__attribute__((unused))
-static void
+static void ATTRIBUTE_UNUSED
dump_tailq_prepend (struct dump_tailq *tailq, Lisp_Object value)
{
Lisp_Object link = Fcons (value, tailq->head);
tailq->length += 1;
}
-__attribute__((unused))
-static void
+static void ATTRIBUTE_UNUSED
dump_tailq_append (struct dump_tailq *tailq, Lisp_Object value)
{
Lisp_Object link = Fcons (value, Qnil);
ctx, emacs_ptr, &value, sizeof (value)); \
}
-DEFINE_EMACS_IMMEDIATE_FN (dump_emacs_reloc_immediate_lv, Lisp_Object);
-DEFINE_EMACS_IMMEDIATE_FN (dump_emacs_reloc_immediate_ptrdiff_t, ptrdiff_t);
-DEFINE_EMACS_IMMEDIATE_FN (dump_emacs_reloc_immediate_intmax_t, intmax_t);
-DEFINE_EMACS_IMMEDIATE_FN (dump_emacs_reloc_immediate_int, int);
-DEFINE_EMACS_IMMEDIATE_FN (dump_emacs_reloc_immediate_bool, bool);
+DEFINE_EMACS_IMMEDIATE_FN (dump_emacs_reloc_immediate_lv, Lisp_Object)
+DEFINE_EMACS_IMMEDIATE_FN (dump_emacs_reloc_immediate_ptrdiff_t, ptrdiff_t)
+DEFINE_EMACS_IMMEDIATE_FN (dump_emacs_reloc_immediate_intmax_t, intmax_t)
+DEFINE_EMACS_IMMEDIATE_FN (dump_emacs_reloc_immediate_int, int)
+DEFINE_EMACS_IMMEDIATE_FN (dump_emacs_reloc_immediate_bool, bool)
/* Add an emacs relocation that makes a raw pointer in Emacs point
into the dump. */
union vectorlike_header *out_hdr)
{
ALLOW_IMPLICIT_CONVERSION;
- return dump_object_finish (ctx, out_hdr, vectorlike_nbytes (out_hdr));
+ dump_off result = dump_object_finish (ctx, out_hdr,
+ vectorlike_nbytes (out_hdr));
DISALLOW_IMPLICIT_CONVERSION;
+ return result;
}
static void
dump_metadata_for_pdumper (struct dump_context *ctx)
{
for (int i = 0; i < nr_dump_hooks; ++i)
- dump_emacs_reloc_to_emacs_ptr_raw (ctx, &dump_hooks[i], dump_hooks[i]);
+ dump_emacs_reloc_to_emacs_ptr_raw (ctx, &dump_hooks[i],
+ (void const *) dump_hooks[i]);
dump_emacs_reloc_immediate_int (ctx, &nr_dump_hooks, nr_dump_hooks);
for (int i = 0; i < nr_remembered_data; ++i)
dump_off_to_lisp (reloc_a.length));
}
-typedef void (*drain_reloc_handler)(struct dump_context *, Lisp_Object);
-typedef Lisp_Object (*drain_reloc_merger)(Lisp_Object a, Lisp_Object b);
+typedef void (*drain_reloc_handler) (struct dump_context *, Lisp_Object);
+typedef Lisp_Object (*drain_reloc_merger) (Lisp_Object a, Lisp_Object b);
static void
drain_reloc_list (struct dump_context *ctx,
ctx->deferred_symbols = Qnil;
ctx->fixups = Qnil;
- ctx->staticpro_table = CALLN (Fmake_hash_table);
+ ctx->staticpro_table = Fmake_hash_table (0, NULL);
ctx->symbol_aux = Qnil;
ctx->copied_queue = Qnil;
ctx->cold_queue = Qnil;
{
struct dump_memory_map_spec spec;
void *mapping; /* Actual mapped memory. */
- void (*release)(struct dump_memory_map *);
+ void (*release) (struct dump_memory_map *);
void *private;
};
This variable has the same structure as `mode-line-format' (which see),
and is used only on frames for which no explicit name has been set
\(see `modify-frame-parameters'). */);
+ /* Do not nest calls to pure_list. This works around a bug in
+ Oracle Developer Studio 12.6. */
+ Lisp_Object icon_title_name_format
+ = pure_list (empty_unibyte_string,
+ intern_c_string ("invocation-name"),
+ build_pure_c_string ("@"),
+ intern_c_string ("system-name"));
Vicon_title_format
= Vframe_title_format
= pure_list (intern_c_string ("multiple-frames"),
build_pure_c_string ("%b"),
- pure_list (empty_unibyte_string,
- intern_c_string ("invocation-name"),
- build_pure_c_string ("@"),
- intern_c_string ("system-name")));
+ icon_title_name_format);
DEFVAR_LISP ("message-log-max", Vmessage_log_max,
doc: /* Maximum number of lines to keep in the message log buffer.