mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-09 02:52:04 +08:00
Some gcc -W cleanup
This commit is contained in:
parent
500351993c
commit
d171cd4f42
@ -33,6 +33,7 @@ static int dodelete LDAP_P((
|
||||
LDAP *ld,
|
||||
char *dn));
|
||||
|
||||
int
|
||||
main( argc, argv )
|
||||
int argc;
|
||||
char **argv;
|
||||
|
@ -69,6 +69,7 @@ static int fromfile LDAP_P(( char *path, struct berval *bv ));
|
||||
static char *read_one_record LDAP_P(( FILE *fp ));
|
||||
|
||||
|
||||
int
|
||||
main( int argc, char **argv )
|
||||
{
|
||||
char *infile, *rbuf, *start, *p, *q;
|
||||
|
@ -35,6 +35,7 @@ static int domodrdn LDAP_P((
|
||||
char *rdn,
|
||||
int remove)); /* flag: remove old RDN */
|
||||
|
||||
int
|
||||
main( argc, argv )
|
||||
int argc;
|
||||
char **argv;
|
||||
|
@ -86,6 +86,7 @@ static char *sortattr = NULL;
|
||||
static int skipsortattr = 0;
|
||||
static int verbose, not, includeufn, allow_binary, vals2tmp, ldif;
|
||||
|
||||
int
|
||||
main( argc, argv )
|
||||
int argc;
|
||||
char **argv;
|
||||
|
@ -43,7 +43,7 @@ ber_get_tag( BerElement *ber )
|
||||
unsigned char xbyte;
|
||||
unsigned long tag;
|
||||
char *tagp;
|
||||
int i;
|
||||
unsigned int i;
|
||||
|
||||
if ( ber_read( ber, (char *) &xbyte, 1 ) != 1 )
|
||||
return( LBER_DEFAULT );
|
||||
@ -386,8 +386,8 @@ va_dcl
|
||||
char *s, **ss, ***sss;
|
||||
struct berval ***bv, **bvp, *bval;
|
||||
int *i, j;
|
||||
long *l, rc, tag;
|
||||
unsigned long len;
|
||||
long *l;
|
||||
unsigned long rc, tag, len;
|
||||
|
||||
#if defined( HAVE_STDARG_H ) && __STDC__
|
||||
va_start( ap, fmt );
|
||||
|
@ -439,7 +439,7 @@ get_tag( Sockbuf *sb )
|
||||
unsigned char xbyte;
|
||||
unsigned long tag;
|
||||
char *tagp;
|
||||
int i;
|
||||
unsigned int i;
|
||||
|
||||
if ( BerRead( sb, (char *) &xbyte, 1 ) != 1 )
|
||||
return( LBER_DEFAULT );
|
||||
|
@ -127,7 +127,7 @@ ldap_result2error( LDAP *ld, LDAPMessage *r, int freeit )
|
||||
LDAPMessage *lm;
|
||||
BerElement ber;
|
||||
long along;
|
||||
int rc;
|
||||
unsigned long rc;
|
||||
|
||||
Debug( LDAP_DEBUG_TRACE, "ldap_result2error\n", 0, 0, 0 );
|
||||
|
||||
|
@ -28,7 +28,7 @@ ldap_get_option(
|
||||
if(ldp == NULL) {
|
||||
ld = &openldap_ld_globals;
|
||||
} else {
|
||||
ld = ld;
|
||||
ld = ldp;
|
||||
}
|
||||
|
||||
switch(option) {
|
||||
@ -136,7 +136,7 @@ ldap_set_option(
|
||||
if(ldp == NULL) {
|
||||
ld = &openldap_ld_globals;
|
||||
} else {
|
||||
ld = ld;
|
||||
ld = ldp;
|
||||
}
|
||||
|
||||
switch(option) {
|
||||
|
@ -30,7 +30,7 @@ static int wait4msg LDAP_P(( LDAP *ld, int msgid, int all, struct timeval *timeo
|
||||
#ifdef LDAP_REFERRALS
|
||||
static int read1msg LDAP_P(( LDAP *ld, int msgid, int all, Sockbuf *sb, LDAPConn *lc,
|
||||
LDAPMessage **result ));
|
||||
static int build_result_ber LDAP_P(( LDAP *ld, BerElement *ber, LDAPRequest *lr ));
|
||||
static unsigned long build_result_ber LDAP_P(( LDAP *ld, BerElement *ber, LDAPRequest *lr ));
|
||||
static void merge_error_info LDAP_P(( LDAP *ld, LDAPRequest *parentr, LDAPRequest *lr ));
|
||||
#else /* LDAP_REFERRALS */
|
||||
static int read1msg LDAP_P(( LDAP *ld, int msgid, int all, Sockbuf *sb,
|
||||
@ -512,7 +512,7 @@ lr->lr_res_matched ? lr->lr_res_matched : "" );
|
||||
|
||||
|
||||
#ifdef LDAP_REFERRALS
|
||||
static int
|
||||
static unsigned long
|
||||
build_result_ber( LDAP *ld, BerElement *ber, LDAPRequest *lr )
|
||||
{
|
||||
unsigned long len;
|
||||
@ -523,7 +523,7 @@ build_result_ber( LDAP *ld, BerElement *ber, LDAPRequest *lr )
|
||||
if ( ber_printf( ber, "{it{ess}}", lr->lr_msgid,
|
||||
(long)lr->lr_res_msgtype, lr->lr_res_errno,
|
||||
lr->lr_res_matched ? lr->lr_res_matched : "",
|
||||
lr->lr_res_error ? lr->lr_res_error : "" ) == LBER_ERROR ) {
|
||||
lr->lr_res_error ? lr->lr_res_error : "" ) == -1 ) {
|
||||
return( LBER_ERROR );
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ struct entrything {
|
||||
};
|
||||
|
||||
static int (*et_cmp_fn) LDAP_P(( char *a, char *b ));
|
||||
static int et_cmp LDAP_P(( void *aa, void *bb));
|
||||
static int et_cmp LDAP_P(( const void *aa, const void *bb));
|
||||
|
||||
|
||||
int
|
||||
@ -44,13 +44,13 @@ ldap_sort_strcasecmp(
|
||||
|
||||
static int
|
||||
et_cmp(
|
||||
void *aa,
|
||||
void *bb
|
||||
const void *aa,
|
||||
const void *bb
|
||||
)
|
||||
{
|
||||
int i, rc;
|
||||
struct entrything *a = (struct entrything *)aa;
|
||||
struct entrything *b = (struct entrything *)bb;
|
||||
const struct entrything *a = (const struct entrything *)aa;
|
||||
const struct entrything *b = (const struct entrything *)bb;
|
||||
|
||||
if ( a->et_vals == NULL && b->et_vals == NULL )
|
||||
return( 0 );
|
||||
|
@ -195,7 +195,7 @@ do_entry2text(
|
||||
sprintf( buf + strlen( buf ),
|
||||
"%s\">Move Up To <EM>%s</EM></A>%s<BR>",
|
||||
( vals[ 1 ] == NULL ) ? "??one" : "",
|
||||
( untagged != NULL ) ? untagged + 1 : vals[ 1 ], eol, eol );
|
||||
( untagged != NULL ) ? untagged + 1 : vals[ 1 ], eol );
|
||||
(*writeproc)( writeparm, buf, strlen( buf ));
|
||||
|
||||
/*
|
||||
|
@ -414,7 +414,8 @@ ldbm_datum_dup( LDBM ldbm, Datum data )
|
||||
return( dup );
|
||||
}
|
||||
dup.dsize = data.dsize;
|
||||
if ( dup.dptr = (char *) malloc( data.dsize ) )
|
||||
dup.dptr = (char *) malloc( data.dsize );
|
||||
if ( dup.dptr )
|
||||
memcpy( dup.dptr, data.dptr, data.dsize );
|
||||
|
||||
return( dup );
|
||||
|
@ -187,7 +187,7 @@ str_getline( char **next )
|
||||
*(*next)++ = '\0';
|
||||
break;
|
||||
}
|
||||
*(*next)++;
|
||||
(*next)++;
|
||||
}
|
||||
|
||||
return( l );
|
||||
@ -215,7 +215,7 @@ put_type_and_value( char **out, char *t, char *val, int vlen )
|
||||
b64 = 0;
|
||||
|
||||
stop = (unsigned char *) (val + vlen);
|
||||
if ( isascii( val[0] ) && isspace( val[0] ) || val[0] == ':' ) {
|
||||
if ( isascii( val[0] ) && (isspace( val[0] ) || val[0] == ':') ) {
|
||||
b64 = 1;
|
||||
} else {
|
||||
for ( byte = (unsigned char *) val; byte < stop;
|
||||
|
@ -48,6 +48,7 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include <ac/string.h>
|
||||
|
||||
@ -209,7 +210,7 @@ b64_pton(
|
||||
tarindex = 0;
|
||||
|
||||
while ((ch = *src++) != '\0') {
|
||||
if (isspace(ch)) /* Skip whitespace anywhere. */
|
||||
if (isascii(ch) && isspace(ch)) /* Skip whitespace anywhere. */
|
||||
continue;
|
||||
|
||||
if (ch == Pad64)
|
||||
@ -279,7 +280,7 @@ b64_pton(
|
||||
case 2: /* Valid, means one byte of info */
|
||||
/* Skip any number of spaces. */
|
||||
for ((void)NULL; ch != '\0'; ch = *src++)
|
||||
if (!isspace(ch))
|
||||
if (! (isascii(ch) && isspace(ch)))
|
||||
break;
|
||||
/* Make sure there is another trailing = sign. */
|
||||
if (ch != Pad64)
|
||||
@ -294,7 +295,7 @@ b64_pton(
|
||||
* whitespace after it?
|
||||
*/
|
||||
for ((void)NULL; ch != '\0'; ch = *src++)
|
||||
if (!isspace(ch))
|
||||
if (! (isascii(ch) && isspace(ch)))
|
||||
return (-1);
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user