Diff for /libelwix/src/array.c between versions 1.6 and 1.7.2.1

version 1.6, 2019/01/21 11:57:13 version 1.7.2.1, 2019/01/22 16:16:45
Line 74  array_Init(int numItems) Line 74  array_Init(int numItems)
 }  }
   
 /*  /*
    * array_Init2() - Initialize dynamic array
    *
    * @arr = Allocated array variable
    * @numItems = Number of Items
    * return: NULL error, != NULL allocated memory for array
    */
   array_t *
   array_Init2(array_t * __restrict arr, int numItems)
   {
           if (!arr)
                   return array_Init(numItems);
   
           if (array_Size(arr))
                   return NULL;    /* already allocated array! */
   
           arr->arr_last = -1;
           arr->arr_num = numItems;
           arr->arr_data = e_calloc(array_Size(arr), sizeof(intptr_t));
           if (!arr->arr_data) {
                   e_free(arr);
                   return NULL;
           } else
                   array_Zero(arr);
   
           return arr;
   }
   
   
   /*
  * array_From() - Create and fill array from array with pointers   * array_From() - Create and fill array from array with pointers
  *   *
  * @pargv = Array with pointers   * @pargv = Array with pointers
Line 185  array_Reset(array_t * __restrict arr, int purge) Line 214  array_Reset(array_t * __restrict arr, int purge)
         if (!arr)          if (!arr)
                 return;                  return;
   
         arr->arr_last = -1;  
         arr->arr_num = 0;  
   
         if (purge && arr->arr_data) {          if (purge && arr->arr_data) {
                 e_free(arr->arr_data);                  e_free(arr->arr_data);
                   arr->arr_num = 0;
                 arr->arr_data = e_calloc(array_Size(arr), sizeof(intptr_t));                  arr->arr_data = e_calloc(array_Size(arr), sizeof(intptr_t));
         }          }
   
         array_Zero(arr);          array_Zero(arr);
           arr->arr_last = -1;
 }  }
   
 /*  /*

Removed from v.1.6  
changed lines
  Added in v.1.7.2.1


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>