From a4411a9944c8e96fb1fe17f70f3e87f9d6003e68 Mon Sep 17 00:00:00 2001 From: Hallvard Furuseth Date: Thu, 5 Nov 1998 05:47:02 +0000 Subject: [PATCH] Some gcc -W... cleanup --- servers/ldapd/abandon.c | 1 + servers/ldapd/association.c | 3 ++- servers/ldapd/main.c | 22 +++++++++++++--------- servers/ldapd/message.c | 4 ++-- servers/ldapd/modify.c | 3 ++- servers/ldapd/request.c | 4 ++-- servers/ldapd/search.c | 17 ++++++++++------- servers/ldapd/syntax.c | 15 ++++++++++----- 8 files changed, 42 insertions(+), 27 deletions(-) diff --git a/servers/ldapd/abandon.c b/servers/ldapd/abandon.c index 899bf3f449..22960c0277 100644 --- a/servers/ldapd/abandon.c +++ b/servers/ldapd/abandon.c @@ -27,6 +27,7 @@ #include "ldap.h" #include "common.h" +int do_abandon( struct conn *dsaconn, BerElement *ber, diff --git a/servers/ldapd/association.c b/servers/ldapd/association.c index a24871b7db..1af91e2588 100644 --- a/servers/ldapd/association.c +++ b/servers/ldapd/association.c @@ -220,7 +220,8 @@ conn_add( struct conn *new ) conns = new; } -static psap_cmp( struct PSAPaddr *a, struct PSAPaddr *b ) +static int +psap_cmp( struct PSAPaddr *a, struct PSAPaddr *b ) { return( bcmp( (char *) a, (char *) b, sizeof(struct PSAPaddr) ) ); } diff --git a/servers/ldapd/main.c b/servers/ldapd/main.c index 0d7933d202..9ef964106c 100644 --- a/servers/ldapd/main.c +++ b/servers/ldapd/main.c @@ -40,6 +40,7 @@ #include "../../libraries/liblber/lber-int.h" /* get struct sockbuf */ #include "ldap.h" #include "common.h" +#include "lutil.h" /* Get lutil_detach() */ #ifdef HAVE_TCPD #include @@ -49,11 +50,11 @@ int deny_severity = LOG_NOTICE; #endif /* TCP_WRAPPERS */ void log_and_exit(); -static set_socket(); -static do_queries(); +static int set_socket(); +static void do_queries(); static RETSIGTYPE wait4child(); #ifdef LDAP_CONNECTIONLESS -static udp_init(); +static int udp_init(); #endif #ifdef LDAP_DEBUG @@ -84,8 +85,8 @@ int RunFromInetd = 0; extern char Versionstr[]; -static usage( name ) -char *name; +static void +usage( char *name ) { fprintf( stderr, "usage: %s [-d debuglvl] [-p port] [-l] [-c dsa] [-r referraltimeout]", name ); #ifdef LDAP_CONNECTIONLESS @@ -100,6 +101,7 @@ char *name; fprintf( stderr, "\n" ); } +int main (argc, argv) int argc; char **argv; @@ -306,7 +308,7 @@ char **argv; (void) get_syntaxes(); if (RunFromInetd) { len = sizeof( socktype ); - getsockopt( ns, SOL_SOCKET, SO_TYPE, &socktype, &len ); + getsockopt( ns, SOL_SOCKET, SO_TYPE, (char *)&socktype, &len ); if ( socktype == SOCK_DGRAM ) { #ifdef LDAP_CONNECTIONLESS Debug( LDAP_DEBUG_ARGS, @@ -489,14 +491,14 @@ char **argv; /* NOT REACHED */ } -static +static void do_queries( int clientsock, int udp /* is this a UDP (CLDAP) request? */ ) { fd_set readfds; - int rc, i; + int rc; struct timeval timeout; Sockbuf sb; #ifdef LDAP_CONNECTIONLESS @@ -545,6 +547,7 @@ do_queries( #ifdef LDAP_DEBUG if ( ldap_debug & LDAP_DEBUG_CONNS ) { + int i; Debug( LDAP_DEBUG_CONNS, "FDLIST:", 0, 0, 0 ); for ( i = 0; i < dtblsize; i++ ) { if ( FD_ISSET( i, &readfds ) ) { @@ -603,7 +606,8 @@ do_queries( /* NOT REACHED */ } -static set_socket( +static int +set_socket( int port, int udp /* UDP port? */ ) diff --git a/servers/ldapd/message.c b/servers/ldapd/message.c index 4456295c2e..228e29272c 100644 --- a/servers/ldapd/message.c +++ b/servers/ldapd/message.c @@ -96,8 +96,8 @@ del_msg( struct msg *m ) } if ( cur == NULL ) { - Debug( LDAP_DEBUG_ANY, "delmsg: cannot find msg %x\n", m, - 0, 0 ); + Debug( LDAP_DEBUG_ANY, "delmsg: cannot find msg %lx\n", + (unsigned long) m, 0, 0 ); return( -1 ); } diff --git a/servers/ldapd/modify.c b/servers/ldapd/modify.c index 6ce4474e7e..dd4538c034 100644 --- a/servers/ldapd/modify.c +++ b/servers/ldapd/modify.c @@ -43,6 +43,7 @@ extern short ldap_rts_cred_syntax; extern short ldap_rtl_syntax; extern short ldap_octetstring_syntax; +static int replace_mod( struct entrymod *, Attr_Sequence, Attr_Sequence ); #ifdef LDAP_COMPAT20 extern int ldap_compat; @@ -522,7 +523,7 @@ modlist_free( LDAPMod *mods ) * that are not in the new set and by only adding what isn't in old set */ -int +static int replace_mod( struct entrymod *rem, Attr_Sequence oas, diff --git a/servers/ldapd/request.c b/servers/ldapd/request.c index 4e93a853c6..fd33fc2545 100644 --- a/servers/ldapd/request.c +++ b/servers/ldapd/request.c @@ -135,8 +135,8 @@ client_request( ttag = ber_skip_tag( &tber, &tlen ); ttag = ber_peek_tag( &tber, &tlen ); - Debug( LDAP_DEBUG_ANY, "checking for 3.0 tag 0x%x\n", - ttag, 0, 0 ); + Debug( LDAP_DEBUG_ANY, "checking for 3.0 tag 0x%lx\n", + ttag, 0, 0 ); if ( ttag == LBER_SEQUENCE ) { Debug( LDAP_DEBUG_ANY, "version 3.0 detected\n", 0, 0, 0 ); diff --git a/servers/ldapd/search.c b/servers/ldapd/search.c index 03d995c1c7..30d9141e28 100644 --- a/servers/ldapd/search.c +++ b/servers/ldapd/search.c @@ -29,9 +29,9 @@ #include "ldap.h" #include "common.h" -static get_filter(); -static get_filter_list(); -static get_substring_filter(); +static int get_filter(); +static int get_filter_list(); +static int get_substring_filter(); #ifdef LDAP_COMPAT extern int version; @@ -206,7 +206,8 @@ do_search( return( 1 ); } -static get_filter( BerElement *ber, Filter *filt ) +static int +get_filter( BerElement *ber, Filter *filt ) { unsigned long tag, len; int err; @@ -375,7 +376,7 @@ static get_filter( BerElement *ber, Filter *filt ) break; default: - Debug( LDAP_DEBUG_ANY, "unknown filter type %d\n", tag, 0, 0 ); + Debug( LDAP_DEBUG_ANY, "unknown filter type %lu\n", tag, 0, 0 ); free( f ); return( LDAP_PROTOCOL_ERROR ); break; @@ -385,7 +386,8 @@ static get_filter( BerElement *ber, Filter *filt ) return( err ); } -static get_filter_list( BerElement *ber, Filter f ) +static int +get_filter_list( BerElement *ber, Filter f ) { Filter new, tail; int err; @@ -416,7 +418,8 @@ static get_filter_list( BerElement *ber, Filter f ) return( 0 ); } -static get_substring_filter( BerElement *ber, Filter f ) +static int +get_substring_filter( BerElement *ber, Filter f ) { unsigned long tag, len; char typestr[64]; diff --git a/servers/ldapd/syntax.c b/servers/ldapd/syntax.c index d324caf39d..806968c236 100644 --- a/servers/ldapd/syntax.c +++ b/servers/ldapd/syntax.c @@ -57,7 +57,8 @@ short ldap_dLSubmitPermission_syntax; static void de_t61( char *s, int t61mark ); static int syntax_is_string( short syntax ); -static get_one_syntax( char *attrib, int required ) +static int +get_one_syntax( char *attrib, int required ) { oid_table_attr *p, *name2attr(); @@ -337,7 +338,8 @@ encode_dn( return( rc ); } -static put_jpeg_value( BerElement *ber, AttributeValue av ) +static int +put_jpeg_value( BerElement *ber, AttributeValue av ) { PE pe; int len; @@ -380,7 +382,8 @@ static put_jpeg_value( BerElement *ber, AttributeValue av ) return( 0 ); } -static put_audio_value( BerElement *ber, AttributeValue av ) +static int +put_audio_value( BerElement *ber, AttributeValue av ) { struct qbuf *qb, *p; int rc, len; @@ -417,7 +420,8 @@ static put_audio_value( BerElement *ber, AttributeValue av ) return( rc ); } -static put_photo_value( BerElement *ber, AttributeValue av ) +static int +put_photo_value( BerElement *ber, AttributeValue av ) { PE pe; PS ps; @@ -479,7 +483,8 @@ static put_photo_value( BerElement *ber, AttributeValue av ) return( 0 ); } -static put_values( +static int +put_values( BerElement *ber, PS ps, short syntax, -- 2.39.5