]> granicus.if.org Git - zziplib/commitdiff
fixing some issues about variable declarations in the middle of a block
authorGuido Draheim <guidod@gmx.de>
Sun, 25 Jan 2004 03:14:49 +0000 (03:14 +0000)
committerGuido Draheim <guidod@gmx.de>
Sun, 25 Jan 2004 03:14:49 +0000 (03:14 +0000)
 that is for non-c99 compiles which are still very much in use out there
 (bins/zzip.c zzip/fseeko.c)

bins/zzip.c
zzip/fseeko.c

index 154bb6adf50d5d19dd56dd8ffc061a499450260e..5223723569884d394d02dafd43f3fda275e419a9 100644 (file)
@@ -34,6 +34,7 @@ main (int argc, char ** argv)
 {
     int argn;
     int exitcode = 0;
+    ZZIP_DIR * dir;
 
     if (argc <= 1 || ! strcmp (argv[1], "--help"))
     {
@@ -46,7 +47,6 @@ main (int argc, char ** argv)
        return 0;
     }
 
-    ZZIP_DIR * dir;
     dir = zzip_dir_creat(argv[1], 0755);
     if (! dir)
     {
index 1fb54b6a7480e15201834c48421c8094d3fb59fb..4c78afc073c3a3932e93f77e6876e27bb7ff4a64 100644 (file)
@@ -228,7 +228,7 @@ zzip_entry_findfirst(FILE* disk)
     {
        fseeko (disk, mapoffs, SEEK_SET);
        fread (buffer, 1, mapsize, disk);
-       char* p = buffer + mapsize - sizeof(struct zzip_disk_trailer);
+       ___ char* p = buffer + mapsize - sizeof(struct zzip_disk_trailer);
        for (; p >= buffer ; p--)
        {
            if (! zzip_disk_trailer_check_magic(p)) continue;
@@ -260,7 +260,7 @@ zzip_entry_findfirst(FILE* disk)
                return entry; ____;
            }
            ____;
-       }
+       } ____;
        if (! mapoffs) break;             assert (mapsize >= pagesize/2);
        mapoffs -= pagesize/2;            /* mapsize += pagesize/2; */
        mapsize = pagesize;               /* if (mapsize > pagesize) ... */
@@ -453,7 +453,7 @@ zzip_entry_fopen (ZZIP_ENTRY* entry, int takeover)
        memcpy (found->tail, entry->tail, entry->tailalloc);
        entry = found;
     }
-    ZZIP_ENTRY_FILE* file = malloc(sizeof(*file));
+    ___ ZZIP_ENTRY_FILE* file = malloc(sizeof(*file));
     if (! file) goto fail1;
     file->entry = entry;
     if (! zzip_entry_fread_file_header (entry, &file->header))
@@ -487,7 +487,7 @@ zzip_entry_fopen (ZZIP_ENTRY* entry, int takeover)
     free (file);
  fail1:
     zzip_entry_free (entry);
-    return 0;
+    return 0; ____;
 }
 
 /** => zzip_entry_fopen