Author: cazfi
Date: Sat Jan 23 20:17:42 2016
New Revision: 31558

URL: http://svn.gna.org/viewcvs/freeciv?rev=31558&view=rev
Log:
Changed type of xz-compressed file read and write amounts from ssize_t to 
size_t.

See bug #24332

Modified:
    branches/S2_6/utility/ioz.c

Modified: branches/S2_6/utility/ioz.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/utility/ioz.c?rev=31558&r1=31557&r2=31558&view=diff
==============================================================================
--- branches/S2_6/utility/ioz.c (original)
+++ branches/S2_6/utility/ioz.c Sat Jan 23 20:17:42 2016
@@ -571,7 +571,7 @@
       int i, j;
 
       for (i = 0; i < size - 1; i += j) {
-        ssize_t len = 0;
+        size_t len = 0;
         bool line_end;
 
         for (j = 0, line_end = FALSE; fp->u.xz.out_avail > 0
@@ -591,7 +591,7 @@
         }
 
         if (fp->u.xz.hack_byte_used) {
-          ssize_t hblen = 0;
+          size_t hblen = 0;
 
           fp->u.xz.in_buf[0] = fp->u.xz.hack_byte;
           len = fread(fp->u.xz.in_buf + 1, 1, PLAIN_FILE_BUF_SIZE - 1,
@@ -601,11 +601,11 @@
           if (len <= 1) {
             hblen = fread(&fp->u.xz.hack_byte, 1, 1, fp->u.xz.plain);
           }
-          if (hblen <= 0) {
+          if (hblen == 0) {
             fp->u.xz.hack_byte_used = FALSE;
           }
         }
-        if (len <= 0) {
+        if (len == 0) {
           if (fp->u.xz.error == LZMA_STREAM_END) {
             if (i + j == 0) {
               /* Plain file read complete, and there was nothing in xz buffers
@@ -718,8 +718,8 @@
 static bool xz_outbuffer_to_file(fz_FILE *fp, lzma_action action)
 {
   do {
-    ssize_t len;
-    ssize_t total = 0;
+    size_t len;
+    size_t total = 0;
 
     fp->u.xz.error = lzma_code(&fp->u.xz.stream, action);
 
@@ -732,7 +732,7 @@
                    PLAIN_FILE_BUF_SIZE - fp->u.xz.stream.avail_out - total,
                    fp->u.xz.plain);
       total += len;
-      if (len <= 0) {
+      if (len == 0) {
         return FALSE;
       }
     }


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to