From ef7f5f5e32e6e0f129aee7fa1626017a7dadcb48 Mon Sep 17 00:00:00 2001 From: Hallvard Furuseth Date: Sun, 18 Sep 2011 21:49:25 +0200 Subject: [PATCH] Cleanup ISO C compatibility for recent commits --- libraries/liblber/debug.c | 2 +- servers/slapd/back-mdb/bind.c | 2 +- servers/slapd/back-mdb/compare.c | 2 +- servers/slapd/back-mdb/config.c | 2 +- servers/slapd/back-mdb/operational.c | 2 +- servers/slapd/back-mdb/search.c | 2 +- servers/slapd/overlays/pcache.c | 2 +- servers/slapd/syncrepl.c | 8 ++++++-- 8 files changed, 13 insertions(+), 9 deletions(-) diff --git a/libraries/liblber/debug.c b/libraries/liblber/debug.c index cc38e85b44..7a1b29953f 100644 --- a/libraries/liblber/debug.c +++ b/libraries/liblber/debug.c @@ -62,7 +62,7 @@ void (lutil_debug)( int debug, int level, const char *fmt, ... ) } #endif - sprintf(buffer, "%08x ", time(0L)); + sprintf(buffer, "%08x ", (unsigned) time(0L)); va_start( vl, fmt ); vsnprintf( buffer+9, sizeof(buffer)-9, fmt, vl ); buffer[sizeof(buffer)-1] = '\0'; diff --git a/servers/slapd/back-mdb/bind.c b/servers/slapd/back-mdb/bind.c index b828406ca9..9a00b99848 100644 --- a/servers/slapd/back-mdb/bind.c +++ b/servers/slapd/back-mdb/bind.c @@ -32,7 +32,7 @@ mdb_bind( Operation *op, SlapReply *rs ) AttributeDescription *password = slap_schema.si_ad_userPassword; MDB_txn *rtxn; - mdb_op_info opinfo = {0}, *moi = &opinfo; + mdb_op_info opinfo = {{{0}}}, *moi = &opinfo; Debug( LDAP_DEBUG_ARGS, "==> " LDAP_XSTRING(mdb_bind) ": dn: %s\n", diff --git a/servers/slapd/back-mdb/compare.c b/servers/slapd/back-mdb/compare.c index c5c45d256b..9ed7f9bde5 100644 --- a/servers/slapd/back-mdb/compare.c +++ b/servers/slapd/back-mdb/compare.c @@ -29,7 +29,7 @@ mdb_compare( Operation *op, SlapReply *rs ) int manageDSAit = get_manageDSAit( op ); MDB_txn *rtxn; - mdb_op_info opinfo = {0}, *moi = &opinfo; + mdb_op_info opinfo = {{{0}}}, *moi = &opinfo; rs->sr_err = mdb_opinfo_get(op, mdb, 1, &moi); switch(rs->sr_err) { diff --git a/servers/slapd/back-mdb/config.c b/servers/slapd/back-mdb/config.c index b21dbee35e..8e9df9a039 100644 --- a/servers/slapd/back-mdb/config.c +++ b/servers/slapd/back-mdb/config.c @@ -38,7 +38,7 @@ enum { MDB_MAXREADERS, MDB_MAXSIZE, MDB_MODE, - MDB_SSTACK, + MDB_SSTACK }; static ConfigTable mdbcfg[] = { diff --git a/servers/slapd/back-mdb/operational.c b/servers/slapd/back-mdb/operational.c index 28f6e7b4aa..56df5a750a 100644 --- a/servers/slapd/back-mdb/operational.c +++ b/servers/slapd/back-mdb/operational.c @@ -36,7 +36,7 @@ mdb_hasSubordinates( { struct mdb_info *mdb = (struct mdb_info *) op->o_bd->be_private; MDB_txn *rtxn; - mdb_op_info opinfo = {0}, *moi = &opinfo; + mdb_op_info opinfo = {{{0}}}, *moi = &opinfo; int rc; assert( e != NULL ); diff --git a/servers/slapd/back-mdb/search.c b/servers/slapd/back-mdb/search.c index a0ea03f063..5bac5501c9 100644 --- a/servers/slapd/back-mdb/search.c +++ b/servers/slapd/back-mdb/search.c @@ -294,7 +294,7 @@ mdb_search( Operation *op, SlapReply *rs ) IdScopes isc; MDB_cursor *mci; - mdb_op_info opinfo = {0}, *moi = &opinfo; + mdb_op_info opinfo = {{{0}}}, *moi = &opinfo; MDB_txn *ltid = NULL; Debug( LDAP_DEBUG_TRACE, "=> " LDAP_XSTRING(mdb_search) "\n", 0, 0, 0); diff --git a/servers/slapd/overlays/pcache.c b/servers/slapd/overlays/pcache.c index 6875b19fa7..d27dcb7a0a 100644 --- a/servers/slapd/overlays/pcache.c +++ b/servers/slapd/overlays/pcache.c @@ -2908,9 +2908,9 @@ pcache_op_bind( /* OK, just bind locally */ if ( bi.bi_flags & BI_HASHED ) { + int delete = 0; BackendDB *be = op->o_bd; op->o_bd = &cm->db; - int delete = 0; Debug( pcache_debug, "pcache_op_bind: CACHED BIND for %s\n", op->o_req_dn.bv_val, 0, 0 ); diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c index 204f064e97..0c4bb5b978 100644 --- a/servers/slapd/syncrepl.c +++ b/servers/slapd/syncrepl.c @@ -2077,8 +2077,12 @@ syncrepl_op_modify( Operation *op, SlapReply *rs ) Modifications *ml; int size, rc; SlapReply rs1 = {0}; - resolve_ctxt rx = { si, newlist }; - slap_callback cb = { NULL, syncrepl_resolve_cb, NULL, &rx }; + resolve_ctxt rx; + slap_callback cb = { NULL, syncrepl_resolve_cb, NULL, NULL }; + + rx.rx_si = si; + rx.rx_mods = newlist; + cb.sc_private = ℞ op2.o_tag = LDAP_REQ_SEARCH; op2.ors_scope = LDAP_SCOPE_SUBTREE; -- 2.39.5