bug-cpio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-cpio] [PATCH 2/2] cpio: cleanup gcc -Wall warnings


From: Pavel Raiskup
Subject: [Bug-cpio] [PATCH 2/2] cpio: cleanup gcc -Wall warnings
Date: Mon, 23 Sep 2013 16:49:12 +0200

* src/copyin.c (from_ascii): Use (int) for '*' printf modifier.
* src/util.c: (copy_files_disk_to_tape): Use (long long int) for
'%lld' modifier.
(create_all_directories): Remove unused variable.
---
 src/copyin.c |  6 +++---
 src/util.c   | 14 ++++----------
 2 files changed, 7 insertions(+), 13 deletions(-)

diff --git a/src/copyin.c b/src/copyin.c
index 3282816..5db285e 100644
--- a/src/copyin.c
+++ b/src/copyin.c
@@ -904,14 +904,14 @@ from_ascii (char const *where, size_t digs, unsigned 
logbase)
       char *p = strchr (codetab, toupper (*buf));
       if (!p)
        {
-         error (0, 0, _("Malformed number %.*s"), digs, where);
+         error (0, 0, _("Malformed number %.*s"), (int)digs, where);
          break;
        }
       
       d = p - codetab;
       if ((d >> logbase) > 1)
        {
-         error (0, 0, _("Malformed number %.*s"), digs, where);
+         error (0, 0, _("Malformed number %.*s"), (int)digs, where);
          break;
        }
       value += d;
@@ -922,7 +922,7 @@ from_ascii (char const *where, size_t digs, unsigned 
logbase)
     }
   if (overflow)
     error (0, 0, _("Archive value %.*s is out of range"),
-          digs, where);
+          (int)digs, where);
   return value;
 }
 
diff --git a/src/util.c b/src/util.c
index 22725e4..c027046 100644
--- a/src/util.c
+++ b/src/util.c
@@ -502,7 +502,7 @@ copy_files_disk_to_tape (int in_des, int out_des, off_t 
num_bytes,
              }
            else
              error (0, 0, _("Read error at byte %lld in file %s, padding with 
zeros"),
-                       original_num_bytes - num_bytes, filename);
+                       (long long int)original_num_bytes - num_bytes, 
filename);
            write_nuls_to_file (num_bytes, out_des, tape_buffered_write);
            break;
          }
@@ -552,7 +552,7 @@ copy_files_disk_to_disk (int in_des, int out_des, off_t 
num_bytes,
              }
            else
              error (0, 0, _("Read error at byte %lld in file %s, padding with 
zeros"),
-                       original_num_bytes - num_bytes, filename);
+                       (long long int)original_num_bytes - num_bytes, 
filename);
            write_nuls_to_file (num_bytes, out_des, disk_buffered_write);
            break;
          }
@@ -602,23 +602,17 @@ void
 create_all_directories (char *name)
 {
   char *dir;
-  int   mode;
 #ifdef HPUX_CDF
   int   cdf;
 #endif
 
   dir = dir_name (name);
-  mode = 0700;
 #ifdef HPUX_CDF
   cdf = islastparentcdf (name);
   if (cdf)
-    {
-      dir [strlen (dir) - 1] = '\0';   /* remove final + */
-      mode = 04700;
-    }
-  
+    dir [strlen (dir) - 1] = '\0';     /* remove final + */
 #endif
-  
+
   if (dir == NULL)
     error (2, 0, _("virtual memory exhausted"));
 
-- 
1.8.3.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]