diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | array.c | 8 | ||||
-rw-r--r-- | test/ChangeLog | 4 | ||||
-rw-r--r-- | test/arraysort.ok | 2 |
4 files changed, 18 insertions, 2 deletions
@@ -1,3 +1,9 @@ +Fri Apr 22 09:18:16 2011 Arnold D. Robbins <arnold@skeeve.com> + + * array.c (awk_hash): Force results into 32 bits for consistency + across platforms. Keeps the test suite happy. This may turn out + to be a bad idea in the long run. + Mon Apr 18 10:18:26 2011 John Haque <j.eh@mchsi.com> * array.c (assoc_list): New function to construct, and optionally @@ -427,9 +427,15 @@ awk_hash(const char *s, size_t len, unsigned long hsize, size_t *code) * Even more speed: * #define HASHC h = *s++ + 65599 * h * Because 65599 = pow(2, 6) + pow(2, 16) - 1 we multiply by shifts + * + * 4/2011: Force the results to 32 bits, to get the same + * result on both 32- and 64-bit systems. This may be a + * bad idea. */ #define HASHC htmp = (h << 6); \ - h = *s++ + htmp + (htmp << 10) - h + h = *s++ + htmp + (htmp << 10) - h ; \ + htmp &= 0xFFFFFFFF; \ + h &= 0xFFFFFFFF; unsigned long htmp; diff --git a/test/ChangeLog b/test/ChangeLog index 89aa4d11..3081a53c 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,7 @@ +Fri Apr 22 09:19:06 2011 Arnold D. Robbins <arnold@skeeve.com> + + * arraysort.ok: Updated. + Mon Apr 18 10:22:28 2011 John Haque <j.eh@mchsi.com> * arraysort.awk, arraysort.ok, sort1.awk, sort1.ok: Updated. diff --git a/test/arraysort.ok b/test/arraysort.ok index 23d7c44a..70af0e01 100644 --- a/test/arraysort.ok +++ b/test/arraysort.ok @@ -34,9 +34,9 @@ y 1 | 3| 3| |0|0| |1|1| +| 4 | 4 | |2|2| |3|3| -| 4 | 4 | --asc ind str-- | 3| 3| | 4 | 4 | |