projects
/
chise
/
xemacs-chise.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Sync with r21-4-9-utf-2000-0_19-jc3lisp.
[chise/xemacs-chise.git]
/
src
/
opaque.c
diff --git
a/src/opaque.c
b/src/opaque.c
index
a860cb1
..
976ecd7
100644
(file)
--- a/
src/opaque.c
+++ b/
src/opaque.c
@@
-44,7
+44,7
@@
Lisp_Object Vopaque_ptr_free_list;
static void
print_opaque (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
{
static void
print_opaque (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
{
- CONST Lisp_Opaque *p = XOPAQUE (obj);
+ const Lisp_Opaque *p = XOPAQUE (obj);
char buf[200];
sprintf (buf, "#<INTERNAL OBJECT (XEmacs bug?) (opaque, size=%lu) 0x%lx>",
char buf[200];
sprintf (buf, "#<INTERNAL OBJECT (XEmacs bug?) (opaque, size=%lu) 0x%lx>",
@@
-52,11
+52,17
@@
print_opaque (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
write_c_string (buf, printcharfun);
}
write_c_string (buf, printcharfun);
}
+inline static size_t
+aligned_sizeof_opaque (size_t opaque_size)
+{
+ return ALIGN_SIZE (offsetof (Lisp_Opaque, data) + opaque_size,
+ ALIGNOF (max_align_t));
+}
+
static size_t
static size_t
-sizeof_opaque (CONST void *header)
+sizeof_opaque (const void *header)
{
{
- CONST Lisp_Opaque *p = (CONST Lisp_Opaque *) header;
- return offsetof (Lisp_Opaque, data) + p->size;
+ return aligned_sizeof_opaque (((const Lisp_Opaque *) header)->size);
}
/* Return an opaque object of size SIZE.
}
/* Return an opaque object of size SIZE.
@@
-64,10
+70,10
@@
sizeof_opaque (CONST void *header)
If DATA is OPAQUE_UNINIT, the object's data is uninitialized.
Else the object's data is initialized by copying from DATA. */
Lisp_Object
If DATA is OPAQUE_UNINIT, the object's data is uninitialized.
Else the object's data is initialized by copying from DATA. */
Lisp_Object
-make_opaque (CONST void *data, size_t size)
+make_opaque (const void *data, size_t size)
{
Lisp_Opaque *p = (Lisp_Opaque *)
{
Lisp_Opaque *p = (Lisp_Opaque *)
- alloc_lcrecord (offsetof (Lisp_Opaque, data) + size, &lrecord_opaque);
+ alloc_lcrecord (aligned_sizeof_opaque (size), &lrecord_opaque);
p->size = size;
if (data == OPAQUE_CLEAR)
p->size = size;
if (data == OPAQUE_CLEAR)
@@
-121,10
+127,10
@@
DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION ("opaque", opaque,
static void
print_opaque_ptr (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
{
static void
print_opaque_ptr (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
{
- CONST Lisp_Opaque_Ptr *p = XOPAQUE_PTR (obj);
+ const Lisp_Opaque_Ptr *p = XOPAQUE_PTR (obj);
char buf[200];
char buf[200];
- sprintf (buf, "#<INTERNAL OBJECT (XEmacs bug?) (opaque_ptr, adr=0x%lx) 0x%lx>",
+ sprintf (buf, "#<INTERNAL OBJECT (XEmacs bug?) (opaque-ptr, adr=0x%lx) 0x%lx>",
(long)(p->ptr), (unsigned long) p);
write_c_string (buf, printcharfun);
}
(long)(p->ptr), (unsigned long) p);
write_c_string (buf, printcharfun);
}
@@
-141,7
+147,7
@@
hash_opaque_ptr (Lisp_Object obj, int depth)
return (unsigned long) XOPAQUE_PTR (obj)->ptr;
}
return (unsigned long) XOPAQUE_PTR (obj)->ptr;
}
-DEFINE_LRECORD_IMPLEMENTATION ("opaque_ptr", opaque_ptr,
+DEFINE_LRECORD_IMPLEMENTATION ("opaque-ptr", opaque_ptr,
0, print_opaque_ptr, 0,
equal_opaque_ptr, hash_opaque_ptr, 0,
Lisp_Opaque_Ptr);
0, print_opaque_ptr, 0,
equal_opaque_ptr, hash_opaque_ptr, 0,
Lisp_Opaque_Ptr);
@@
-173,5
+179,8
@@
reinit_opaque_once_early (void)
void
init_opaque_once_early (void)
{
void
init_opaque_once_early (void)
{
+ INIT_LRECORD_IMPLEMENTATION (opaque);
+ INIT_LRECORD_IMPLEMENTATION (opaque_ptr);
+
reinit_opaque_once_early ();
}
reinit_opaque_once_early ();
}