]> code.delx.au - gnu-emacs/blobdiff - src/lisp.h
Merge branch 'master' into xwidget
[gnu-emacs] / src / lisp.h
index 119257bc4b9bea7e3e10576f188e8156801125bc..f1e6945f43abf270094db42c7d01f2854ad98b8f 100644 (file)
@@ -781,6 +781,11 @@ enum pvec_type
   PVEC_WINDOW_CONFIGURATION,
   PVEC_SUBR,
   PVEC_OTHER,
+#ifdef HAVE_XWIDGETS
+  PVEC_XWIDGET,
+  PVEC_XWIDGET_VIEW,
+#endif
+
   /* These should be last, check internal_equal to see why.  */
   PVEC_COMPILED,
   PVEC_CHAR_TABLE,
@@ -1503,22 +1508,18 @@ gc_aset (Lisp_Object array, ptrdiff_t idx, Lisp_Object val)
   XVECTOR (array)->contents[idx] = val;
 }
 
-/* True if Qnil's representation is nonzero.  This is always false currently,
-   but there is fallback code for hypothetical alternative implementations.
-   Compile with -DNIL_IS_NONZERO to test the fallback code.  */
-#ifndef NIL_IS_NONZERO
-enum { NIL_IS_NONZERO = XLI_BUILTIN_LISPSYM (iQnil) != 0 };
-#endif
+/* True, since Qnil's representation is zero.  Every place in the code
+   that assumes Qnil is zero should verify (NIL_IS_ZERO), to make it easy
+   to find such assumptions later if we change Qnil to be nonzero.  */
+enum { NIL_IS_ZERO = XLI_BUILTIN_LISPSYM (iQnil) == 0 };
 
 /* Set a Lisp_Object array V's N entries to nil.  */
 INLINE void
 memsetnil (Lisp_Object *v, ptrdiff_t n)
 {
   eassert (0 <= n);
+  verify (NIL_IS_ZERO);
   memset (v, 0, n * sizeof *v);
-  if (NIL_IS_NONZERO)
-    for (ptrdiff_t i = 0; i < n; i++)
-      v[i] = Qnil;
 }
 
 /* If a struct is made to look like a vector, this macro returns the length