[svn:parrot] r48281 - trunk/src
petdance at svn.parrot.org
petdance at svn.parrot.org
Tue Aug 3 06:43:58 UTC 2010
Author: petdance
Date: Tue Aug 3 06:43:58 2010
New Revision: 48281
URL: https://trac.parrot.org/parrot/changeset/48281
Log:
put back proper consting
Modified:
trunk/src/hash.c
Modified: trunk/src/hash.c
==============================================================================
--- trunk/src/hash.c Tue Aug 3 06:25:32 2010 (r48280)
+++ trunk/src/hash.c Tue Aug 3 06:43:58 2010 (r48281)
@@ -51,8 +51,8 @@
FUNC_MODIFIES(*hash);
static UINTVAL get_hash_val(PARROT_INTERP,
- ARGIN(Hash *hash),
- ARGIN_NULLOK(void *key))
+ ARGIN(const Hash *hash),
+ ARGIN_NULLOK(const void *key))
__attribute__nonnull__(1)
__attribute__nonnull__(2);
@@ -165,7 +165,8 @@
/*
-=item C<static UINTVAL get_hash_val(PARROT_INTERP, Hash *hash, void *key)>
+=item C<static UINTVAL get_hash_val(PARROT_INTERP, const Hash *hash, const void
+*key)>
An inlinable helper function to avoid the overhead of calling key_hash_STRING()
when there's already a calculated hash value for the STRING key.
@@ -175,11 +176,11 @@
*/
static UINTVAL
-get_hash_val(PARROT_INTERP, ARGIN(Hash *hash), ARGIN_NULLOK(void *key))
+get_hash_val(PARROT_INTERP, ARGIN(const Hash *hash), ARGIN_NULLOK(const void *key))
{
ASSERT_ARGS(get_hash_val)
- if (hash->hash_val == key_hash_STRING) {
- STRING *s = (STRING *)key;
+ if (hash->hash_val == (hash_hash_key_fn)key_hash_STRING) {
+ const STRING * const s = (const STRING *)key;
if (s->hashval)
return s->hashval;
}
More information about the parrot-commits
mailing list