Changeset 1940 for trunk/src/kmk/strcache2.c
- Timestamp:
- Oct 26, 2008, 2:59:40 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/strcache2.c
r1925 r1940 697 697 if (off) 698 698 { 699 off = STRCACHE2_ENTRY_ALIGNMENT - off; 699 700 seg->start += off; 700 701 seg->size -= off; … … 737 738 738 739 entry = (struct strcache2_entry *) seg->cursor; 739 assert ( (size_t)entry & (STRCACHE2_ENTRY_ALIGNMENT - 1));740 assert (!((size_t)entry & (STRCACHE2_ENTRY_ALIGNMENT - 1))); 740 741 seg->cursor += size; 741 742 seg->avail -= size; … … 1054 1055 const char *end; 1055 1056 1056 if ((size_t)str & (sizeof (void *) - 1)) 1057 entry = (struct strcache2_entry const *)str - 1; 1058 if ((size_t)entry & (STRCACHE2_ENTRY_ALIGNMENT - 1)) 1057 1059 { 1058 1060 fprintf (stderr, 1059 "strcache2[%s]: missaligned string %p\nstring:%s\n",1060 cache->name, (void *) str, str);1061 "strcache2[%s]: missaligned entry %p\nstring: %p=%s\n", 1062 cache->name, (void *)entry, (void *)str, str); 1061 1063 return -1; 1062 1064 } 1063 1065 1064 entry = (struct strcache2_entry const *)str - 1;1065 1066 end = memchr (str, '\0', entry->length); 1066 1067 if ((size_t)(end - str) == entry->length) … … 1078 1079 { 1079 1080 fprintf (stderr, 1080 "strcache2[%s]: corrupt entry %p, hash #1: %x, expected %x;\nstring: %s\n",1081 "strcache2[%s]: corrupt entry %p, hash: %x, expected %x;\nstring: %s\n", 1081 1082 cache->name, (void *)entry, hash, entry->hash, str); 1082 1083 return -1;
Note:
See TracChangeset
for help on using the changeset viewer.