Mercurial > hg > xemacs-beta
comparison src/alloc.c @ 4962:e813cf16c015
merge
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Mon, 01 Feb 2010 05:29:05 -0600 |
parents | 304aebb79cd3 6ef8256a020a |
children | 1f509f82c8c9 |
comparison
equal
deleted
inserted
replaced
4961:b90f8cf474e0 | 4962:e813cf16c015 |
---|---|
1221 mark_object (XCAR (obj)); | 1221 mark_object (XCAR (obj)); |
1222 return XCDR (obj); | 1222 return XCDR (obj); |
1223 } | 1223 } |
1224 | 1224 |
1225 static int | 1225 static int |
1226 cons_equal (Lisp_Object ob1, Lisp_Object ob2, int depth) | 1226 cons_equal (Lisp_Object ob1, Lisp_Object ob2, int depth, int foldcase) |
1227 { | 1227 { |
1228 depth++; | 1228 depth++; |
1229 while (internal_equal (XCAR (ob1), XCAR (ob2), depth)) | 1229 while (internal_equal_0 (XCAR (ob1), XCAR (ob2), depth, foldcase)) |
1230 { | 1230 { |
1231 ob1 = XCDR (ob1); | 1231 ob1 = XCDR (ob1); |
1232 ob2 = XCDR (ob2); | 1232 ob2 = XCDR (ob2); |
1233 if (! CONSP (ob1) || ! CONSP (ob2)) | 1233 if (! CONSP (ob1) || ! CONSP (ob2)) |
1234 return internal_equal (ob1, ob2, depth); | 1234 return internal_equal_0 (ob1, ob2, depth, foldcase); |
1235 } | 1235 } |
1236 return 0; | 1236 return 0; |
1237 } | 1237 } |
1238 | 1238 |
1239 static const struct memory_description cons_description[] = { | 1239 static const struct memory_description cons_description[] = { |
1545 return FLEXIBLE_ARRAY_STRUCT_SIZEOF (Lisp_Vector, Lisp_Object, contents, | 1545 return FLEXIBLE_ARRAY_STRUCT_SIZEOF (Lisp_Vector, Lisp_Object, contents, |
1546 ((Lisp_Vector *) lheader)->size); | 1546 ((Lisp_Vector *) lheader)->size); |
1547 } | 1547 } |
1548 | 1548 |
1549 static int | 1549 static int |
1550 vector_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) | 1550 vector_equal (Lisp_Object obj1, Lisp_Object obj2, int depth, int foldcase) |
1551 { | 1551 { |
1552 int len = XVECTOR_LENGTH (obj1); | 1552 int len = XVECTOR_LENGTH (obj1); |
1553 if (len != XVECTOR_LENGTH (obj2)) | 1553 if (len != XVECTOR_LENGTH (obj2)) |
1554 return 0; | 1554 return 0; |
1555 | 1555 |
1556 { | 1556 { |
1557 Lisp_Object *ptr1 = XVECTOR_DATA (obj1); | 1557 Lisp_Object *ptr1 = XVECTOR_DATA (obj1); |
1558 Lisp_Object *ptr2 = XVECTOR_DATA (obj2); | 1558 Lisp_Object *ptr2 = XVECTOR_DATA (obj2); |
1559 while (len--) | 1559 while (len--) |
1560 if (!internal_equal (*ptr1++, *ptr2++, depth + 1)) | 1560 if (!internal_equal_0 (*ptr1++, *ptr2++, depth + 1, foldcase)) |
1561 return 0; | 1561 return 0; |
1562 } | 1562 } |
1563 return 1; | 1563 return 1; |
1564 } | 1564 } |
1565 | 1565 |
2249 flush_cached_extent_info (XCAR (XSTRING_PLIST (obj))); | 2249 flush_cached_extent_info (XCAR (XSTRING_PLIST (obj))); |
2250 return XSTRING_PLIST (obj); | 2250 return XSTRING_PLIST (obj); |
2251 } | 2251 } |
2252 | 2252 |
2253 static int | 2253 static int |
2254 string_equal (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth)) | 2254 string_equal (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth), |
2255 int foldcase) | |
2255 { | 2256 { |
2256 Bytecount len; | 2257 Bytecount len; |
2257 return (((len = XSTRING_LENGTH (obj1)) == XSTRING_LENGTH (obj2)) && | 2258 if (foldcase) |
2258 !memcmp (XSTRING_DATA (obj1), XSTRING_DATA (obj2), len)); | 2259 return !lisp_strcasecmp_i18n (obj1, obj2); |
2260 else | |
2261 return (((len = XSTRING_LENGTH (obj1)) == XSTRING_LENGTH (obj2)) && | |
2262 !memcmp (XSTRING_DATA (obj1), XSTRING_DATA (obj2), len)); | |
2259 } | 2263 } |
2260 | 2264 |
2261 static const struct memory_description string_description[] = { | 2265 static const struct memory_description string_description[] = { |
2262 #ifdef NEW_GC | 2266 #ifdef NEW_GC |
2263 { XD_LISP_OBJECT, offsetof (Lisp_String, data_object) }, | 2267 { XD_LISP_OBJECT, offsetof (Lisp_String, data_object) }, |