gawk-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gawk-diffs] [SCM] gawk branch, master, updated. 26e0f72a6bb214f1f53326c


From: Arnold Robbins
Subject: [gawk-diffs] [SCM] gawk branch, master, updated. 26e0f72a6bb214f1f53326c7b2325715afe43fb6
Date: Fri, 22 Apr 2011 06:20:07 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".

The branch, master has been updated
       via  26e0f72a6bb214f1f53326c7b2325715afe43fb6 (commit)
      from  bcb8bd6d6671a3400c4bfe3e34eb4d5d66050f32 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=26e0f72a6bb214f1f53326c7b2325715afe43fb6

commit 26e0f72a6bb214f1f53326c7b2325715afe43fb6
Author: Arnold D. Robbins <address@hidden>
Date:   Fri Apr 22 09:19:36 2011 +0300

    Add 32/64 bit consistency in hashing.

diff --git a/ChangeLog b/ChangeLog
index ffe1ad5..5130222 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Fri Apr 22 09:18:16 2011  Arnold D. Robbins  <address@hidden>
+
+       * 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      <address@hidden>
 
        * array.c (assoc_list): New function to construct, and optionally
diff --git a/array.c b/array.c
index 15053bb..3d7ff2f 100644
--- a/array.c
+++ b/array.c
@@ -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 89aa4d1..3081a53 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,7 @@
+Fri Apr 22 09:19:06 2011  Arnold D. Robbins  <address@hidden>
+
+       * arraysort.ok: Updated.
+
 Mon Apr 18 10:22:28 2011  John Haque         <address@hidden>
 
        * arraysort.awk, arraysort.ok, sort1.awk, sort1.ok: Updated.
diff --git a/test/arraysort.ok b/test/arraysort.ok
index 23d7c44..70af0e0 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 |

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog         |    6 ++++++
 array.c           |    8 +++++++-
 test/ChangeLog    |    4 ++++
 test/arraysort.ok |    2 +-
 4 files changed, 18 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
gawk



reply via email to

[Prev in Thread] Current Thread [Next in Thread]