From 008eecacde9e9ec089614eca5534bb5d3a4c0104 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20Walld=C3=A9n?= <jonasw@roxen.com>
Date: Fri, 3 Oct 2014 18:22:17 +0200
Subject: [PATCH] Fix a bunch of Clang warnings.

---
 src/backend.cmod                     | 6 +++---
 src/block_allocator.c                | 3 ++-
 src/encode.c                         | 2 ++
 src/modules/_Charset/charsetmod.c    | 2 ++
 src/modules/_Charset/iso2022.c       | 2 ++
 src/modules/_Image_TIFF/image_tiff.c | 2 +-
 6 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/src/backend.cmod b/src/backend.cmod
index d4fb8197aa..9401ce4045 100644
--- a/src/backend.cmod
+++ b/src/backend.cmod
@@ -3325,7 +3325,7 @@ PIKECLASS PollDeviceBackend
   }
 
   /* arg i is the kqueue. */
-  int init_external_cfrl(struct PollDeviceBackend_struct *me, int i)
+  int init_external_cfrl(struct PollDeviceBackend_struct *me, int UNUSED(i))
   {
     /* we assume that init_cf() has already been called. */
     
@@ -4104,7 +4104,7 @@ else
   }
 
 #ifdef BACKEND_USES_CFRUNLOOP
-  void cfTimerCallback(CFRunLoopTimerRef timer, void * info)
+  void cfTimerCallback(CFRunLoopTimerRef UNUSED(timer), void * info)
   {
     struct PollDeviceBackend_struct *me;
     struct timeval timeout;
@@ -4118,7 +4118,7 @@ else
 
   /* our external CFRunLoop has received events or timed out. We should
      do a once-through the runloop to find out if there's anything to do. */
-  void cfObserverCallback(CFRunLoopObserverRef observer,
+  void cfObserverCallback(CFRunLoopObserverRef UNUSED(observer),
       CFRunLoopActivity activity, void* info)
   {
     struct timeval timeout;
diff --git a/src/block_allocator.c b/src/block_allocator.c
index b851b15d47..948b3bd036 100644
--- a/src/block_allocator.c
+++ b/src/block_allocator.c
@@ -444,7 +444,8 @@ static void __attribute((unused)) bv_print(struct bitvector * bv) {
 }
 #endif
 
-static void ba_sort_free_list(const struct block_allocator *a, struct ba_page *p,
+static void ba_sort_free_list(const struct block_allocator *VALGRINDUSED(a),
+			      struct ba_page *p,
                               const struct ba_layout *l) {
     struct bitvector v;
     size_t i, j;
diff --git a/src/encode.c b/src/encode.c
index 09627c65a8..1ae69c5111 100644
--- a/src/encode.c
+++ b/src/encode.c
@@ -209,6 +209,8 @@ static void encode_value2(struct svalue *val, struct encode_data *data, int forc
            addstr( (char *)&s, sizeof(s));	\
         }					\
         break;					\
+       case 0: /* Silence clang warning */	\
+        break;					\
     }
 #endif
 
diff --git a/src/modules/_Charset/charsetmod.c b/src/modules/_Charset/charsetmod.c
index b10af2f98c..73cd40c7d6 100644
--- a/src/modules/_Charset/charsetmod.c
+++ b/src/modules/_Charset/charsetmod.c
@@ -353,6 +353,8 @@ static void f_drain_rfc1345(INT32 args)
 	}
       }
       break;
+    case 0: /* Dummy case to silence clang warning */
+      break;
     }
   }
   f_drain(args);
diff --git a/src/modules/_Charset/iso2022.c b/src/modules/_Charset/iso2022.c
index 61aa61319e..d85f3b5f49 100644
--- a/src/modules/_Charset/iso2022.c
+++ b/src/modules/_Charset/iso2022.c
@@ -1320,6 +1320,8 @@ static void f_drain(INT32 args)
 	}
       }
       break;
+    case 0: /* Dummy case to silence clang warning */
+      break;
     }
   }
 
diff --git a/src/modules/_Image_TIFF/image_tiff.c b/src/modules/_Image_TIFF/image_tiff.c
index aed221a893..c13b875426 100644
--- a/src/modules/_Image_TIFF/image_tiff.c
+++ b/src/modules/_Image_TIFF/image_tiff.c
@@ -223,7 +223,7 @@ static int map_buffer(thandle_t bh, tdata_t *r, toff_t *len )
 }
 
 /* Complies with the TIFFUnmapFileProc API. */
-static void unmap_buffer(thandle_t bh, tdata_t p, toff_t len)
+static void unmap_buffer(thandle_t bh, tdata_t p, toff_t UNUSED(len))
 {
   struct buffer *buffer_handle = (struct buffer *)bh;
   void *ptr = (void *)p;
-- 
GitLab