[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] Add a new warning to our "warn a lot" list: unused paramete...



Update of /home/or/cvsroot/tor/src/common
In directory moria:/tmp/cvs-serv18936/src/common

Modified Files:
	compat.c crypto.c util.c 
Log Message:
Add a new warning to our "warn a lot" list: unused parameters.  This means we have to explicitly "use" unuseds, but it can catch bugs.  (It caught two coding mistakes so far.)

Index: compat.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/common/compat.c,v
retrieving revision 1.88
retrieving revision 1.89
diff -u -p -d -r1.88 -r1.89
--- compat.c	3 Jun 2006 21:41:14 -0000	1.88
+++ compat.c	4 Jun 2006 22:42:12 -0000	1.89
@@ -160,6 +160,7 @@ void
 tor_munmap_file(const char *memory, size_t size)
 {
   char *mem = (char*) memory;
+  (void)size;
   tor_free(mem);
 }
 #endif

Index: crypto.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/common/crypto.c,v
retrieving revision 1.191
retrieving revision 1.192
diff -u -p -d -r1.191 -r1.192
--- crypto.c	24 May 2006 00:37:38 -0000	1.191
+++ crypto.c	4 Jun 2006 22:42:12 -0000	1.192
@@ -1802,6 +1802,8 @@ secret_to_key(char *key_out, size_t key_
 static void
 _openssl_locking_cb(int mode, int n, const char *file, int line)
 {
+  (void)file;
+  (void)line;
   if (!_openssl_mutexes)
     /* This is not a really good  fix for the
      * "release-freed-lock-from-separate-thread-on-shutdown" problem, but

Index: util.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/common/util.c,v
retrieving revision 1.258
retrieving revision 1.259
diff -u -p -d -r1.258 -r1.259
--- util.c	26 May 2006 13:51:45 -0000	1.258
+++ util.c	4 Jun 2006 22:42:12 -0000	1.259
@@ -950,6 +950,8 @@ clean_name_for_stat(char *name)
       return;
     name[len-1]='\0';
   }
+#else
+  (void)name;
 #endif
 }