update.
[chise/xemacs-chise.git.1] / src / specifier.c
index 8f2055b..017663d 100644 (file)
@@ -354,16 +354,21 @@ specifier_hash (Lisp_Object obj, int depth)
                internal_hash (s->buffer_specs, depth + 1));
 }
 
+inline static size_t
+aligned_sizeof_specifier (size_t specifier_type_specific_size)
+{
+  return ALIGN_SIZE (offsetof (Lisp_Specifier, data)
+                    + specifier_type_specific_size,
+                    ALIGNOF (max_align_t));
+}
+
 static size_t
 sizeof_specifier (const void *header)
 {
-  if (GHOST_SPECIFIER_P ((Lisp_Specifier *) header))
-    return offsetof (Lisp_Specifier, data);
-  else
-    {
-      const Lisp_Specifier *p = (const Lisp_Specifier *) header;
-      return offsetof (Lisp_Specifier, data) + p->methods->extra_data_size;
-    }
+  const Lisp_Specifier *p = (const Lisp_Specifier *) header;
+  return aligned_sizeof_specifier (GHOST_SPECIFIER_P (p)
+                                  ? 0
+                                  : p->methods->extra_data_size);
 }
 
 static const struct lrecord_description specifier_methods_description_1[] = {
@@ -442,7 +447,7 @@ valid_specifier_type_p (Lisp_Object type)
 
 DEFUN ("valid-specifier-type-p", Fvalid_specifier_type_p, 1, 1, 0, /*
 Given a SPECIFIER-TYPE, return non-nil if it is valid.
-Valid types are 'generic, 'integer, boolean, 'color, 'font, 'image,
+Valid types are 'generic, 'integer, 'boolean, 'color, 'font, 'image,
 'face-boolean, and 'toolbar.
 */
        (specifier_type))
@@ -476,8 +481,7 @@ make_specifier_internal (struct specifier_methods *spec_meths,
 {
   Lisp_Object specifier;
   Lisp_Specifier *sp = (Lisp_Specifier *)
-    alloc_lcrecord (offsetof (Lisp_Specifier, data) + data_size,
-                   &lrecord_specifier);
+    alloc_lcrecord (aligned_sizeof_specifier (data_size), &lrecord_specifier);
 
   sp->methods = spec_meths;
   sp->global_specs = Qnil;
@@ -1783,7 +1787,7 @@ specifier_add_spec (Lisp_Object specifier, Lisp_Object locale,
     tem = nconc2 (*orig_inst_list, list_to_build_up);
   else
     {
-      abort ();
+      ABORT ();
       tem = Qnil;
     }
 
@@ -2490,7 +2494,7 @@ specifier_instance_from_inst_list (Lisp_Object specifier,
   /* The instantiate method is allowed to call eval.  Since it
      is quite common for this function to get called from somewhere in
      redisplay we need to make sure that quits are ignored.  Otherwise
-     Fsignal will abort. */
+     Fsignal will ABORT. */
     specbind (Qinhibit_quit, Qt);
 
   LIST_LOOP (rest, inst_list)
@@ -2576,7 +2580,7 @@ specifier_instance (Lisp_Object specifier, Lisp_Object matchspec,
 
        No. Errors are handled in Lisp primitives implementation.
        Invalid domain is a design error here - kkm. */
-    abort ();
+    ABORT ();
 
   if (NILP (buffer) && !NILP (window))
     buffer = WINDOW_BUFFER (XWINDOW (window));
@@ -2587,7 +2591,7 @@ specifier_instance (Lisp_Object specifier, Lisp_Object matchspec,
        really went wrong. */
     device = FRAME_DEVICE (XFRAME (frame));
 
-  /* device had better be determined by now; abort if not. */
+  /* device had better be determined by now; ABORT if not. */
   tag = DEVICE_CLASS (XDEVICE (device));
 
   depth = make_int (1 + XINT (depth));