[or-cvs] r9688: Try to build without warnings on mingw with verbose warnings (in tor/trunk: . src/common src/or)

nickm at seul.org nickm at seul.org
Wed Feb 28 20:24:33 UTC 2007


Author: nickm
Date: 2007-02-28 15:24:27 -0500 (Wed, 28 Feb 2007)
New Revision: 9688

Modified:
   tor/trunk/
   tor/trunk/src/common/compat.c
   tor/trunk/src/common/crypto.c
   tor/trunk/src/common/util.c
   tor/trunk/src/or/eventdns.c
   tor/trunk/src/or/main.c
Log:
 r12001 at catbus:  nickm | 2007-02-28 15:24:12 -0500
 Try to build without warnings on mingw with verbose warnings on.  First attempt.



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r12001] on 8246c3cf-6607-4228-993b-4d95d33730f1

Modified: tor/trunk/src/common/compat.c
===================================================================
--- tor/trunk/src/common/compat.c	2007-02-28 20:24:23 UTC (rev 9687)
+++ tor/trunk/src/common/compat.c	2007-02-28 20:24:27 UTC (rev 9688)
@@ -713,6 +713,9 @@
   }
 
   return 0;
+#else
+  (void)user;
+  (void)group;
 #endif
 
   log_warn(LD_CONFIG,
@@ -878,7 +881,7 @@
         unsigned int leftover_mask;
         const char *plat = NULL;
         static struct {
-          int major; int minor; const char *version;
+          unsigned major; unsigned minor; const char *version;
         } win_version_table[] = {
           { 6, 0, "Windows \"Longhorn\"" },
           { 5, 2, "Windows Server 2003" },
@@ -889,7 +892,7 @@
           { 4, 10, "Windows 98" },
           /* { 4, 0, "Windows 95" } */
           { 3, 51, "Windows NT 3.51" },
-          { -1, -1, NULL }
+          { 0, 0, NULL }
         };
 #ifdef VER_SUITE_BACKOFFICE
         static struct {
@@ -924,7 +927,7 @@
           else
             plat = "Windows 95";
         } else {
-          for (i=0; win_version_table[i].major>=0; ++i) {
+          for (i=0; win_version_table[i].major>0; ++i) {
             if (win_version_table[i].major == info.dwMajorVersion &&
                 win_version_table[i].minor == info.dwMinorVersion) {
               plat = win_version_table[i].version;
@@ -1027,8 +1030,8 @@
 {
 #if defined(USE_WIN32_THREADS)
   int rv;
-  rv = _beginthread(func, 0, data);
-  if (rv == (unsigned long) -1)
+  rv = (int)_beginthread(func, 0, data);
+  if (rv == (int)-1)
     return -1;
   return 0;
 #elif defined(USE_PTHREADS)

Modified: tor/trunk/src/common/crypto.c
===================================================================
--- tor/trunk/src/common/crypto.c	2007-02-28 20:24:23 UTC (rev 9687)
+++ tor/trunk/src/common/crypto.c	2007-02-28 20:24:27 UTC (rev 9688)
@@ -1567,7 +1567,7 @@
   if (!provider_set) {
     if (!CryptAcquireContext(&provider, NULL, NULL, PROV_RSA_FULL,
                              CRYPT_VERIFYCONTEXT)) {
-      if (GetLastError() != NTE_BAD_KEYSET) {
+      if ((unsigned long)GetLastError() != (unsigned long)NTE_BAD_KEYSET) {
         log_warn(LD_CRYPTO, "Can't get CryptoAPI provider [1]");
         return rand_poll_status ? 0 : -1;
       }

Modified: tor/trunk/src/common/util.c
===================================================================
--- tor/trunk/src/common/util.c	2007-02-28 20:24:23 UTC (rev 9687)
+++ tor/trunk/src/common/util.c	2007-02-28 20:24:27 UTC (rev 9688)
@@ -2070,6 +2070,7 @@
 void
 finish_daemon(const char *cp)
 {
+  (void)cp;
 }
 #endif
 

Modified: tor/trunk/src/or/eventdns.c
===================================================================
--- tor/trunk/src/or/eventdns.c	2007-02-28 20:24:23 UTC (rev 9687)
+++ tor/trunk/src/or/eventdns.c	2007-02-28 20:24:27 UTC (rev 9688)
@@ -714,7 +714,7 @@
 			/*XXXX refactor the parts of */
 			log(EVDNS_LOG_DEBUG, "Got a SERVERFAILED from nameserver %s; "
 				"will allow the request to time out.",
-				debug_nota(req->ns->address));
+				debug_ntoa(req->ns->address));
 			break;
 		default:
 			// we got a good reply from the nameserver
@@ -2559,6 +2559,7 @@
 #ifndef HAVE_STRTOK_R
 static char *
 strtok_r(char *s, const char *delim, char **state) {
+	(void)state;
 	return strtok(s, delim);
 }
 #endif

Modified: tor/trunk/src/or/main.c
===================================================================
--- tor/trunk/src/or/main.c	2007-02-28 20:24:23 UTC (rev 9687)
+++ tor/trunk/src/or/main.c	2007-02-28 20:24:27 UTC (rev 9688)
@@ -1576,6 +1576,8 @@
     sigaction(SIGXFSZ, &action, NULL);
 #endif
   }
+#else /* MS windows */
+  (void)is_parent;
 #endif /* signal stuff */
 }
 
@@ -1739,6 +1741,20 @@
 
 #ifdef MS_WINDOWS_SERVICE
 
+/* XXXX can some/all these functions become static? without breaing NT
+ * services? */
+void nt_service_control(DWORD request);
+void nt_service_body(int argc, char **argv);
+void nt_service_main(void);
+SC_HANDLE nt_service_open_scm(void);
+SC_HANDLE nt_service_open(SC_HANDLE hSCManager);
+int nt_service_start(SC_HANDLE hService);
+int nt_service_stop(SC_HANDLE hService);
+int nt_service_install(int argc, char **argv);
+int nt_service_remove(void);
+int nt_service_cmd_start(void);
+int nt_service_cmd_stop(void);
+
 struct service_fns {
   int loaded;
 
@@ -1917,6 +1933,8 @@
 nt_service_body(int argc, char **argv)
 {
   int r;
+  (void) argc; /* unused */
+  (void) argv; /* unused */
   nt_service_loadlibrary();
   service_status.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
   service_status.dwCurrentState = SERVICE_START_PENDING;
@@ -1962,7 +1980,7 @@
   DWORD result = 0;
   char *errmsg;
   nt_service_loadlibrary();
-  table[0].lpServiceName = GENSRV_SERVICENAME;
+  table[0].lpServiceName = (char*)GENSRV_SERVICENAME;
   table[0].lpServiceProc = (LPSERVICE_MAIN_FUNCTION)nt_service_body;
   table[1].lpServiceName = NULL;
   table[1].lpServiceProc = NULL;
@@ -1988,6 +2006,7 @@
       case CMD_VERIFY_CONFIG:
         printf("Configuration was valid\n");
         break;
+      case CMD_RUN_UNITTESTS:
       default:
         log_err(LD_CONFIG, "Illegal command number %d: internal error.",
                 get_options()->command);
@@ -2285,7 +2304,7 @@
   printf("Done with CreateService.\n");
 
   /* Set the service's description */
-  sdBuff.lpDescription = GENSRV_DESCRIPTION;
+  sdBuff.lpDescription = (char*)GENSRV_DESCRIPTION;
   service_fns.ChangeServiceConfig2A_fn(hService, SERVICE_CONFIG_DESCRIPTION,
                                        &sdBuff);
   printf("Service installed successfully\n");



More information about the tor-commits mailing list