ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/libstatgrab/src/libstatgrab/vector.c
(Generate patch)

Comparing projects/libstatgrab/src/libstatgrab/vector.c (file contents):
Revision 1.1 by ats, Sun Apr 4 21:17:58 2004 UTC vs.
Revision 1.2 by ats, Mon Apr 5 00:20:05 2004 UTC

# Line 29 | Line 29
29  
30   #include "vector.h"
31  
32 < int statgrab_vector_resize(void **vector, vector_header *h, int count) {
32 > int statgrab_vector_resize(char **vector, vector_header *h, int count) {
33          int new_count, i;
34  
35          /* Destroy any now-unused items. */
36          if (count < h->used_count && h->destroy_fn != NULL) {
37                  for (i = count; i < h->used_count; i++) {
38 <                        h->destroy_fn((*vector) + i * h->item_size);
38 >                        h->destroy_fn((void *) ((*vector) + i * h->item_size));
39                  }
40          }
41  
# Line 45 | Line 45 | int statgrab_vector_resize(void **vector, vector_heade
45  
46          /* Resize the vector if necessary. */
47          if (new_count != h->alloc_count) {
48 <                void *new_vector;
48 >                char *new_vector;
49  
50                  new_vector = realloc(*vector, new_count * h->item_size);
51                  if (new_vector == NULL && new_count != 0) {
# Line 61 | Line 61 | int statgrab_vector_resize(void **vector, vector_heade
61          /* Initialise any new items. */
62          if (count > h->used_count && h->init_fn != NULL) {
63                  for (i = h->used_count; i < count; i++) {
64 <                        h->init_fn((*vector) + i * h->item_size);
64 >                        h->init_fn((void *) ((*vector) + i * h->item_size));
65                  }
66          }
67  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines