Skip to content

Commit

Permalink
Minor typo and formatting fixes.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.parrot.org/parrot/trunk@18251 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information
chromatic committed Apr 17, 2007
1 parent e1dba43 commit 1bfae17
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions src/hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ src/hash.c - Hash table
A hashtable contains an array of bucket indexes. Buckets are nodes in a
linked list, each containing a C<void *> key and value. During hash
creation the types of key and value as well as appropriate compare and
creation, the types of key and value as well as appropriate compare and
hashing functions can be set.
This hash implementation uses just one piece of malloced memory. The
C<< hash->bs >> bucket store points this regions.
C<< hash->bs >> bucket store points to this region.
This hash doesn't move during GC, therefore a lot of the old caveats
don't apply.
Expand Down Expand Up @@ -65,20 +65,18 @@ key_hash_STRING(Interp *interp, void *value, size_t seed)
/*
=item C<static int
STRING_compare(Parrot_Interp interp, void *a, void *b)>
STRING_compare(Parrot_Interp interp, void *hash_key, void *bucket_key)>
Compares the two strings, return 0 if they are identical.
C<a> is the search key, C<b> is the bucket key.
Compares the two strings, returning 0 if they are identical.
=cut
*/

static int
STRING_compare(Parrot_Interp interp, void *a, void *b)
STRING_compare(Parrot_Interp interp, void *search_key, void *bucket_key)
{
return string_equal(interp, (STRING *)a, (STRING *) b);
return string_equal(interp, (STRING *)search_key, (STRING *)bucket_key);
}

/*
Expand All @@ -98,21 +96,21 @@ pointer_compare(Parrot_Interp interp, void *a, void *b) {
}

/*
=item C<static size_t
key_hash_pointer(Interp *interp, void *value, size_t seed)>
Returns a hashvalue for a pointer.
=cut
*/

static size_t
key_hash_pointer(Interp *interp, void *value, size_t seed) {
return ((size_t) value) ^ seed;
}



/*
=item C<static size_t
Expand Down Expand Up @@ -671,8 +669,6 @@ parrot_new_pointer_hash(Interp *interp, Hash **hptr)
pointer_compare, key_hash_pointer);
}



/*
=item C<PMC* Parrot_new_INTVAL_hash(Interp *interp, UINTVAL flags)>
Expand All @@ -683,6 +679,7 @@ C<PObj_constant_FLAG> or 0.
=cut
*/

PMC*
Parrot_new_INTVAL_hash(Interp *interp, UINTVAL flags)
{
Expand All @@ -697,6 +694,7 @@ Parrot_new_INTVAL_hash(Interp *interp, UINTVAL flags)
PObj_active_destroy_SET(h);
return h;
}

/*
=item C<INTVAL
Expand Down

0 comments on commit 1bfae17

Please sign in to comment.