Some gcc -W... cleanup

This commit is contained in:
Hallvard Furuseth 1998-11-05 05:47:02 +00:00
parent 6df9dcc943
commit a4411a9944
8 changed files with 42 additions and 27 deletions

View file

@ -27,6 +27,7 @@
#include "ldap.h"
#include "common.h"
int
do_abandon(
struct conn *dsaconn,
BerElement *ber,

View file

@ -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) ) );
}

View file

@ -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 <tcpd.h>
@ -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? */
)

View file

@ -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 );
}

View file

@ -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,

View file

@ -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 );

View file

@ -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];

View file

@ -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,