>From 7d4b712c0a8bf6e82b1b3a80ff0f191acf9a5c87 Mon Sep 17 00:00:00 2001 From: Rich Megginson <rmeggins@xxxxxxxxxx> Date: Mon, 31 Aug 2009 12:24:54 -0600 Subject: [PATCH] Clean up build warnings This cleans up the following warnings: ds.git/ldap/servers/slapd/back-ldbm/ldbm_usn.c:102: warning: unused variable 'li' ds.git/ldap/servers/plugins/replication/repl5_agmt.c:1184: warning: too many arguments for format ds.git/ldap/servers/plugins/syntaxes/dn.c:143: warning: unused variable 'val_copy' ds.git/ldap/servers/plugins/syntaxes/deliverymethod.c:264: warning: unused variable 'p' ds.git/ldap/servers/plugins/syntaxes/facsimile.c:269: warning: unused variable 'p' ds.git/ldap/servers/plugins/usn/usn.c:107: warning: value computed is not used ds.git/ldap/servers/plugins/usn/usn.c:263: warning: control reaches end of non-void function ds.git/ldap/servers/plugins/usn/usn.c:525: warning: control reaches end of non-void function The only one I'm not sure about is changing usn_get_attr to always return a 0 - please review that usage. With these fixes, I only see the llu and lld format warnings on RHEL5 with the default rpmbuild compiler flags. --- ldap/servers/plugins/replication/repl5_agmt.c | 2 +- ldap/servers/plugins/syntaxes/deliverymethod.c | 1 - ldap/servers/plugins/syntaxes/dn.c | 1 - ldap/servers/plugins/syntaxes/facsimile.c | 1 - ldap/servers/plugins/usn/usn.c | 8 ++++++-- ldap/servers/slapd/back-ldbm/ldbm_usn.c | 1 - 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ldap/servers/plugins/replication/repl5_agmt.c b/ldap/servers/plugins/replication/repl5_agmt.c index dc9b3be..d155004 100644 --- a/ldap/servers/plugins/replication/repl5_agmt.c +++ b/ldap/servers/plugins/replication/repl5_agmt.c @@ -1179,7 +1179,7 @@ _agmt_set_default_fractional_attrs(Repl_Agmt *ra) if (0 != rc) { slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "_agmt_set_default_fractional_attrs: failed to " - "parse default config (%s) attribute value: %s\n", + "parse default config (%s) attribute %s value: %s\n", SLAPI_PLUGIN_DEFAULT_CONFIG, type_nsds5ReplicatedAttributeList, val); } diff --git a/ldap/servers/plugins/syntaxes/deliverymethod.c b/ldap/servers/plugins/syntaxes/deliverymethod.c index 62a4124..67c9b5a 100644 --- a/ldap/servers/plugins/syntaxes/deliverymethod.c +++ b/ldap/servers/plugins/syntaxes/deliverymethod.c @@ -261,7 +261,6 @@ pdm_validate(const char *start, const char *end) { int rc = 0; /* Assume string is valid */ size_t length = 0; - const char *p = NULL; if ((start == NULL) || (end == NULL)) { rc = 1; diff --git a/ldap/servers/plugins/syntaxes/dn.c b/ldap/servers/plugins/syntaxes/dn.c index 6ab6294..c3f8287 100644 --- a/ldap/servers/plugins/syntaxes/dn.c +++ b/ldap/servers/plugins/syntaxes/dn.c @@ -140,7 +140,6 @@ dn_assertion2keys_sub( Slapi_PBlock *pb, char *initial, char **any, char *final, static int dn_validate( struct berval *val ) { int rc = 0; /* Assume value is valid */ - char *val_copy = NULL; /* A 0 length value is valid for the DN syntax. */ if (val == NULL) { diff --git a/ldap/servers/plugins/syntaxes/facsimile.c b/ldap/servers/plugins/syntaxes/facsimile.c index fa60421..2000978 100644 --- a/ldap/servers/plugins/syntaxes/facsimile.c +++ b/ldap/servers/plugins/syntaxes/facsimile.c @@ -266,7 +266,6 @@ fax_parameter_validate(const char *start, const char *end) { int rc = 0; /* Assume string is valid */ size_t length = 0; - const char *p = NULL; if ((start == NULL) || (end == NULL)) { rc = 1; diff --git a/ldap/servers/plugins/usn/usn.c b/ldap/servers/plugins/usn/usn.c index fd8f7c5..19b146a 100644 --- a/ldap/servers/plugins/usn/usn.c +++ b/ldap/servers/plugins/usn/usn.c @@ -100,9 +100,9 @@ usn_init(Slapi_PBlock *pb) goto bail; } if (slapi_pblock_set(pb, SLAPI_PLUGIN_START_FN, - (void *)usn_start) != 0 ) { + (void *)usn_start) != 0 || slapi_pblock_set(pb, SLAPI_PLUGIN_CLOSE_FN, - (void *)usn_close) != 0 || + (void *)usn_close) != 0 ) { slapi_log_error(SLAPI_LOG_FATAL, USN_PLUGIN_SUBSYSTEM, "usn_init: failed to register close callback & task\n"); rc = -1; @@ -260,6 +260,8 @@ usn_close(Slapi_PBlock *pb) csngen_free(&_usn_csngen); slapi_log_error(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, "<-- usn_close\n"); + + return 0; } /* @@ -522,6 +524,8 @@ usn_get_attr(Slapi_PBlock *pb, const char* type, void *value) } else { *(int *)value = 0; } + + return 0; } void diff --git a/ldap/servers/slapd/back-ldbm/ldbm_usn.c b/ldap/servers/slapd/back-ldbm/ldbm_usn.c index e8dd723..b502d43 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_usn.c +++ b/ldap/servers/slapd/back-ldbm/ldbm_usn.c @@ -99,7 +99,6 @@ static int usn_get_last_usn(Slapi_Backend *be, PRUint64 *last_usn) { struct attrinfo *ai = NULL; - struct ldbminfo *li = (struct ldbminfo *)be->be_database->plg_private; int rc = -1; DB *db = NULL; DBC *dbc = NULL; -- 1.5.5.6
Attachment:
smime.p7s
Description: S/MIME Cryptographic Signature
-- 389-devel mailing list 389-devel@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/fedora-directory-devel