Mercurial > noffle
diff src/client.c @ 271:3477050e8d10 noffle
[svn] * src/client.c,src/fetch.c,src/lock.c.src/protocol.c,src/util.h,src/util.c:
Define our own SignalHandler type rather than use the rather
Linux-specific (and potentially glibc version specific) sig_t.
* src/client.c,src/database.h,src/database.c,src/over.h,src/over.c,
src/pseudo.c,src/server.c: Ensure format string specifiers and passed
data types match. As part of this, change some uses of size_t as a
general data type to an appropriate base C type. Database status changes
from int to unsigned.
author | bears |
---|---|
date | Sun, 10 Nov 2002 11:32:17 +0000 |
parents | f049f8639dc0 |
children | 9c54bf672ca1 |
line wrap: on
line diff
--- a/src/client.c Sun Nov 10 11:30:40 2002 +0000 +++ b/src/client.c Sun Nov 10 11:32:17 2002 +0000 @@ -1,7 +1,7 @@ /* client.c - $Id: client.c 400 2002-10-08 13:52:52Z bears $ + $Id: client.c 403 2002-11-10 11:32:17Z bears $ */ #if HAVE_CONFIG_H @@ -226,11 +226,11 @@ connectWithTimeout( int sock, const struct sockaddr *servAddr, socklen_t addrLen ) { - sig_t oldHandler; + SignalHandler oldHandler; int r, to; oldHandler = Utl_installSignalHandler( SIGALRM, connectAlarm ); - if ( oldHandler == SIG_ERR ) + if ( oldHandler == (SignalHandler) SIG_ERR ) { Log_err( "client.c:connectWithTimeout: signal failed." ); return FALSE; @@ -293,14 +293,14 @@ { *pColon = '\0'; strcpy( host, pStart ); - if ( sscanf( pColon + 1, "%hi", &port ) != 1 ) + if ( sscanf( pColon + 1, "%hu", &port ) != 1 ) { Log_err( "Syntax error in server name: '%s'", serv ); return FALSE;; } if ( port <= 0 || port > 65535 ) { - Log_err( "Invalid port number %hi. Must be in [1, 65535]", port ); + Log_err( "Invalid port number %hu. Must be in [1, 65535]", port ); return FALSE;; } } @@ -701,7 +701,7 @@ static const char * readField( Str result, const char *p ) { - size_t len; + int len; char *r; if ( ! p ) @@ -731,7 +731,8 @@ static Bool parseOvLn( Str line, int *numb, Str subj, Str from, - Str date, Str msgId, Str ref, size_t *bytes, size_t *lines ) + Str date, Str msgId, Str ref, + unsigned long *bytes, unsigned long *lines ) { const char *p; Str t; @@ -747,10 +748,10 @@ p = readField( t, p ); *bytes = 0; *lines = 0; - if ( sscanf( t, "%d", bytes ) != 1 ) + if ( sscanf( t, "%lu", bytes ) != 1 ) return TRUE; p = readField( t, p ); - if ( sscanf( t, "%d", lines ) != 1 ) + if ( sscanf( t, "%lu", lines ) != 1 ) return TRUE; return TRUE; } @@ -789,7 +790,7 @@ { Bool interesting, result; const char *msgId; - int status; + unsigned status; time_t lastAccess, nowTime; double threadFollowTime, maxTime, timeSinceLastAccess; ItemList *itl; @@ -888,7 +889,7 @@ int Client_getOver( const char *grp, int rmtFirst, int rmtLast, FetchMode mode ) { - size_t nbytes, nlines; + unsigned long nbytes, nlines; int rmtNumb, groupsNumb, oldLast, cntMarked; Over *ov; Str line, subj, from, date, msgId, ref, groups; @@ -1024,7 +1025,7 @@ static void retrievingFailed( const char* msgId, const char *reason ) { - int status; + unsigned status; ASSERT( ! Lock_gotLock() ); Log_err( "Retrieving of %s failed: %s", msgId, reason );