Ver Fonte

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.
Reviewed by: nhosoi (Thanks!)

Rich Megginson há 16 anos atrás
pai
commit
f29916c68d

+ 1 - 1
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);
 				}

+ 0 - 1
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;

+ 0 - 1
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) {

+ 0 - 1
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;

+ 6 - 2
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

+ 0 - 1
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;