]> git.eshelyaron.com Git - emacs.git/commitdiff
some rework to please --enable-check-lisp-object-type
authorAndrea Corallo <akrl@sdf.org>
Fri, 27 Dec 2019 16:02:23 +0000 (17:02 +0100)
committerAndrea Corallo <akrl@sdf.org>
Wed, 1 Jan 2020 10:38:17 +0000 (11:38 +0100)
src/comp.c
src/data.c
src/lisp.h
src/pdumper.c

index 85b0983a6df201910ef24eced60f74a77989fefc..eacda5de5503e7b25c0dc2324c43fd780bc991ad 100644 (file)
@@ -866,7 +866,7 @@ emit_const_lisp_obj (Lisp_Object obj)
   emit_comment (format_string ("const lisp obj: %s",
                               SSDATA (Fprin1_to_string (obj, Qnil))));
 
-  if (Qnil == NULL && EQ (obj, Qnil))
+  if (NIL_IS_ZERO && EQ (obj, Qnil))
     return emit_cast (comp.lisp_obj_type,
                      gcc_jit_context_new_rvalue_from_ptr (comp.ctxt,
                                                           comp.void_ptr_type,
index 191fb3136879256e45e7c9a5972db40f2656f563..8901ffbb2c3e4914696e3d4fca945bc07947c6a2 100644 (file)
@@ -919,7 +919,7 @@ Value, if non-nil, is a list (interactive SPEC).  */)
 
   if (SUBRP (fun))
     {
-      if (SUBR_NATIVE_COMPILEDP (fun) && XSUBR (fun)->native_intspec)
+      if (SUBR_NATIVE_COMPILEDP (fun) && !NILP (XSUBR (fun)->native_intspec))
        return XSUBR (fun)->native_intspec;
 
       const char *spec = XSUBR (fun)->intspec;
index 69db8cdef103194e9751d7b78c1ad4f7b9f32b63..2d083dc458261e94c351d12d566cc97457da7c02 100644 (file)
@@ -4761,7 +4761,7 @@ extern char *emacs_root_dir (void);
 INLINE bool
 SUBR_NATIVE_COMPILEDP (Lisp_Object a)
 {
-  return SUBRP (a) && XSUBR (a)->native_comp_u[0];
+  return SUBRP (a) && !NILP (XSUBR (a)->native_comp_u[0]);
 }
 
 INLINE struct Lisp_Native_Comp_Unit *
index 81d48496be286a7308d73d386f8e51379a8ebef2..a35cc7ffcd6c213151399029cafe02ce4fccb449 100644 (file)
@@ -2948,13 +2948,13 @@ dump_subr (struct dump_context *ctx, const struct Lisp_Subr *subr)
   struct Lisp_Subr out;
   dump_object_start (ctx, &out, sizeof (out));
   DUMP_FIELD_COPY (&out, subr, header.size);
-  if (NATIVE_COMP_FLAG && subr->native_comp_u[0])
+  if (NATIVE_COMP_FLAG && !NILP (subr->native_comp_u[0]))
     out.function.a0 = NULL;
   else
     dump_field_emacs_ptr (ctx, &out, subr, &subr->function.a0);
   DUMP_FIELD_COPY (&out, subr, min_args);
   DUMP_FIELD_COPY (&out, subr, max_args);
-  if (NATIVE_COMP_FLAG && subr->native_comp_u[0])
+  if (NATIVE_COMP_FLAG && !NILP (subr->native_comp_u[0]))
     {
       dump_field_fixup_later (ctx, &out, subr, &subr->symbol_name);
       dump_remember_cold_op (ctx,
@@ -2973,7 +2973,7 @@ dump_subr (struct dump_context *ctx, const struct Lisp_Subr *subr)
     dump_field_lv (ctx, &out, subr, &subr->native_comp_u[0], WEIGHT_NORMAL);
 
   dump_off subr_off = dump_object_finish (ctx, &out, sizeof (out));
-  if (ctx->flags.dump_object_contents && subr->native_comp_u[0])
+  if (ctx->flags.dump_object_contents && !NILP (subr->native_comp_u[0]))
     /* We'll do the final addr relocation during VERY_LATE_RELOCS time
        after the compilation units has been loaded. */
     dump_push (&ctx->dump_relocs[VERY_LATE_RELOCS],