From c822442544cf31a8cda014b77364ceeb883b1d66 Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Wed, 7 Sep 2011 09:37:33 +0000 Subject: [PATCH] Fix compiler warnings in the textclient by evaluating returnvalues and removing unused code. --- citadel/textclient/citadel.c | 23 +++++++++++------------ citadel/utillib/citadel_ipc.c | 11 +++-------- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/citadel/textclient/citadel.c b/citadel/textclient/citadel.c index 19f46ca57..622bed1c8 100644 --- a/citadel/textclient/citadel.c +++ b/citadel/textclient/citadel.c @@ -320,8 +320,6 @@ void remove_march(char *roomname, int floornum) char *pop_march(int desired_floor, struct march *_march) { static char TheRoom[ROOMNAMELEN]; - int TheFloor = 0; - int TheOrder = 32767; int TheWeight = 0; int weight; struct march *mptr = NULL; @@ -343,8 +341,6 @@ char *pop_march(int desired_floor, struct march *_march) if (weight > TheWeight) { TheWeight = weight; strcpy(TheRoom, mptr->march_name); - TheFloor = mptr->march_floor; - TheOrder = mptr->march_order; } } return (TheRoom); @@ -514,6 +510,9 @@ void dotgoto(CtdlIPC *ipc, char *towhere, int display_name, int fromungoto) color(DIM_WHITE); if (!IsEmptyStr(rc_gotmail_cmd)) { rv = system(rc_gotmail_cmd); + if (rv) + scr_printf("*** failed to check for mail calling %s Reason %d.\n", + rc_gotmail_cmd, rv); } } free(room); @@ -537,14 +536,13 @@ void gotonext(CtdlIPC *ipc) char buf[SIZ]; struct march *mptr, *mptr2; char next_room[ROOMNAMELEN]; - int r; /* IPC response code */ /* Check to see if the march-mode list is already allocated. * If it is, pop the first room off the list and go there. */ if (marchptr == NULL) { - r = CtdlIPCKnownRooms(ipc, SubscribedRoomsWithNewMessages, - AllFloors, &marchptr, buf); + CtdlIPCKnownRooms(ipc, SubscribedRoomsWithNewMessages, + AllFloors, &marchptr, buf); /* add _BASEROOM_ to the end of the march list, so the user will end up * in the system base room (usually the Lobby>) at the end of the loop @@ -1000,10 +998,9 @@ void system_info(CtdlIPC *ipc) int mrtg_users, mrtg_active_users; char mrtg_server_uptime[40]; long mrtg_himessage; - int ret; /* IPC response code */ /* get #users, #active & server uptime */ - ret = CtdlIPCGenericCommand(ipc, "MRTG|users", NULL, 0, &resp, &bytes, buf); + CtdlIPCGenericCommand(ipc, "MRTG|users", NULL, 0, &resp, &bytes, buf); mrtg_users = extract_int(resp, 0); remove_token(resp, 0, '\n'); mrtg_active_users = extract_int(resp, 0); @@ -1013,7 +1010,7 @@ void system_info(CtdlIPC *ipc) resp = NULL; /* get high message# */ - ret = CtdlIPCGenericCommand(ipc, "MRTG|messages", NULL, 0, &resp, &bytes, buf); + CtdlIPCGenericCommand(ipc, "MRTG|messages", NULL, 0, &resp, &bytes, buf); mrtg_himessage = extract_long(resp, 0); free(resp); resp = NULL; @@ -1442,7 +1439,6 @@ int main(int argc, char **argv) char *telnet_client_host = NULL; char *sptr, *sptr2; /* USed to extract the nonce */ char hexstring[MD5_HEXSTRING_SIZE]; - int stored_password = 0; char password[SIZ]; struct ctdlipcmisc chek; struct ctdluser *myself = NULL; @@ -1652,7 +1648,6 @@ int main(int argc, char **argv) if (r / 100 == 2) { load_user_info(aaa); - stored_password = 1; goto PWOK; } else { set_stored_password(hostbuf, portbuf, "", ""); @@ -1781,6 +1776,10 @@ NEWUSR: if (IsEmptyStr(rc_password)) { color(DIM_WHITE); if (!IsEmptyStr(rc_gotmail_cmd)) { rv = system(rc_gotmail_cmd); + if (rv) + scr_printf("*** failed to check for mail calling %s Reason %d.\n", + rc_gotmail_cmd, rv); + } } if ((axlevel >= AxAideU) && (chek.needvalid > 0)) { diff --git a/citadel/utillib/citadel_ipc.c b/citadel/utillib/citadel_ipc.c index 52da9167e..41b5a3877 100644 --- a/citadel/utillib/citadel_ipc.c +++ b/citadel/utillib/citadel_ipc.c @@ -2493,15 +2493,10 @@ int CtdlIPCGenericCommand(CtdlIPC *ipc, { char buf[SIZ]; register int ret; - int watch_ssl = 0; if (!command) return -2; if (!proto_response) return -2; -#ifdef HAVE_OPENSSL - if (ipc->ssl) watch_ssl = 1; -#endif - CtdlIPC_lock(ipc); CtdlIPC_putline(ipc, command); while (1) { @@ -2866,7 +2861,7 @@ static void ssl_lock(int mode, int n, const char *file, int line) static void CtdlIPC_init_OpenSSL(void) { int a; - SSL_METHOD *ssl_method; + const SSL_METHOD *ssl_method; DH *dh; /* already done init */ @@ -2956,7 +2951,7 @@ int ReadNetworkChunk(CtdlIPC* ipc) { fd_set read_fd; - int tries; +/* int tries;*/ int ret = 0; int err = 0; struct timeval tv; @@ -2964,7 +2959,7 @@ ReadNetworkChunk(CtdlIPC* ipc) tv.tv_sec = 1; tv.tv_usec = 1000; - tries = 0; + /*tries = 0; */ n = 0; while (1) { -- 2.30.2