silence warnings

This commit is contained in:
Pierangelo Masarati 2005-11-06 23:27:09 +00:00
parent fd1b1a53f2
commit a6453f28f8
12 changed files with 45 additions and 20 deletions

View file

@ -279,6 +279,7 @@ LDAP_END_DECL
#endif /* HAVE_OPENSSL_BN_H || HAVE_BN_H */
typedef BIGNUM* ldap_pvt_mp_t;
#define LDAP_PVT_MP_INIT (NULL)
#define ldap_pvt_mp_init(mp) \
(mp) = BN_new()
@ -305,6 +306,8 @@ typedef BIGNUM* ldap_pvt_mp_t;
#endif
typedef mpz_t ldap_pvt_mp_t;
#define LDAP_PVT_MP_INIT { 0 }
#define ldap_pvt_mp_init(mp) \
mpz_init((mp))
@ -327,8 +330,10 @@ typedef mpz_t ldap_pvt_mp_t;
#ifdef HAVE_LONG_LONG
typedef unsigned long long ldap_pvt_mp_t;
#define LDAP_PVT_MP_INIT (0LL)
#else /* !HAVE_LONG_LONG */
typedef unsigned long ldap_pvt_mp_t;
#define LDAP_PVT_MP_INIT (0L)
#endif /* !HAVE_LONG_LONG */
#define ldap_pvt_mp_init(mp) \

View file

@ -1783,7 +1783,7 @@ tls_tmp_dh_cb( SSL *ssl, int is_export, int key_length )
dhparams = p;
}
}
done:
#ifdef LDAP_R_COMPILE
ldap_pvt_thread_mutex_unlock( &tls_def_ctx_mutex );
#endif

View file

