From beca20d2a099ff9b732c1895dcb8b7b42ea9897f Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Mon, 20 Oct 2003 22:50:13 +0100 Subject: * objc/hash.h (hash_string): Don't use a cast as an lvalue. From-SVN: r72722 --- libobjc/ChangeLog | 4 ++++ libobjc/objc/hash.h | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'libobjc') diff --git a/libobjc/ChangeLog b/libobjc/ChangeLog index b7226be1c69..b3a26b25209 100644 --- a/libobjc/ChangeLog +++ b/libobjc/ChangeLog @@ -1,3 +1,7 @@ +2003-10-20 Joseph S. Myers + + * objc/hash.h (hash_string): Don't use a cast as an lvalue. + 2003-10-17 Rainer Orth * Makefile.in (runtime-info.h): Use MULTIFLAGS. diff --git a/libobjc/objc/hash.h b/libobjc/objc/hash.h index acb6c9979d4..02aca6e8765 100644 --- a/libobjc/objc/hash.h +++ b/libobjc/objc/hash.h @@ -172,10 +172,10 @@ hash_string (cache_ptr cache, const void *key) { unsigned int ret = 0; unsigned int ctr = 0; + const char *ckey = key; - - while (*(const char *) key) { - ret ^= *((const char *) key)++ << ctr; + while (*ckey) { + ret ^= *ckey++ << ctr; ctr = (ctr + 1) % sizeof (void *); } -- cgit v1.2.1