summaryrefslogtreecommitdiffstats
path: root/abs/core/unzip/unzip542-size-64bit.patch
blob: 0142a369a3542858809e5afdf70b36a980a1da33 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
--- ./zipinfo.c.gege	Sat Jan 13 22:42:38 2001
+++ ./zipinfo.c	Tue Mar 19 13:54:52 2002
@@ -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";
@@ -699,7 +699,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 */
 
--- ./unzip.h.gege	Fri Apr 21 01:21:14 2000
+++ ./unzip.h	Tue Mar 19 13:55:10 2002
@@ -322,7 +322,8 @@
 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 */

 
--- ./list.c.gege	Sat Jan 13 22:39:48 2001
+++ ./list.c	Tue Mar 19 17:03:27 2002
@@ -633,23 +633,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 */
 }
 
 
--- ./unzpriv.h.gege	Wed Jan 10 23:53:56 2001
+++ ./unzpriv.h	Tue Mar 19 17:05:08 2002
@@ -1669,7 +1669,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 */