bug-hurd
[Top][All Lists]
Advanced

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

[PATCH] fix compiler warnings in hurd/libstore


From: Flavio Cruz
Subject: [PATCH] fix compiler warnings in hurd/libstore
Date: Tue, 29 Dec 2015 23:08:32 +0100
User-agent: Mutt/1.5.24 (2015-08-30)

---

libstore: Fix compiler warnings.

* libstore/decode.c (store_std_leaf_decode): Drop the type variable.
* libstore/zero.c (zero_decode): Likewise.
* libstore/file.c: Add missing casts.

diff --git a/libstore/decode.c b/libstore/decode.c
index 64405ec..4bb23c1 100644
--- a/libstore/decode.c
+++ b/libstore/decode.c
@@ -35,7 +35,7 @@ store_std_leaf_decode (struct store_enc *enc,
 {
   char *misc, *name;
   error_t err;
-  int type, flags;
+  int flags;
   mach_port_t port;
   size_t block_size, num_runs, name_len, misc_len;
   /* Call CREATE appriately from within store_with_decoded_runs.  */
@@ -49,7 +49,7 @@ store_std_leaf_decode (struct store_enc *enc,
     return EINVAL;
 
   /* Read encoded ints.  */
-  type = enc->ints[enc->cur_int++];
+  enc->cur_int++; /* Ignore type.  */
   flags = enc->ints[enc->cur_int++];
   block_size = enc->ints[enc->cur_int++];
   num_runs = enc->ints[enc->cur_int++];
diff --git a/libstore/file.c b/libstore/file.c
index 49f1c3f..ce02f1f 100644
--- a/libstore/file.c
+++ b/libstore/file.c
@@ -65,7 +65,7 @@ file_write (struct store *store,
            size_t *amount)
 {
   size_t bsize = store->block_size;
-  return io_write (store->port, buf, len, addr * bsize, amount);
+  return io_write (store->port, (void *) buf, len, addr * bsize, amount);
 }
 
 static error_t
@@ -235,7 +235,7 @@ file_byte_write (struct store *store,
                 const void *buf, size_t len,
                 size_t *amount)
 {
-  return io_write (store->port, buf, len, addr, amount);
+  return io_write (store->port, (void *) buf, len, addr, amount);
 }
 
 struct store_class
diff --git a/libstore/zero.c b/libstore/zero.c
index 2fba72c..878b227 100644
--- a/libstore/zero.c
+++ b/libstore/zero.c
@@ -103,13 +103,14 @@ zero_decode (struct store_enc *enc, const struct 
store_class *const *classes,
             struct store **store)
 {
   store_offset_t size;
-  int type, flags;
+  int flags;
 
   if (enc->cur_int + 2 > enc->num_ints
       || enc->cur_offset + 1 > enc->num_offsets)
     return EINVAL;
 
-  type = enc->ints[enc->cur_int++];
+  /* Ignore type.  */
+  enc->cur_int++;
   flags = enc->ints[enc->cur_int++];
   size = enc->offsets[enc->cur_offset++];
 



reply via email to

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