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

[or-cvs] Fix some more obscure compiler warnings



Update of /home/or/cvsroot/tor/src/or
In directory moria.mit.edu:/tmp/cvs-serv8831/src/or

Modified Files:
	config.c directory.c main.c 
Log Message:
Fix some more obscure compiler warnings

Index: config.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/config.c,v
retrieving revision 1.323
retrieving revision 1.324
diff -u -d -r1.323 -r1.324
--- config.c	12 Mar 2005 20:16:52 -0000	1.323
+++ config.c	14 Mar 2005 03:28:46 -0000	1.324
@@ -317,7 +317,7 @@
   add_callback_log(LOG_NOTICE, LOG_ERR, control_event_logmsg);
 
   options->_ConnLimit =
-    set_max_file_descriptors(options->ConnLimit, MAXCONNECTIONS);
+    set_max_file_descriptors((unsigned)options->ConnLimit, MAXCONNECTIONS);
   if (options->_ConnLimit < 0)
     return -1;
 
@@ -1183,7 +1183,7 @@
 }
 
 static int
-validate_ports_csv(smartlist_t *sl, char *name) {
+validate_ports_csv(smartlist_t *sl, const char *name) {
   int i;
   int result = 0;
   tor_assert(name);
@@ -1319,6 +1319,12 @@
     result = -1;
   }
 
+  if (options->ConnLimit <= 0) {
+    log(LOG_WARN, "ConnLimit must be greater than 0, but was set to %d",
+        options->ConnLimit);
+    result = -1;
+  }
+
   if (options->_AccountingMaxKB) {
     log(LOG_WARN, "AccountingMaxKB is deprecated.  Say 'AccountingMax %d KB' instead.", options->_AccountingMaxKB);
     options->AccountingMax = U64_LITERAL(1024)*options->_AccountingMaxKB;

Index: directory.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/directory.c,v
retrieving revision 1.216
retrieving revision 1.217
diff -u -d -r1.216 -r1.217
--- directory.c	27 Feb 2005 09:47:00 -0000	1.216
+++ directory.c	14 Mar 2005 03:28:46 -0000	1.217
@@ -28,10 +28,6 @@
  *   connection_finished_connecting() in connection.c
  */
 
-void
-directory_initiate_command_router(routerinfo_t *router, uint8_t purpose,
-                                  int private_connection, const char *resource,
-                                  const char *payload, size_t payload_len);
 static void
 directory_initiate_command_trusted_dir(trusted_dir_server_t *dirserv,
                                       uint8_t purpose, int private_connection,
@@ -50,6 +46,7 @@
                        const char *payload, size_t payload_len);
 static int directory_handle_command(connection_t *conn);
 static int body_is_plausible(const char *body, size_t body_len, int purpose);
+static int purpose_is_private(uint8_t purpose);
 
 /********* START VARIABLES **********/
 
@@ -112,7 +109,8 @@
   return 0;
 }
 
-int purpose_is_private(uint8_t purpose) {
+static int
+purpose_is_private(uint8_t purpose) {
   if (purpose == DIR_PURPOSE_FETCH_DIR ||
       purpose == DIR_PURPOSE_UPLOAD_DIR ||
       purpose == DIR_PURPOSE_FETCH_RUNNING_LIST)

Index: main.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/main.c,v
retrieving revision 1.458
retrieving revision 1.459
diff -u -d -r1.458 -r1.459
--- main.c	14 Mar 2005 03:18:35 -0000	1.458
+++ main.c	14 Mar 2005 03:28:46 -0000	1.459
@@ -40,6 +40,7 @@
 static void signal_callback(int fd, short events, void *arg);
 static void second_elapsed_callback(int fd, short event, void *args);
 static int conn_close_if_marked(int i);
+void tor_free_all(void);
 
 /********* START VARIABLES **********/