[BACK]Return to radixsort.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / sort

Diff for /src/usr.bin/sort/radixsort.c between version 1.1 and 1.2

version 1.1, 2015/03/17 17:45:13 version 1.2, 2015/03/17 17:49:27
Line 119 
Line 119 
         ssl = sl->sublevels[indx];          ssl = sl->sublevels[indx];
   
         if (ssl == NULL) {          if (ssl == NULL) {
                 ssl = sort_malloc(sizeof(struct sort_level));                  ssl = sort_calloc(1, sizeof(struct sort_level));
                 memset(ssl, 0, sizeof(struct sort_level));  
   
                 ssl->level = sl->level + 1;                  ssl->level = sl->level + 1;
                 sl->sublevels[indx] = ssl;                  sl->sublevels[indx] = ssl;
   
Line 274 
Line 272 
         }          }
   
         sl->sln = 256;          sl->sln = 256;
         sl->sublevels = sort_malloc(slsz);          sl->sublevels = sort_calloc(1, slsz);
         memset(sl->sublevels, 0, slsz);  
   
         sl->real_sln = 0;          sl->real_sln = 0;
   
         tosort_num = sl->tosort_num;          tosort_num = sl->tosort_num;
Line 391 
Line 387 
   
         sl->start_position = 0;          sl->start_position = 0;
         sl->sln = 256;          sl->sln = 256;
         sl->sublevels = sort_malloc(slsz);          sl->sublevels = sort_calloc(1, slsz);
         memset(sl->sublevels, 0, slsz);  
   
         for (i = 0; i < sl->tosort_num; ++i)          for (i = 0; i < sl->tosort_num; ++i)
                 place_item(sl, i);                  place_item(sl, i);
Line 459 
Line 454 
 {  {
         struct sort_level *sl;          struct sort_level *sl;
   
         sl = sort_malloc(sizeof(struct sort_level));          sl = sort_calloc(1, sizeof(struct sort_level));
         memset(sl, 0, sizeof(struct sort_level));  
   
         sl->tosort = base;          sl->tosort = base;
         sl->tosort_num = nmemb;          sl->tosort_num = nmemb;
         sl->tosort_sz = nmemb;          sl->tosort_sz = nmemb;

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2