[svn:parrot] r37645 - trunk/src
cotto at svn.parrot.org
cotto at svn.parrot.org
Mon Mar 23 08:55:14 UTC 2009
Author: cotto
Date: Mon Mar 23 08:55:14 2009
New Revision: 37645
URL: https://trac.parrot.org/parrot/changeset/37645
Log:
[hash] move similar functions together, reformat code (no functional changes)
Modified:
trunk/src/hash.c
Modified: trunk/src/hash.c
==============================================================================
--- trunk/src/hash.c Mon Mar 23 08:44:44 2009 (r37644)
+++ trunk/src/hash.c Mon Mar 23 08:55:14 2009 (r37645)
@@ -845,8 +845,10 @@
parrot_new_pmc_hash(PARROT_INTERP, ARGOUT(PMC *container))
{
ASSERT_ARGS(parrot_new_pmc_hash)
- Hash * const hash = parrot_create_hash(interp, enum_type_PMC,
- Hash_key_type_STRING, STRING_compare,
+ Hash * const hash = parrot_create_hash(interp,
+ enum_type_PMC,
+ Hash_key_type_STRING,
+ STRING_compare,
(hash_hash_key_fn)key_hash_STRING);
PMC_struct_val(container) = hash;
hash->container = container;
@@ -879,6 +881,56 @@
/*
+=item C<Hash * parrot_new_pointer_hash>
+
+Create and return a new hash with void * keys and values.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+PARROT_CANNOT_RETURN_NULL
+Hash *
+parrot_new_pointer_hash(PARROT_INTERP)
+{
+ ASSERT_ARGS(parrot_new_pointer_hash)
+ return parrot_create_hash(interp,
+ enum_type_ptr,
+ Hash_key_type_ptr,
+ pointer_compare,
+ key_hash_pointer);
+}
+
+
+/*
+
+=item C<Hash* parrot_new_intval_hash>
+
+Creates and returns new Hash PMC with INTVAL keys and values. C<flags> can be
+C<PObj_constant_FLAG> or 0.
+
+=cut
+
+*/
+
+
+PARROT_EXPORT
+PARROT_WARN_UNUSED_RESULT
+PARROT_CANNOT_RETURN_NULL
+Hash*
+parrot_new_intval_hash(PARROT_INTERP)
+{
+ ASSERT_ARGS(parrot_new_intval_hash)
+ return parrot_create_hash(interp,
+ enum_type_INTVAL,
+ Hash_key_type_int,
+ int_compare,
+ key_hash_int);
+}
+
+/*
+
=item C<Hash * parrot_create_hash>
Creates and initializes a hash. Function pointers determine its behaviors.
@@ -1031,50 +1083,6 @@
/*
-=item C<Hash * parrot_new_pointer_hash>
-
-Create and return a new hash with void * keys and values.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-PARROT_CANNOT_RETURN_NULL
-Hash *
-parrot_new_pointer_hash(PARROT_INTERP)
-{
- ASSERT_ARGS(parrot_new_pointer_hash)
- return parrot_create_hash(interp, enum_type_ptr, Hash_key_type_ptr,
- pointer_compare, key_hash_pointer);
-}
-
-
-/*
-
-=item C<Hash* parrot_new_intval_hash>
-
-Creates and returns new Hash PMC with INTVAL keys and values. C<flags> can be
-C<PObj_constant_FLAG> or 0.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-Hash*
-parrot_new_intval_hash(PARROT_INTERP)
-{
- ASSERT_ARGS(parrot_new_intval_hash)
- return parrot_create_hash(interp, enum_type_INTVAL, Hash_key_type_int,
- int_compare, key_hash_int);
-}
-
-
-/*
-
=item C<INTVAL parrot_hash_size>
Returns the number of used entries in the hash.
More information about the parrot-commits
mailing list