summaryrefslogtreecommitdiff
path: root/insert_string_tpl.h
diff options
context:
space:
mode:
Diffstat (limited to 'insert_string_tpl.h')
-rw-r--r--insert_string_tpl.h18
1 files changed, 5 insertions, 13 deletions
diff --git a/insert_string_tpl.h b/insert_string_tpl.h
index a5685c4ed7..e7037c04e6 100644
--- a/insert_string_tpl.h
+++ b/insert_string_tpl.h
@@ -29,21 +29,13 @@
# define HASH_CALC_MASK HASH_MASK
#endif
#ifndef HASH_CALC_READ
-# ifdef UNALIGNED_OK
-# if BYTE_ORDER == LITTLE_ENDIAN
-# define HASH_CALC_READ \
- memcpy(&val, strstart, sizeof(val));
-# else
-# define HASH_CALC_READ \
- memcpy(&val, strstart, sizeof(val)); \
- val = ZSWAP32(val);
-# endif
+# if BYTE_ORDER == LITTLE_ENDIAN
+# define HASH_CALC_READ \
+ memcpy(&val, strstart, sizeof(val));
# else
# define HASH_CALC_READ \
- val = ((uint32_t)(strstart[0])); \
- val |= ((uint32_t)(strstart[1]) << 8); \
- val |= ((uint32_t)(strstart[2]) << 16); \
- val |= ((uint32_t)(strstart[3]) << 24);
+ memcpy(&val, strstart, sizeof(val)); \
+ val = ZSWAP32(val);
# endif
#endif