r12001@catbus: nickm | 2007-02-28 15:24:12 -0500

Try to build without warnings on mingw with verbose warnings on.  First attempt.


svn:r9688
This commit is contained in:
Nick Mathewson 2007-02-28 20:24:27 +00:00
parent 3008c3b768
commit f38240435a
5 changed files with 33 additions and 9 deletions

View file

@ -713,6 +713,9 @@ switch_id(const char *user, const char *group)
} }
return 0; return 0;
#else
(void)user;
(void)group;
#endif #endif
log_warn(LD_CONFIG, log_warn(LD_CONFIG,
@ -878,7 +881,7 @@ get_uname(void)
unsigned int leftover_mask; unsigned int leftover_mask;
const char *plat = NULL; const char *plat = NULL;
static struct { static struct {
int major; int minor; const char *version; unsigned major; unsigned minor; const char *version;
} win_version_table[] = { } win_version_table[] = {
{ 6, 0, "Windows \"Longhorn\"" }, { 6, 0, "Windows \"Longhorn\"" },
{ 5, 2, "Windows Server 2003" }, { 5, 2, "Windows Server 2003" },
@ -889,7 +892,7 @@ get_uname(void)
{ 4, 10, "Windows 98" }, { 4, 10, "Windows 98" },
/* { 4, 0, "Windows 95" } */ /* { 4, 0, "Windows 95" } */
{ 3, 51, "Windows NT 3.51" }, { 3, 51, "Windows NT 3.51" },
{ -1, -1, NULL } { 0, 0, NULL }
}; };
#ifdef VER_SUITE_BACKOFFICE #ifdef VER_SUITE_BACKOFFICE
static struct { static struct {
@ -924,7 +927,7 @@ get_uname(void)
else else
plat = "Windows 95"; plat = "Windows 95";
} else { } 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 && if (win_version_table[i].major == info.dwMajorVersion &&
win_version_table[i].minor == info.dwMinorVersion) { win_version_table[i].minor == info.dwMinorVersion) {
plat = win_version_table[i].version; plat = win_version_table[i].version;
@ -1027,8 +1030,8 @@ spawn_func(void (*func)(void *), void *data)
{ {
#if defined(USE_WIN32_THREADS) #if defined(USE_WIN32_THREADS)
int rv; int rv;
rv = _beginthread(func, 0, data); rv = (int)_beginthread(func, 0, data);
if (rv == (unsigned long) -1) if (rv == (int)-1)
return -1; return -1;
return 0; return 0;
#elif defined(USE_PTHREADS) #elif defined(USE_PTHREADS)

View file

@ -1567,7 +1567,7 @@ crypto_seed_rng(void)
if (!provider_set) { if (!provider_set) {
if (!CryptAcquireContext(&provider, NULL, NULL, PROV_RSA_FULL, if (!CryptAcquireContext(&provider, NULL, NULL, PROV_RSA_FULL,
CRYPT_VERIFYCONTEXT)) { 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]"); log_warn(LD_CRYPTO, "Can't get CryptoAPI provider [1]");
return rand_poll_status ? 0 : -1; return rand_poll_status ? 0 : -1;
} }

View file

@ -2070,6 +2070,7 @@ start_daemon(void)
void void
finish_daemon(const char *cp) finish_daemon(const char *cp)
{ {
(void)cp;
} }
#endif #endif

View file

@ -714,7 +714,7 @@ reply_handle(struct request *const req, u16 flags, u32 ttl, struct reply *reply)
/*XXXX refactor the parts of */ /*XXXX refactor the parts of */
log(EVDNS_LOG_DEBUG, "Got a SERVERFAILED from nameserver %s; " log(EVDNS_LOG_DEBUG, "Got a SERVERFAILED from nameserver %s; "
"will allow the request to time out.", "will allow the request to time out.",
debug_nota(req->ns->address)); debug_ntoa(req->ns->address));
break; break;
default: default:
// we got a good reply from the nameserver // we got a good reply from the nameserver
@ -2559,6 +2559,7 @@ evdns_resolv_set_defaults(int flags) {
#ifndef HAVE_STRTOK_R #ifndef HAVE_STRTOK_R
static char * static char *
strtok_r(char *s, const char *delim, char **state) { strtok_r(char *s, const char *delim, char **state) {
(void)state;
return strtok(s, delim); return strtok(s, delim);
} }
#endif #endif

View file

@ -1576,6 +1576,8 @@ handle_signals(int is_parent)
sigaction(SIGXFSZ, &action, NULL); sigaction(SIGXFSZ, &action, NULL);
#endif #endif
} }
#else /* MS windows */
(void)is_parent;
#endif /* signal stuff */ #endif /* signal stuff */
} }
@ -1739,6 +1741,20 @@ do_hash_password(void)
#ifdef MS_WINDOWS_SERVICE #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 { struct service_fns {
int loaded; int loaded;
@ -1917,6 +1933,8 @@ void
nt_service_body(int argc, char **argv) nt_service_body(int argc, char **argv)
{ {
int r; int r;
(void) argc; /* unused */
(void) argv; /* unused */
nt_service_loadlibrary(); nt_service_loadlibrary();
service_status.dwServiceType = SERVICE_WIN32_OWN_PROCESS; service_status.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
service_status.dwCurrentState = SERVICE_START_PENDING; service_status.dwCurrentState = SERVICE_START_PENDING;
@ -1962,7 +1980,7 @@ nt_service_main(void)
DWORD result = 0; DWORD result = 0;
char *errmsg; char *errmsg;
nt_service_loadlibrary(); nt_service_loadlibrary();
table[0].lpServiceName = GENSRV_SERVICENAME; table[0].lpServiceName = (char*)GENSRV_SERVICENAME;
table[0].lpServiceProc = (LPSERVICE_MAIN_FUNCTION)nt_service_body; table[0].lpServiceProc = (LPSERVICE_MAIN_FUNCTION)nt_service_body;
table[1].lpServiceName = NULL; table[1].lpServiceName = NULL;
table[1].lpServiceProc = NULL; table[1].lpServiceProc = NULL;
@ -1988,6 +2006,7 @@ nt_service_main(void)
case CMD_VERIFY_CONFIG: case CMD_VERIFY_CONFIG:
printf("Configuration was valid\n"); printf("Configuration was valid\n");
break; break;
case CMD_RUN_UNITTESTS:
default: default:
log_err(LD_CONFIG, "Illegal command number %d: internal error.", log_err(LD_CONFIG, "Illegal command number %d: internal error.",
get_options()->command); get_options()->command);
@ -2285,7 +2304,7 @@ nt_service_install(int argc, char **argv)
printf("Done with CreateService.\n"); printf("Done with CreateService.\n");
/* Set the service's description */ /* Set the service's description */
sdBuff.lpDescription = GENSRV_DESCRIPTION; sdBuff.lpDescription = (char*)GENSRV_DESCRIPTION;
service_fns.ChangeServiceConfig2A_fn(hService, SERVICE_CONFIG_DESCRIPTION, service_fns.ChangeServiceConfig2A_fn(hService, SERVICE_CONFIG_DESCRIPTION,
&sdBuff); &sdBuff);
printf("Service installed successfully\n"); printf("Service installed successfully\n");