Sophie

Sophie

distrib > Mandriva > 2009.1 > x86_64 > by-pkgid > cdee67f930cfa599c7b067d99a146df5 > files > 5

unzip-5.52-8mdv2009.1.src.rpm

--- list.c.64bit	2005-01-27 02:02:02.000000000 +0100
+++ list.c	2009-04-11 22:21:26.000000000 +0200
@@ -647,23 +647,16 @@
 /********************/
 
 int ratio(uc, c)
-    ulg uc, c;
+    ulg64 uc, c;
 {
-    ulg denom;
+    ulg64 denom;
 
     if (uc == 0)
         return 0;
-    if (uc > 2000000L) {    /* risk signed overflow if multiply numerator */
-        denom = uc / 1000L;
-        return ((uc >= c) ?
-            (int) ((uc-c + (denom>>1)) / denom) :
-          -((int) ((c-uc + (denom>>1)) / denom)));
-    } else {             /* ^^^^^^^^ rounding */
-        denom = uc;
-        return ((uc >= c) ?
+    denom = uc;
+    return ((uc >= c) ?
             (int) ((1000L*(uc-c) + (denom>>1)) / denom) :
           -((int) ((1000L*(c-uc) + (denom>>1)) / denom)));
-    }                            /* ^^^^^^^^ rounding */
 }
 
 
--- unzip.h.64bit	2005-02-26 16:23:18.000000000 +0100
+++ unzip.h	2009-04-11 22:21:26.000000000 +0200
@@ -366,6 +366,7 @@
 typedef unsigned char   uch;    /* code assumes unsigned bytes; these type-  */
 typedef unsigned short  ush;    /*  defs replace byte/UWORD/ULONG (which are */
 typedef unsigned long   ulg;    /*  predefined on some systems) & match zip  */
+typedef unsigned long long ulg64;    /*  predefined on some systems) & match zip  */
 #define _IZ_TYPES_DEFINED
 #endif /* !_IZ_TYPES_DEFINED */
 
--- unzpriv.h.64bit	2005-02-04 00:26:42.000000000 +0100
+++ unzpriv.h	2009-04-11 22:21:26.000000000 +0200
@@ -1887,7 +1887,7 @@
    int   get_time_stamp          OF((__GPRO__  time_t *last_modtime,
                                      ulg *nmember));
 #endif
-int      ratio                   OF((ulg uc, ulg c));
+int      ratio                   OF((ulg64 uc, ulg64 c));
 void     fnprint                 OF((__GPRO));
 
 #endif /* !SFX */
--- zipinfo.c.64bit	2005-01-27 02:02:16.000000000 +0100
+++ zipinfo.c	2009-04-11 22:21:26.000000000 +0200
@@ -172,7 +172,7 @@
 static ZCONST char Far CentralDirEntry[] =
   "\nCentral directory entry #%lu:\n---------------------------\n\n";
 static ZCONST char Far ZipfileStats[] =
-  "%lu file%s, %lu bytes uncompressed, %lu bytes compressed:  %s%d.%d%%\n";
+  "%lu file%s, %llu bytes uncompressed, %llu bytes compressed:  %s%d.%d%%\n";
 
 /* zi_long() strings */
 static ZCONST char Far OS_FAT[] = "MS-DOS, OS/2 or NT FAT";
@@ -715,7 +715,7 @@
     int do_this_file=FALSE, error, error_in_archive=PK_COOL;
     int *fn_matched=NULL, *xn_matched=NULL;
     ulg j, members=0L;
-    ulg tot_csize=0L, tot_ucsize=0L;
+    ulg64 tot_csize=0L, tot_ucsize=0L;
     ulg endprev;   /* buffers end of previous entry for zi_long()'s check
                     *  of extra bytes */