@ -186,7 +186,7 @@ void*
tavl_delete( Avlnode **root, void* data, AVL_CMP fcmp )
{
Avlnode *p, *q, *r, *top;
int side, side_bf, shorter, nside;
int side, side_bf, shorter, nside = -1;
/* parent stack */
Avlnode *pptr[sizeof(void *)*8];

View file

@ -189,8 +189,8 @@ monitor_subsys_ops_update(
{
monitor_info_t *mi = ( monitor_info_t * )op->o_bd->be_private;
ldap_pvt_mp_t nInitiated,
nCompleted;
ldap_pvt_mp_t nInitiated = LDAP_PVT_MP_INIT,
nCompleted = LDAP_PVT_MP_INIT;
struct berval rdn;
int i;
Attribute *a;

View file

@ -59,7 +59,7 @@ passwd_back_search(
SlapReply *rs )
{
struct passwd *pw;
time_t stoptime;
time_t stoptime = (time_t)-1;
LDAPRDN rdn = NULL;
struct berval parent = BER_BVNULL;

View file

@ -157,7 +157,7 @@ glue_op_func ( Operation *op, SlapReply *rs )
BackendDB *b0 = op->o_bd;
BackendInfo *bi0 = op->o_bd->bd_info;
BI_op_modify **func;
slap_operation_t which;
slap_operation_t which = op_bind;
int rc;
op->o_bd = glue_back_select (b0, &op->o_req_ndn);
@ -168,6 +168,7 @@ glue_op_func ( Operation *op, SlapReply *rs )
case LDAP_REQ_DELETE: which = op_delete; break;
case LDAP_REQ_MODIFY: which = op_modify; break;
case LDAP_REQ_MODRDN: which = op_modrdn; break;
default: assert( 0 ); break;
}
func = &op->o_bd->bd_info->bi_op_bind;

View file

@ -2377,7 +2377,7 @@ replica_unparse( struct slap_replica_info *ri, int i, struct berval *bv )
static int
config_replica(ConfigArgs *c) {
int i, nr = -1;
char *replicahost, *replicauri;
char *replicahost = NULL, *replicauri = NULL;
LDAPURLDesc *ludp;
if (c->op == SLAP_CONFIG_EMIT) {
@ -2407,6 +2407,12 @@ config_replica(ConfigArgs *c) {
if(!strncasecmp(c->argv[i], "host=", STRLENOF("host="))) {
ber_len_t len;
if ( replicauri ) {
snprintf( c->msg, sizeof( c->msg ), "<%s> replica host/URI already specified", c->argv[0] );
Debug(LDAP_DEBUG_ANY, "%s: %s \"%s\"\n", c->log, c->msg, replicauri );
return(1);
}
replicahost = c->argv[i] + STRLENOF("host=");
len = strlen( replicahost ) + STRLENOF("ldap://");
replicauri = ch_malloc( len + 1 );
@ -2415,6 +2421,12 @@ config_replica(ConfigArgs *c) {
nr = add_replica_info(c->be, replicauri, replicahost);
break;
} else if(!strncasecmp(c->argv[i], "uri=", STRLENOF("uri="))) {
if ( replicauri ) {
snprintf( c->msg, sizeof( c->msg ), "<%s> replica host/URI already specified", c->argv[0] );
Debug(LDAP_DEBUG_ANY, "%s: %s \"%s\"\n", c->log, c->msg, replicauri );
return(1);
}
if(ldap_url_parse(c->argv[i] + STRLENOF("uri="), &ludp) != LDAP_SUCCESS) {
snprintf( c->msg, sizeof( c->msg ), "<%s> invalid uri", c->argv[0] );
Debug(LDAP_DEBUG_ANY, "%s: %s\n", c->log, c->msg, 0 );
@ -2442,7 +2454,8 @@ config_replica(ConfigArgs *c) {
return(1);
} else if(nr == -1) {
snprintf( c->msg, sizeof( c->msg ), "<%s> unable to add replica", c->argv[0] );
Debug(LDAP_DEBUG_ANY, "%s: %s \"%s\"\n", c->log, c->msg, replicauri );
Debug(LDAP_DEBUG_ANY, "%s: %s \"%s\"\n", c->log, c->msg,
replicauri ? replicauri : "" );
return(1);
} else {
for(i = 1; i < c->argc; i++) {
@ -2622,6 +2635,7 @@ config_tls_option(ConfigArgs *c) {
default: Debug(LDAP_DEBUG_ANY, "%s: "
"unknown tls_option <0x%x>\n",
c->log, c->type, 0);
return 1;
}
if (c->op == SLAP_CONFIG_EMIT) {
return ldap_pvt_tls_get_option( NULL, flag, &c->value_string );
@ -2656,6 +2670,7 @@ config_tls_config(ConfigArgs *c) {
Debug(LDAP_DEBUG_ANY, "%s: "
"unknown tls_option <0x%x>\n",
c->log, c->type, 0);
return 1;
}
if (c->op == SLAP_CONFIG_EMIT) {
ldap_pvt_tls_get_option( NULL, flag, &c->value_int );
@ -3120,7 +3135,7 @@ check_name_index( CfEntryInfo *parent, ConfigType ce_type, Entry *e,
CfEntryInfo *ce;
int index = -1, gotindex = 0, nsibs;
int renumber = 0, tailindex = 0;
char *ptr1, *ptr2;
char *ptr1, *ptr2 = NULL;
struct berval rdn;
if ( renum ) *renum = 0;
@ -3626,7 +3641,7 @@ config_modify_internal( CfEntryInfo *ce, Operation *op, SlapReply *rs,
switch (ml->sml_op) {
case LDAP_MOD_DELETE:
case LDAP_MOD_REPLACE: {
BerVarray vals = NULL, nvals;
BerVarray vals = NULL, nvals = NULL;
int *idx = NULL;
if ( ct && ( ct->arg_type & ARG_NO_DELETE )) {
rc = LDAP_OTHER;
@ -3737,9 +3752,9 @@ config_modify_internal( CfEntryInfo *ce, Operation *op, SlapReply *rs,
switch (ml->sml_op) {
case LDAP_MOD_DELETE:
case LDAP_MOD_REPLACE: {
BerVarray vals = NULL, nvals;
BerVarray vals = NULL, nvals = NULL;
Attribute *a;
delrec *d;
delrec *d = NULL;
a = attr_find( e->e_attrs, ml->sml_desc );

View file

@ -158,7 +158,7 @@ static int test_mra_filter(
void *memctx;
BER_MEMFREE_FN *memfree;
#ifdef LDAP_COMP_MATCH
int i, num_attr_vals;
int i, num_attr_vals = 0;
#endif
if ( op == NULL ) {

View file

@ -1155,10 +1155,11 @@ ppolicy_modify( Operation *op, SlapReply *rs )
{
slap_overinst *on = (slap_overinst *)op->o_bd->bd_info;
pp_info *pi = on->on_bi.bi_private;
int i, rc, mod_pw_only, pwmod, pwmop, deladd,
int i, rc, mod_pw_only, pwmod, pwmop = -1, deladd,
hsize = 0;
PassPolicy pp;
Modifications *mods = NULL, *modtail, *ml, *delmod, *addmod;
Modifications *mods = NULL, *modtail = NULL,
*ml, *delmod, *addmod;
Attribute *pa, *ha, at;
const char *txt;
pw_hist *tl = NULL, *p;
@ -1290,12 +1291,13 @@ ppolicy_modify( Operation *op, SlapReply *rs )
ppolicy_get( op, e, &pp );
for(ml = op->oq_modify.rs_modlist,
for ( ml = op->oq_modify.rs_modlist,
pwmod = 0, mod_pw_only = 1,
deladd = 0, delmod = NULL,
addmod = NULL,
zapReset = 1;
ml != NULL; modtail = ml, ml = ml->sml_next ) {
ml != NULL; modtail = ml, ml = ml->sml_next )
{
if ( ml->sml_desc == pp.ad ) {
pwmod = 1;
pwmop = ml->sml_op;

View file

@ -212,7 +212,7 @@ static void
do_sort( Operation *op, Attribute *a, int beg, int num, slap_mask_t sort )
{
int i, j, gotnvals;
struct berval tmp, ntmp, *vals, *nvals;
struct berval tmp, ntmp, *vals = NULL, *nvals;
gotnvals = (a->a_vals != a->a_nvals );

View file

@ -79,6 +79,8 @@ test_file( const char *fname, const char *ftype )
save_errno, strerror( save_errno ) );
return -1;
}
return 0;
}
int

View file

@ -32,8 +32,8 @@ argsfile @TESTDIR@/slapd.1.args
# cn=monitor, cn=schema, and cn=config
#
access to attr=userpassword
by self =wx
access to attrs=userpassword
by self =w
by anonymous =x
access to *