You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by na...@apache.org on 2006/02/09 12:50:09 UTC

svn commit: r376267 - /webservices/axis2/trunk/c/modules/util/hash.c

Author: nandika
Date: Thu Feb  9 03:50:06 2006
New Revision: 376267

URL: http://svn.apache.org/viewcvs?rev=376267&view=rev
Log:
bug fixed 

Modified:
    webservices/axis2/trunk/c/modules/util/hash.c

Modified: webservices/axis2/trunk/c/modules/util/hash.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/util/hash.c?rev=376267&r1=376266&r2=376267&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/util/hash.c (original)
+++ webservices/axis2/trunk/c/modules/util/hash.c Thu Feb  9 03:50:06 2006
@@ -81,8 +81,8 @@
 static axis2_hash_entry_t **
 alloc_array (axis2_hash_t *ht, unsigned int max)
 {
-    return memset (AXIS2_MALLOC (ht->environment->allocator,
-                                 sizeof (*ht->array) * (max + 1)), 0,
+    return memset (AXIS2_MALLOC (ht->environment->allocator,  
+                   sizeof (*ht->array) * (max + 1)), 0,
                    sizeof (*ht->array) * (max + 1));
 }
 
@@ -121,7 +121,6 @@
 AXIS2_DECLARE(axis2_hash_index_t*)
 axis2_hash_next (axis2_env_t **environment, axis2_hash_index_t *hi)
 {
-    AXIS2_ENV_CHECK(environment, NULL);
     hi->this = hi->next;
     while (!hi->this)
     {
@@ -141,7 +140,6 @@
 axis2_hash_first (axis2_hash_t *ht, axis2_env_t **environment)
 {
     axis2_hash_index_t *hi;
-    AXIS2_ENV_CHECK(environment, NULL);
     if (environment && *environment)
         hi = AXIS2_MALLOC ((*environment)->allocator, sizeof (*hi));
     else
@@ -175,13 +173,16 @@
 expand_array (axis2_hash_t * ht)
 {
     axis2_hash_index_t *hi;
+    axis2_env_t **env = NULL;
+    
     axis2_hash_entry_t **new_array;
     unsigned int new_max;
 
     new_max = ht->max * 2 + 1;
     new_array = alloc_array (ht, new_max);
-    for (hi = axis2_hash_first (ht, NULL); hi;
-         hi = axis2_hash_next (NULL, hi))
+    env = &(ht->environment);
+    for (hi = axis2_hash_first (ht, env); hi;
+         hi = axis2_hash_next (env , hi))
     {
         unsigned int i = hi->this->hash & new_max;
         hi->this->next = new_array[i];