OSDN Git Service

* src/append.c (encode_lzhuf): use size_t and off_t instead of long.
authorarai <arai@6a8cc165-1e22-0410-a132-eb4e3f353aba>
Sat, 12 Jul 2003 19:12:47 +0000 (19:12 +0000)
committerarai <arai@6a8cc165-1e22-0410-a132-eb4e3f353aba>
Sat, 12 Jul 2003 19:12:47 +0000 (19:12 +0000)
(start_indicator): ditto.

* src/extract.c (decode_lzhuf): ditto.

* src/lha.h (struct interfacing): ditto.

* src/lhadd.c (add_one): ditto.
(find_update_files): ditto.
(delete): ditto.

* src/lhext.c (cmd_extract): ditto.

* src/util.c (copyfile): ditto.

git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/lha/lha/trunk@703 6a8cc165-1e22-0410-a132-eb4e3f353aba

src/append.c
src/extract.c
src/lha.h
src/lhadd.c
src/lhext.c
src/util.c

index 0e30f19..26b4b33 100644 (file)
@@ -8,7 +8,7 @@
 /* ------------------------------------------------------------------------ */
 #include "lha.h"
 
-static long reading_size;
+static size_t reading_size;
 
 /* ------------------------------------------------------------------------ */
 int
@@ -16,13 +16,13 @@ encode_lzhuf(infp, outfp, size, original_size_var, packed_size_var,
          name, hdr_method)
     FILE           *infp;
     FILE           *outfp;
-    long            size;
-    long           *original_size_var;
-    long           *packed_size_var;
+    size_t          size;
+    size_t         *original_size_var;
+    size_t         *packed_size_var;
     char           *name;
     char           *hdr_method;
 {
-    static int      method = -1;
+    static int method = -1;
     unsigned int crc;
 
     if (method < 0) {
@@ -56,7 +56,7 @@ encode_lzhuf(infp, outfp, size, original_size_var, packed_size_var,
 void
 start_indicator(name, size, msg, def_indicator_threshold)
     char           *name;
-    long            size;
+    size_t          size;
     char           *msg;
     long            def_indicator_threshold;
 {
index 16e8994..10674af 100644 (file)
@@ -12,8 +12,8 @@ int
 decode_lzhuf(infp, outfp, original_size, packed_size, name, method, read_sizep)
     FILE           *infp;
     FILE           *outfp;
-    long            original_size;
-    long            packed_size;
+    size_t          original_size;
+    size_t          packed_size;
     char           *name;
     int             method;
     size_t         *read_sizep;
index f1f4a11..2ad70f8 100644 (file)
--- a/src/lha.h
+++ b/src/lha.h
@@ -265,8 +265,8 @@ typedef struct LzHeader {
 struct interfacing {
     FILE            *infile;
     FILE            *outfile;
-    unsigned long   original;
-    unsigned long   packed;
+    size_t          original;
+    size_t          packed;
     size_t          read_size;
     int             dicbit;
     int             method;
@@ -342,10 +342,10 @@ EXTERN int      noconvertcase; /* 2000.10.6 */
 
 /* slide.c */
 EXTERN int      unpackable;
-EXTERN unsigned long origsize, compsize;
+EXTERN size_t origsize, compsize;
 EXTERN unsigned short dicbit;
 EXTERN unsigned short maxmatch;
-EXTERN unsigned long decode_count;
+EXTERN size_t decode_count;
 EXTERN unsigned long loc;           /* short -> long .. Changed N.Watazaki */
 EXTERN unsigned char *text;
 
@@ -359,7 +359,7 @@ EXTERN unsigned short p_freq[], pt_table[], pt_code[], t_freq[];
 
 /* append.c */
 #ifdef NEED_INCREMENTAL_INDICATOR
-EXTERN long     indicator_count;
+EXTERN size_t   indicator_count;
 EXTERN long     indicator_threshold;
 #endif
 
index 58ced7c..212dc4c 100644 (file)
@@ -19,8 +19,8 @@ add_one(fp, nafp, hdr)
     FILE           *fp, *nafp;
     LzHeader       *hdr;
 {
-    long            header_pos, next_pos, org_pos, data_pos;
-    long            v_original_size, v_packed_size;
+    off_t header_pos, next_pos, org_pos, data_pos;
+    size_t v_original_size, v_packed_size;
 
     reading_filename = hdr->name;
     writing_filename = temporary_name;
@@ -185,7 +185,7 @@ find_update_files(oafp)
     char            name[FILENAME_LENGTH];
     struct string_pool sp;
     LzHeader        hdr;
-    long            pos;
+    off_t           pos;
     struct stat     stbuf;
     int             len;
 
@@ -218,8 +218,8 @@ static void
 delete(oafp, nafp)
     FILE           *oafp, *nafp;
 {
-    LzHeader        ahdr;
-    long            old_header_pos;
+    LzHeader ahdr;
+    off_t old_header_pos;
 
     old_header_pos = ftello(oafp);
     while (get_header(oafp, &ahdr)) {
index 452ded1..7e9c17e 100644 (file)
@@ -429,7 +429,7 @@ void
 cmd_extract()
 {
     LzHeader        hdr;
-    long            pos;
+    off_t           pos;
     FILE           *afp;
     size_t read_size;
 
index b14dc10..38a5396 100644 (file)
@@ -15,7 +15,7 @@
  */
 #include <errno.h>
 
-long
+size_t
 copyfile(f1, f2, size, text_flg, crcp)  /* return: size of source file */
     FILE *f1;
     FILE *f2;
@@ -25,7 +25,7 @@ copyfile(f1, f2, size, text_flg, crcp)  /* return: size of source file */
 {
     unsigned short  xsize;
     char *buf;
-    long rsize = 0;
+    size_t rsize = 0;
 
     if (!text_mode)
         text_flg = 0;