... | ... |
@@ -127,10 +127,14 @@ static const unsigned int hashlen[] = { |
127 | 127 |
|
128 | 128 |
|
129 | 129 |
static inline int hm_cmp(const uint8_t *itm, const uint8_t *ref, unsigned int keylen) { |
130 |
+#if WORDS_BIGENDIAN == 0 |
|
130 | 131 |
uint32_t i = *(uint32_t *)itm, r = *(uint32_t *)ref; |
131 | 132 |
if(i!=r) |
132 | 133 |
return (i<r) * 2 -1; |
133 | 134 |
return memcmp(&itm[4], &ref[4], keylen - 4); |
135 |
+#else |
|
136 |
+ return memcmp(itm, ref, keylen); |
|
137 |
+#endif |
|
134 | 138 |
} |
135 | 139 |
|
136 | 140 |
static void hm_sort(struct cli_sz_hash *szh, size_t l, size_t r, unsigned int keylen) { |