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