Some gcc -W... cleanup

This commit is contained in:
Hallvard Furuseth 1998-11-05 07:31:40 +00:00
parent 853a1371d1
commit 177367bdb1
9 changed files with 23 additions and 27 deletions

View file

@ -28,7 +28,7 @@
#include "globals.h"
static int
static void
usage( char *name )
{
fprintf( stderr, "usage: %s\t[-d debug-level] [-s syslog-level]\n", name );

View file

@ -36,7 +36,7 @@ ch_malloc(
char *new;
if ( (new = (char *) malloc( size )) == NULL ) {
fprintf( stderr, "malloc of %d bytes failed\n", size );
fprintf( stderr, "malloc of %lu bytes failed\n", size );
exit( 1 );
}
@ -63,7 +63,7 @@ ch_realloc(
}
if ( (new = (char *) realloc( block, size )) == NULL ) {
fprintf( stderr, "realloc of %d bytes failed\n", size );
fprintf( stderr, "realloc of %lu bytes failed\n", size );
exit( 1 );
}
@ -86,7 +86,7 @@ ch_calloc(
char *new;
if ( (new = (char *) calloc( nelem, size )) == NULL ) {
fprintf( stderr, "calloc of %d elems of %d bytes failed\n",
fprintf( stderr, "calloc of %lu elems of %lu bytes failed\n",
nelem, size );
exit( 1 );
}

View file

@ -21,6 +21,7 @@
#include <ac/string.h>
#include <ac/socket.h>
#include <ac/ctype.h>
#include <lber.h>
#include <ldap.h>
@ -53,8 +54,7 @@ slurpd_read_config(
)
{
FILE *fp;
char buf[BUFSIZ];
char *line, *p;
char *line;
int cargc;
char *cargv[MAXARGS];
@ -227,7 +227,7 @@ getline(
*p = '\0';
}
lineno++;
if ( ! isspace( buf[0] ) ) {
if ( ! isspace( (unsigned char) buf[0] ) ) {
return( line );
}

View file

@ -20,6 +20,7 @@
#include <ac/errno.h>
#include <ac/string.h>
#include <ac/ctype.h>
#include <ac/time.h>
#include <ac/krb.h>
@ -30,7 +31,6 @@
#include "slurp.h"
/* Forward references */
static int get_changetype LDAP_P(( char * ));
static struct berval **make_singlevalued_berval LDAP_P(( char *, int ));
static int op_ldap_add LDAP_P(( Ri *, Re *, char ** ));
static int op_ldap_modify LDAP_P(( Ri *, Re *, char ** ));
@ -75,7 +75,6 @@ do_ldap(
int rc = 0;
int lderr = LDAP_SUCCESS;
int retry = 2;
char *msg;
*errmsg = NULL;
@ -224,7 +223,7 @@ op_ldap_modify(
int state; /* This code is a simple-minded state machine */
int nvals; /* Number of values we're modifying */
int nops; /* Number of LDAPMod structs in ldmarr */
LDAPMod *ldm, *nldm, **ldmarr;
LDAPMod *ldm, **ldmarr;
int i, len;
char *type, *value;
int rc = 0;
@ -583,10 +582,9 @@ do_bind(
int *lderr
)
{
int rc;
int ldrc;
char msgbuf[ 1024];
#ifdef HAVE_KERBEROS
int rc;
int retval = 0;
int kni, got_tgt;
char **krbnames;
@ -769,7 +767,7 @@ LDAPMod **ldmarr )
if ( ldm->mod_bvalues != NULL ) {
for ( j = 0; ( b = ldm->mod_bvalues[ j ] ) != NULL; j++ ) {
msgbuf = ch_malloc( b->bv_len + 512 );
sprintf( msgbuf, "***** bv[ %d ] len = %d, val = <%s>",
sprintf( msgbuf, "***** bv[ %d ] len = %ld, val = <%s>",
j, b->bv_len, b->bv_val );
Debug( LDAP_DEBUG_TRACE,
"Trace (%d):%s\n", getpid(), msgbuf, 0 );
@ -849,8 +847,8 @@ char *s )
char *p;
for ( p = s; ( p != NULL ) && ( *p != '\0' ); p++ ) {
if ( islower( *p )) {
*p = toupper( *p );
if ( islower( (unsigned char) *p )) {
*p = toupper( (unsigned char) *p );
}
}
}

View file

@ -18,6 +18,7 @@
#include <stdio.h>
#include <ac/string.h>
#include <ac/socket.h>
#include <ac/time.h>
#include <ac/unistd.h>

View file

@ -34,21 +34,22 @@ extern int sanity();
extern void start_lwp_scheduler();
#endif /* HAVE_LWP */
int
main(
int argc,
char **argv
)
{
#ifdef NO_THREADS
/* Haven't yet written the non-threaded version */
fputs( "slurpd currently requires threads support\n", stderr );
return( 1 );
#else
pthread_attr_t attr;
int status;
int i;
#ifdef NO_THREADS
/* Haven't yet written the non-threaded version */
fprintf( stderr, "slurpd currently requires threads support\n" );
exit( 1 );
#else
/*
* Create and initialize globals. init_globals() also initializes
* the main replication queue.

View file

@ -25,6 +25,7 @@
#include <ac/errno.h>
#include <ac/socket.h>
#include <ac/string.h>
#include <ac/ctype.h>
#include "../slapd/slap.h"
#include "slurp.h"
@ -177,7 +178,7 @@ Re_parse(
*p++ = '\0';
}
re->re_timestamp = strdup( value );
if ( p != NULL && isdigit( *p )) {
if ( p != NULL && isdigit( (unsigned char) *p )) {
re->re_seq = atoi( p );
}
state |= GOT_TIME;
@ -499,7 +500,6 @@ Re_write(
int i;
char *s;
int rc = 0;
Rh *rh;
if ( re == NULL || fp == NULL ) {
Debug( LDAP_DEBUG_ANY, "Internal error: Re_write: NULL argument\n",

View file

@ -32,9 +32,6 @@ replicate(
Ri *ri
)
{
int i;
unsigned long seq;
Debug( LDAP_DEBUG_ARGS, "begin replication thread for %s:%d\n",
ri->ri_hostname, ri->ri_port, 0 );

View file

@ -46,7 +46,6 @@ Ri_process(
{
Rq *rq = sglob->rq;
Re *re, *new_re;
int i;
int rc ;
char *errmsg;