Mercurial > noffle
changeset 74:c7df2cc65cc1 noffle
[svn] Introduce UNUSED(x) macro
author | bears |
---|---|
date | Sat, 13 May 2000 16:36:35 +0100 |
parents | c874bd3c4bb8 |
children | 22b3e3dfc8c2 |
files | src/client.c src/portable.h src/server.c |
diffstat | 3 files changed, 47 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/client.c Sat May 13 16:35:17 2000 +0100 +++ b/src/client.c Sat May 13 16:36:35 2000 +0100 @@ -1,7 +1,7 @@ /* client.c - $Id: client.c 77 2000-05-13 10:53:48Z enz $ + $Id: client.c 80 2000-05-13 15:36:35Z bears $ */ #if HAVE_CONFIG_H @@ -226,6 +226,8 @@ static void connectAlarm( int sig ) { + UNUSED( sig ); + return; } @@ -260,7 +262,7 @@ return FALSE; } to = Cfg_connectTimeout(); - if ( alarm( to ) != 0 ) + if ( alarm( ( unsigned int ) to ) != 0 ) Log_err( "client.c:connectWithTimeout: Alarm was already set." ); r = connect( sock, servAddr, addrLen ); alarm( 0 );
--- a/src/portable.h Sat May 13 16:35:17 2000 +0100 +++ b/src/portable.h Sat May 13 16:36:35 2000 +0100 @@ -3,7 +3,7 @@ Compatibility checks and fallback-functions. - $Id: portable.h 61 2000-05-09 22:32:33Z uh1763 $ + $Id: portable.h 80 2000-05-13 15:36:35Z bears $ */ #ifndef PORTABLE_H @@ -32,6 +32,8 @@ #define HAVE_SNPRINTF #endif +/* Indicate deliberately unused argument. Possibly compiler specific. */ +#define UNUSED(x) { ( void ) x; } #endif
--- a/src/server.c Sat May 13 16:35:17 2000 +0100 +++ b/src/server.c Sat May 13 16:36:35 2000 +0100 @@ -1,7 +1,7 @@ /* server.c - $Id: server.c 75 2000-05-13 09:25:28Z enz $ + $Id: server.c 80 2000-05-13 15:36:35Z bears $ */ #if HAVE_CONFIG_H @@ -203,6 +203,9 @@ static Bool notImplemented( char *arg, const Cmd *cmd ) { + UNUSED( arg ); + UNUSED( cmd ); + putStat( STAT_NO_PERMISSION, "Command not implemented" ); return TRUE; } @@ -478,6 +481,8 @@ { const char *msgId; int numb; + + UNUSED( cmd ); if ( ! whichId( &msgId, &numb, arg ) ) return TRUE; @@ -502,6 +507,8 @@ { const char *msgId; int numb; + + UNUSED( cmd ); if ( ! whichId( &msgId, &numb, arg ) ) return TRUE; @@ -528,6 +535,8 @@ const char *msgId; int numb; + UNUSED( cmd ); + if ( ! whichId( &msgId, &numb, arg ) ) return TRUE; putStat( STAT_ART_FOLLOWS, "%ld %s Article", numb, msgId ); @@ -549,6 +558,9 @@ { unsigned int i; + UNUSED( arg ); + UNUSED( cmd ); + putStat( STAT_HELP_FOLLOWS, "Help" ); putTxtBuf( "\nCommands:\n\n" ); for ( i = 0; i < sizeof( commands ) / sizeof( commands[ 0 ] ); ++i ) @@ -560,6 +572,9 @@ static Bool doIhave( char *arg, const Cmd *cmd ) { + UNUSED( arg ); + UNUSED( cmd ); + putStat( STAT_ART_REJECTED, "Command not used" ); return TRUE; } @@ -569,6 +584,9 @@ { int n; + UNUSED( arg ); + UNUSED( cmd ); + if ( testGrpSelected() ) { n = server.artPtr; @@ -765,6 +783,8 @@ const Over *ov; int first, last, i; + UNUSED( cmd ); + if ( ! Grp_exists( arg ) ) putStat( STAT_NO_SUCH_GRP, "No such group" ); else @@ -784,6 +804,9 @@ static Bool doMode( char *arg, const Cmd *cmd ) { + UNUSED( arg ); + UNUSED( cmd ); + putStat( STAT_READY_POST_ALLOW, "Ok" ); return TRUE; } @@ -896,6 +919,9 @@ { int n; + UNUSED(arg); + UNUSED(cmd); + if ( testGrpSelected() ) { n = server.artPtr; @@ -1045,6 +1071,9 @@ const char* p; ItemList * newsgroups, *control; + UNUSED(arg); + UNUSED(cmd); + /* Get article and make following changes to the header: - add/replace/cut Message-ID depending on config options @@ -1445,6 +1474,9 @@ static Bool doSlave( char *arg, const Cmd *cmd ) { + UNUSED( arg ); + UNUSED( cmd ); + putStat( STAT_CMD_OK, "Ok" ); return TRUE; } @@ -1454,6 +1486,8 @@ { const char *msgId; int numb; + + UNUSED( cmd ); if ( ! whichId( &msgId, &numb, arg ) ) return TRUE; @@ -1468,6 +1502,9 @@ static Bool doQuit( char *arg, const Cmd *cmd ) { + UNUSED( arg ); + UNUSED( cmd ); + putStat( STAT_GOODBYE, "Goodbye" ); return FALSE; } @@ -1478,6 +1515,8 @@ int first, last, i, n; const Over *ov; + UNUSED( cmd ); + if ( ! testGrpSelected() ) return TRUE; parseRange( arg, &first, &last, &n );