Преглед на файлове

Fix one more -Werror=declaration-after-statement issue

Jonas Borgström преди 11 години
родител
ревизия
37cc63fc46
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 2 2
      attic/_hashindex.c

+ 2 - 2
attic/_hashindex.c

@@ -115,15 +115,15 @@ hashindex_resize(HashIndex *index, int capacity)
 {
 {
     char *new_path = malloc(strlen(index->path) + 5);
     char *new_path = malloc(strlen(index->path) + 5);
     int ret = 0;
     int ret = 0;
+    HashIndex *new;
+    void *key = NULL;
     strcpy(new_path, index->path);
     strcpy(new_path, index->path);
     strcat(new_path, ".tmp");
     strcat(new_path, ".tmp");
-    HashIndex *new;
 
 
     if(!(new = hashindex_create(new_path, capacity, index->key_size, index->value_size))) {
     if(!(new = hashindex_create(new_path, capacity, index->key_size, index->value_size))) {
         free(new_path);
         free(new_path);
         return 0;
         return 0;
     }
     }
-    void *key = NULL;
     while((key = hashindex_next_key(index, key))) {
     while((key = hashindex_next_key(index, key))) {
         hashindex_set(new, key, hashindex_get(index, key));
         hashindex_set(new, key, hashindex_get(index, key));
     }
     }