Mercurial > hg > xemacs-beta
comparison src/opaque.c @ 2515:de9952d2ed18
[xemacs-hg @ 2005-01-26 10:22:19 by ben]
Hash table cleanups, part 1 of 2
emacs-marshals.c, hash.c, hash.h, ui-gtk.c: Clean up and generalize creation of string hash tables.
ui-gtk.c, elhash.h, gccache-gtk.c, glyphs-gtk.c, lrecord.h, marker.c, objects-gtk.c, objects-msw.c, objects-tty.c, objects-x.c, objects.c, opaque.c, rangetab.c, specifier.c, specifier.h, xgccache.c: Use Hashcode rather than unsigned long.
author | ben |
---|---|
date | Wed, 26 Jan 2005 10:22:29 +0000 |
parents | 04bc9d2f42c7 |
children | 6fa9919a9a0b |
comparison
equal
deleted
inserted
replaced
2514:b49d38bc659d | 2515:de9952d2ed18 |
---|---|
98 !memcmp (XOPAQUE_DATA (obj1), XOPAQUE_DATA (obj2), size)); | 98 !memcmp (XOPAQUE_DATA (obj1), XOPAQUE_DATA (obj2), size)); |
99 } | 99 } |
100 | 100 |
101 /* This will not work correctly for opaques with subobjects! */ | 101 /* This will not work correctly for opaques with subobjects! */ |
102 | 102 |
103 static unsigned long | 103 static Hashcode |
104 hash_opaque (Lisp_Object obj, int UNUSED (depth)) | 104 hash_opaque (Lisp_Object obj, int UNUSED (depth)) |
105 { | 105 { |
106 if (XOPAQUE_SIZE (obj) == sizeof (unsigned long)) | 106 if (XOPAQUE_SIZE (obj) == sizeof (unsigned long)) |
107 return *((unsigned long *) XOPAQUE_DATA (obj)); | 107 return *((Hashcode *) XOPAQUE_DATA (obj)); |
108 else | 108 else |
109 return memory_hash (XOPAQUE_DATA (obj), XOPAQUE_SIZE (obj)); | 109 return memory_hash (XOPAQUE_DATA (obj), XOPAQUE_SIZE (obj)); |
110 } | 110 } |
111 | 111 |
112 static const struct memory_description opaque_description[] = { | 112 static const struct memory_description opaque_description[] = { |
139 equal_opaque_ptr (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth)) | 139 equal_opaque_ptr (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth)) |
140 { | 140 { |
141 return (XOPAQUE_PTR (obj1)->ptr == XOPAQUE_PTR (obj2)->ptr); | 141 return (XOPAQUE_PTR (obj1)->ptr == XOPAQUE_PTR (obj2)->ptr); |
142 } | 142 } |
143 | 143 |
144 static unsigned long | 144 static Hashcode |
145 hash_opaque_ptr (Lisp_Object obj, int UNUSED (depth)) | 145 hash_opaque_ptr (Lisp_Object obj, int UNUSED (depth)) |
146 { | 146 { |
147 return (unsigned long) XOPAQUE_PTR (obj)->ptr; | 147 return (Hashcode) XOPAQUE_PTR (obj)->ptr; |
148 } | 148 } |
149 | 149 |
150 static const struct memory_description opaque_ptr_description[] = { | 150 static const struct memory_description opaque_ptr_description[] = { |
151 { XD_END } | 151 { XD_END } |
152 }; | 152 }; |