]> git.openfabrics.org - ~shefty/rdma-win.git/commitdiff
[COMPLIB] fixed some bugs in not used functions. [mlnx: 4956]
authorleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 26 Oct 2009 10:32:25 +0000 (10:32 +0000)
committerleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 26 Oct 2009 10:32:25 +0000 (10:32 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1@2517 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

trunk/core/complib/cl_list.c
trunk/core/complib/cl_ptr_vector.c

index 4866b12583d2cbfd17067e8a222e9ec3d969540d..ea65b8fcd5e50cb68a2e903d7bc6dc5b61a34611 100644 (file)
@@ -493,6 +493,7 @@ cl_list_insert_array_head(
 {\r
        cl_status_t     status;\r
        void            *p_object;\r
+       uint32_t        i = 0;\r
 \r
        CL_ASSERT( p_list );\r
        CL_ASSERT( cl_is_qpool_inited( &p_list->list_item_pool ) );\r
@@ -514,7 +515,7 @@ cl_list_insert_array_head(
                if( status != CL_SUCCESS )\r
                {\r
                        /* Remove all items that have been inserted. */\r
-                       while( item_count++ < item_count )\r
+                       while( i++ < item_count )\r
                                cl_list_remove_head( p_list );\r
                        return( status );\r
                }\r
@@ -536,6 +537,7 @@ cl_list_insert_array_tail(
 {\r
        cl_status_t     status;\r
        void            *p_object;\r
+       uint32_t        i = 0;\r
 \r
        CL_ASSERT( p_list );\r
        CL_ASSERT( cl_is_qpool_inited( &p_list->list_item_pool ) );\r
@@ -553,7 +555,7 @@ cl_list_insert_array_tail(
                if( status != CL_SUCCESS )\r
                {\r
                        /* Remove all items that have been inserted. */\r
-                       while( item_count++ < item_count )\r
+                       while( i++ < item_count )\r
                                cl_list_remove_tail( p_list );\r
                        return( status );\r
                }\r
index dbb3d926c2aab6c92ba99bcb19f2175c6146ba02..dc049b6f221127ac6f0071aa3d0f5824f4adfd07 100644 (file)
@@ -344,11 +344,12 @@ cl_ptr_vector_find_from_end(
        while( i )\r
        {\r
                /* Invoke the callback for the current element. */\r
-               if( pfn_callback( i, (void*)p_vector->p_ptr_array[--i],\r
+               if( pfn_callback( i, (void*)p_vector->p_ptr_array[i],\r
                        (void*)context ) == CL_SUCCESS )\r
                {\r
                        return( i );\r
                }\r
+               i--;\r
        }\r
 \r
        return( p_vector->size );\r