[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/trunk@2517 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

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

index 4866b12..ea65b8f 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 dbb3d92..dc049b6 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