From 04f70b55c33212fa6ac6ffb85c4a5ef3a5c173e4 Mon Sep 17 00:00:00 2001 From: William Brown Date: Fri, 24 Mar 2017 16:56:11 +1000 Subject: [PATCH] Ticket 49193 - gcc7 warning fixes Fix Description: This is the first pass at fixing a number of warnings that gcc 7 raises. The focus of this patch is mainly: * Unused parameters * String format overflows The benefit to annonating the unused parameters is that when we clean the codebase for 1.4.x, we can check what is public / private, what's in cb's etc, and then change the functions as needed. IE we can fix all the internal functions. Less arguments to a function does improve perf because of less items on the stack :) https://pagure.io/389-ds-base/issue/49193 Author: wibrown Review by: ??? --- ldap/libraries/libavl/avl.c | 2 +- .../plugins/acct_usability/acct_usability.c | 6 +- ldap/servers/plugins/acctpolicy/acct_config.c | 2 +- ldap/servers/plugins/acctpolicy/acct_init.c | 2 +- ldap/servers/plugins/acctpolicy/acct_util.c | 2 +- ldap/servers/plugins/acl/acl.c | 10 +- ldap/servers/plugins/acl/acl_ext.c | 10 +- ldap/servers/plugins/acl/acleffectiverights.c | 12 +- ldap/servers/plugins/acl/acllas.c | 30 +- ldap/servers/plugins/acl/acllist.c | 6 +- ldap/servers/plugins/acl/aclplugin.c | 4 +- ldap/servers/plugins/acl/aclutil.c | 9 +- ldap/servers/plugins/automember/automember.c | 14 +- ldap/servers/plugins/bitwise/bitwise.c | 2 +- ldap/servers/plugins/chainingdb/cb_abandon.c | 2 +- ldap/servers/plugins/chainingdb/cb_acl.c | 12 +- ldap/servers/plugins/chainingdb/cb_bind.c | 6 +- ldap/servers/plugins/chainingdb/cb_cleanup.c | 16 +- ldap/servers/plugins/chainingdb/cb_config.c | 66 +++-- ldap/servers/plugins/chainingdb/cb_controls.c | 4 +- ldap/servers/plugins/chainingdb/cb_instance.c | 94 ++++--- ldap/servers/plugins/chainingdb/cb_monitor.c | 14 +- ldap/servers/plugins/chainingdb/cb_search.c | 2 +- ldap/servers/plugins/chainingdb/cb_utils.c | 2 +- ldap/servers/plugins/collation/collate.c | 3 +- ldap/servers/plugins/cos/cos.c | 9 +- ldap/servers/plugins/cos/cos_cache.c | 34 ++- ldap/servers/plugins/deref/deref.c | 10 +- ldap/servers/plugins/distrib/distrib.c | 8 +- ldap/servers/plugins/dna/dna.c | 20 +- ldap/servers/plugins/http/http_client.c | 4 +- ldap/servers/plugins/http/http_impl.c | 4 +- ldap/servers/plugins/linkedattrs/fixup_task.c | 9 +- ldap/servers/plugins/linkedattrs/linked_attrs.c | 4 +- ldap/servers/plugins/memberof/memberof.c | 32 ++- ldap/servers/plugins/memberof/memberof_config.c | 34 ++- ldap/servers/plugins/mep/mep.c | 2 +- ldap/servers/plugins/pam_passthru/pam_ptimpl.c | 2 +- .../plugins/posix-winsync/posix-group-func.c | 2 +- .../plugins/posix-winsync/posix-group-task.c | 8 +- .../plugins/posix-winsync/posix-winsync-config.c | 8 +- ldap/servers/plugins/posix-winsync/posix-winsync.c | 211 ++++++++++---- ldap/servers/plugins/referint/referint.c | 8 +- ldap/servers/plugins/replication/cl5_api.c | 8 +- ldap/servers/plugins/replication/cl5_config.c | 38 ++- ldap/servers/plugins/replication/legacy_consumer.c | 44 ++- ldap/servers/plugins/replication/repl5_agmt.c | 12 +- ldap/servers/plugins/replication/repl5_agmtlist.c | 37 ++- .../servers/plugins/replication/repl5_connection.c | 2 +- .../plugins/replication/repl5_inc_protocol.c | 4 +- ldap/servers/plugins/replication/repl5_init.c | 4 +- .../servers/plugins/replication/repl5_mtnode_ext.c | 4 +- ldap/servers/plugins/replication/repl5_plugins.c | 12 +- ldap/servers/plugins/replication/repl5_replica.c | 10 +- .../plugins/replication/repl5_replica_config.c | 86 ++++-- .../plugins/replication/repl5_replica_dnhash.c | 5 +- .../plugins/replication/repl5_replica_hash.c | 7 +- ldap/servers/plugins/replication/repl5_schedule.c | 6 +- .../plugins/replication/repl5_tot_protocol.c | 5 +- ldap/servers/plugins/replication/repl5_total.c | 2 +- .../plugins/replication/repl5_updatedn_list.c | 7 +- ldap/servers/plugins/replication/repl_add.c | 2 +- ldap/servers/plugins/replication/repl_connext.c | 4 +- ldap/servers/plugins/replication/repl_delete.c | 2 +- ldap/servers/plugins/replication/repl_extop.c | 4 +- ldap/servers/plugins/replication/repl_init.c | 4 +- ldap/servers/plugins/replication/repl_modify.c | 2 +- ldap/servers/plugins/replication/repl_modrdn.c | 2 +- ldap/servers/plugins/replication/repl_opext.c | 6 +- ldap/servers/plugins/replication/repl_ops.c | 4 +- ldap/servers/plugins/replication/repl_rootdse.c | 7 +- ldap/servers/plugins/replication/repl_search.c | 4 +- ldap/servers/plugins/replication/replutil.c | 6 +- .../plugins/replication/windows_connection.c | 6 +- .../plugins/replication/windows_inc_protocol.c | 6 +- ldap/servers/plugins/replication/windows_private.c | 152 +++++----- .../plugins/replication/windows_protocol_util.c | 2 +- .../plugins/replication/windows_tot_protocol.c | 4 +- ldap/servers/plugins/retrocl/retrocl.c | 2 +- ldap/servers/plugins/retrocl/retrocl_po.c | 2 +- ldap/servers/plugins/retrocl/retrocl_rootdse.c | 7 +- ldap/servers/plugins/retrocl/retrocl_trim.c | 4 +- ldap/servers/plugins/roles/roles_cache.c | 5 +- ldap/servers/plugins/roles/roles_plugin.c | 26 +- ldap/servers/plugins/rootdn_access/rootdn_access.c | 4 +- ldap/servers/plugins/schema_reload/schema_reload.c | 11 +- ldap/servers/plugins/statechange/statechange.c | 10 +- ldap/servers/plugins/sync/sync_init.c | 2 +- ldap/servers/plugins/sync/sync_refresh.c | 6 +- ldap/servers/plugins/sync/sync_util.c | 2 +- ldap/servers/plugins/syntaxes/bin.c | 6 +- ldap/servers/plugins/syntaxes/bitstring.c | 2 +- ldap/servers/plugins/syntaxes/ces.c | 2 +- ldap/servers/plugins/syntaxes/cis.c | 2 +- ldap/servers/plugins/syntaxes/deliverymethod.c | 2 +- ldap/servers/plugins/syntaxes/dn.c | 2 +- ldap/servers/plugins/syntaxes/facsimile.c | 2 +- ldap/servers/plugins/syntaxes/guide.c | 2 +- ldap/servers/plugins/syntaxes/int.c | 2 +- ldap/servers/plugins/syntaxes/nameoptuid.c | 2 +- ldap/servers/plugins/syntaxes/numericstring.c | 2 +- ldap/servers/plugins/syntaxes/sicis.c | 2 +- ldap/servers/plugins/syntaxes/string.c | 4 +- ldap/servers/plugins/syntaxes/tel.c | 2 +- ldap/servers/plugins/syntaxes/teletex.c | 2 +- ldap/servers/plugins/syntaxes/telex.c | 2 +- ldap/servers/plugins/syntaxes/validate_task.c | 11 +- ldap/servers/plugins/syntaxes/value.c | 6 +- ldap/servers/plugins/uiduniq/utils.c | 2 +- ldap/servers/plugins/usn/usn.c | 12 +- ldap/servers/plugins/usn/usn_cleanup.c | 8 +- ldap/servers/plugins/views/views.c | 13 +- ldap/servers/slapd/add.c | 2 +- ldap/servers/slapd/attr.c | 4 +- ldap/servers/slapd/attrsyntax.c | 24 +- ldap/servers/slapd/back-ldbm/cache.c | 2 +- ldap/servers/slapd/back-ldbm/close.c | 2 +- ldap/servers/slapd/back-ldbm/dbhelp.c | 2 +- ldap/servers/slapd/back-ldbm/dblayer.c | 34 +-- ldap/servers/slapd/back-ldbm/filterindex.c | 4 +- ldap/servers/slapd/back-ldbm/idl.c | 10 +- ldap/servers/slapd/back-ldbm/idl_common.c | 2 +- ldap/servers/slapd/back-ldbm/idl_new.c | 14 +- ldap/servers/slapd/back-ldbm/import-threads.c | 4 +- ldap/servers/slapd/back-ldbm/index.c | 10 +- ldap/servers/slapd/back-ldbm/init.c | 2 +- ldap/servers/slapd/back-ldbm/ldbm_abandon.c | 2 +- ldap/servers/slapd/back-ldbm/ldbm_attr.c | 4 +- ldap/servers/slapd/back-ldbm/ldbm_attrcrypt.c | 8 +- .../slapd/back-ldbm/ldbm_attrcrypt_config.c | 20 +- ldap/servers/slapd/back-ldbm/ldbm_config.c | 307 +++++++++++++++------ ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c | 4 +- ldap/servers/slapd/back-ldbm/ldbm_index_config.c | 29 +- .../servers/slapd/back-ldbm/ldbm_instance_config.c | 86 +++++- ldap/servers/slapd/back-ldbm/ldbm_modrdn.c | 2 +- ldap/servers/slapd/back-ldbm/ldbm_search.c | 10 +- ldap/servers/slapd/back-ldbm/ldbm_unbind.c | 2 +- ldap/servers/slapd/back-ldbm/ldif2ldbm.c | 6 +- ldap/servers/slapd/back-ldbm/monitor.c | 19 +- ldap/servers/slapd/back-ldbm/parents.c | 2 +- ldap/servers/slapd/back-ldbm/perfctrs.c | 4 +- ldap/servers/slapd/back-ldbm/vlv.c | 90 ++++-- ldap/servers/slapd/configdse.c | 39 ++- ldap/servers/slapd/connection.c | 37 +-- ldap/servers/slapd/conntable.c | 2 +- ldap/servers/slapd/control.c | 2 +- ldap/servers/slapd/csn.c | 5 +- ldap/servers/slapd/daemon.c | 37 ++- ldap/servers/slapd/defbackend.c | 6 +- ldap/servers/slapd/delete.c | 2 +- ldap/servers/slapd/dn.c | 2 +- ldap/servers/slapd/dse.c | 8 +- ldap/servers/slapd/entry.c | 8 +- ldap/servers/slapd/entrywsi.c | 12 +- ldap/servers/slapd/eventq.c | 2 +- ldap/servers/slapd/extendop.c | 6 +- ldap/servers/slapd/factory.c | 2 +- ldap/servers/slapd/fedse.c | 39 ++- ldap/servers/slapd/filter.c | 8 +- ldap/servers/slapd/filterentry.c | 4 +- ldap/servers/slapd/getopt_ext.c | 4 +- ldap/servers/slapd/house.c | 4 +- ldap/servers/slapd/ldaputil.c | 26 +- ldap/servers/slapd/libglobs.c | 24 +- ldap/servers/slapd/log.c | 20 +- ldap/servers/slapd/main.c | 13 +- ldap/servers/slapd/mapping_tree.c | 21 +- ldap/servers/slapd/match.c | 2 +- ldap/servers/slapd/modify.c | 2 +- ldap/servers/slapd/modrdn.c | 2 +- ldap/servers/slapd/monitor.c | 7 +- ldap/servers/slapd/operation.c | 2 +- ldap/servers/slapd/opshared.c | 43 +-- ldap/servers/slapd/pagedresults.c | 4 +- ldap/servers/slapd/passwd_extop.c | 4 +- ldap/servers/slapd/pblock.c | 4 +- ldap/servers/slapd/plugin.c | 14 +- ldap/servers/slapd/plugin_internal_op.c | 79 +++--- ldap/servers/slapd/plugin_syntax.c | 8 +- ldap/servers/slapd/pw.c | 18 +- ldap/servers/slapd/pw_mgmt.c | 2 +- ldap/servers/slapd/pw_retry.c | 2 +- ldap/servers/slapd/resourcelimit.c | 4 +- ldap/servers/slapd/result.c | 6 +- ldap/servers/slapd/rootdse.c | 16 +- ldap/servers/slapd/sasl_io.c | 6 +- ldap/servers/slapd/sasl_map.c | 21 +- ldap/servers/slapd/saslbind.c | 43 +-- ldap/servers/slapd/schema.c | 59 ++-- ldap/servers/slapd/snmp_collator.c | 2 +- ldap/servers/slapd/ssl.c | 10 +- ldap/servers/slapd/start_tls_extop.c | 2 +- ldap/servers/slapd/str2filter.c | 2 +- ldap/servers/slapd/stubs.c | 6 +- ldap/servers/slapd/task.c | 92 ++++-- ldap/servers/slapd/time.c | 4 +- ldap/servers/slapd/tools/dbscan.c | 8 +- ldap/servers/slapd/tools/ldaptool-sasl.c | 6 +- ldap/servers/slapd/tools/ldclt/ldapfct.c | 12 +- ldap/servers/slapd/tools/ldclt/ldclt.c | 4 +- ldap/servers/slapd/tools/ldclt/scalab01.c | 2 +- ldap/servers/slapd/tools/ldclt/workarounds.c | 8 +- ldap/servers/slapd/tools/mmldif.c | 54 ++-- ldap/servers/slapd/tools/rsearch/addthread.c | 2 +- ldap/servers/slapd/uuid.c | 2 +- ldap/servers/slapd/vattr.c | 23 +- ldap/servers/snmp/ldap-agent.c | 4 +- ldap/systools/idsktune.c | 6 +- lib/ldaputil/cert.c | 2 +- lib/ldaputil/certmap.c | 9 +- lib/ldaputil/ldapauth.c | 1 + lib/libsi18n/getstrprop.c | 2 +- src/libsds/sds/bpt/bpt.c | 4 +- src/libsds/sds/bpt_cow/bpt_cow.c | 4 +- src/libsds/test/test_sds_bpt.c | 2 +- src/libsds/test/test_sds_set.c | 4 +- src/nunc-stans/ns/ns_thrpool.c | 5 +- 217 files changed, 1979 insertions(+), 1117 deletions(-) diff --git a/ldap/libraries/libavl/avl.c b/ldap/libraries/libavl/avl.c index d3e705b..eca0ee4 100644 --- a/ldap/libraries/libavl/avl.c +++ b/ldap/libraries/libavl/avl.c @@ -700,7 +700,7 @@ static int avl_nextlist = 0; /* ARGSUSED */ static int -avl_buildlist( caddr_t data, int arg ) +avl_buildlist( caddr_t data, int arg __attribute__((unused))) { static int slots = 0; diff --git a/ldap/servers/plugins/acct_usability/acct_usability.c b/ldap/servers/plugins/acct_usability/acct_usability.c index d320fce..fc8c53a 100644 --- a/ldap/servers/plugins/acct_usability/acct_usability.c +++ b/ldap/servers/plugins/acct_usability/acct_usability.c @@ -121,7 +121,7 @@ auc_init(Slapi_PBlock *pb) * auc_start() */ static int -auc_start(Slapi_PBlock * pb) +auc_start(Slapi_PBlock * pb __attribute__((unused))) { slapi_log_err(SLAPI_LOG_TRACE, AUC_PLUGIN_SUBSYSTEM, "--> auc_start\n"); @@ -139,7 +139,7 @@ auc_start(Slapi_PBlock * pb) * auc_close() */ static int -auc_close(Slapi_PBlock * pb) +auc_close(Slapi_PBlock * pb __attribute__((unused))) { slapi_log_err(SLAPI_LOG_TRACE, AUC_PLUGIN_SUBSYSTEM, "--> auc_close\n"); @@ -162,7 +162,7 @@ auc_close(Slapi_PBlock * pb) * usability control. */ static int -auc_incompatible_ctrl(const char *oid) +auc_incompatible_ctrl(const char *oid __attribute__((unused))) { return 0; /* no known incompatible ctrls yet */ } diff --git a/ldap/servers/plugins/acctpolicy/acct_config.c b/ldap/servers/plugins/acctpolicy/acct_config.c index b101f18..784bd02 100644 --- a/ldap/servers/plugins/acctpolicy/acct_config.c +++ b/ldap/servers/plugins/acctpolicy/acct_config.c @@ -35,7 +35,7 @@ static int acct_policy_entry2config( Slapi_Entry *e, Creates global config structure from config entry at plugin startup */ int -acct_policy_load_config_startup( Slapi_PBlock* pb, void* plugin_id ) { +acct_policy_load_config_startup( Slapi_PBlock* pb __attribute__((unused)), void* plugin_id ) { acctPluginCfg *newcfg; Slapi_Entry *config_entry = NULL; Slapi_DN *config_sdn = NULL; diff --git a/ldap/servers/plugins/acctpolicy/acct_init.c b/ldap/servers/plugins/acctpolicy/acct_init.c index 6bf6f4b..00d8cd1 100644 --- a/ldap/servers/plugins/acctpolicy/acct_init.c +++ b/ldap/servers/plugins/acctpolicy/acct_init.c @@ -206,7 +206,7 @@ acct_policy_start( Slapi_PBlock *pb ) } int -acct_policy_close( Slapi_PBlock *pb ) +acct_policy_close( Slapi_PBlock *pb __attribute__((unused))) { int rc = 0; diff --git a/ldap/servers/plugins/acctpolicy/acct_util.c b/ldap/servers/plugins/acctpolicy/acct_util.c index 1de52bd..35e8b41 100644 --- a/ldap/servers/plugins/acctpolicy/acct_util.c +++ b/ldap/servers/plugins/acctpolicy/acct_util.c @@ -81,7 +81,7 @@ get_attr_string_val( Slapi_Entry* target_entry, char* attr_name ) { not an error; the entry is simply not covered by a policy. */ int -get_acctpolicy( Slapi_PBlock *pb, Slapi_Entry *target_entry, void *plugin_id, +get_acctpolicy( Slapi_PBlock *pb __attribute__((unused)), Slapi_Entry *target_entry, void *plugin_id, acctPolicy **policy ) { Slapi_DN *sdn = NULL; diff --git a/ldap/servers/plugins/acl/acl.c b/ldap/servers/plugins/acl/acl.c index 48b8efc..73052b9 100644 --- a/ldap/servers/plugins/acl/acl.c +++ b/ldap/servers/plugins/acl/acl.c @@ -82,9 +82,9 @@ int acl_access_allowed_modrdn( Slapi_PBlock *pb, Slapi_Entry *e, /* The Slapi_Entry */ - char *attr, /* Attribute of the entry */ - struct berval *val, /* value of attr. NOT USED */ - int access /* requested access rights */ + char *attr __attribute__((unused)), /* Attribute of the entry */ + struct berval *val __attribute__((unused)), /* value of attr. NOT USED */ + int access __attribute__((unused)) /* requested access rights */ ) { int retCode ; @@ -889,7 +889,7 @@ int acl_read_access_allowed_on_entry ( Slapi_PBlock *pb, Slapi_Entry *e, /* The Slapi_Entry */ - char **attrs, + char **attrs __attribute__((unused)), int access /* access rights */ ) { @@ -4053,7 +4053,7 @@ acl__get_attrEval ( struct acl_pblock *aclpb, char *attr ) * */ int -acl_skip_access_check ( Slapi_PBlock *pb, Slapi_Entry *e, int access ) +acl_skip_access_check ( Slapi_PBlock *pb, Slapi_Entry *e __attribute__((unused)), int access ) { int rv, isRoot, accessCheckDisabled; void *conn = NULL; diff --git a/ldap/servers/plugins/acl/acl_ext.c b/ldap/servers/plugins/acl/acl_ext.c index d0fc8f5..3fa8ce3 100644 --- a/ldap/servers/plugins/acl/acl_ext.c +++ b/ldap/servers/plugins/acl/acl_ext.c @@ -191,7 +191,7 @@ aclext_get_lock(void) /* CONNECTION EXTENSION SPECIFIC */ /****************************************************************************/ void * -acl_conn_ext_constructor ( void *object, void *parent ) +acl_conn_ext_constructor ( void *object __attribute__((unused)), void *parent __attribute__((unused))) { struct acl_cblock *ext = NULL; ext = (struct acl_cblock * ) slapi_ch_calloc (1, sizeof (struct acl_cblock ) ); @@ -214,7 +214,7 @@ acl_conn_ext_constructor ( void *object, void *parent ) } void -acl_conn_ext_destructor ( void *ext, void *object, void *parent ) +acl_conn_ext_destructor ( void *ext, void *object __attribute__((unused)), void *parent __attribute__((unused))) { struct acl_cblock *aclcb = ext; PRLock *shared_lock; @@ -235,7 +235,7 @@ acl_conn_ext_destructor ( void *ext, void *object, void *parent ) /* OPERATION EXTENSION SPECIFIC */ /****************************************************************************/ void * -acl_operation_ext_constructor ( void *object, void *parent ) +acl_operation_ext_constructor ( void *object __attribute__((unused)), void *parent __attribute__((unused))) { Acl_PBlock *aclpb = NULL; @@ -263,7 +263,7 @@ acl_operation_ext_constructor ( void *object, void *parent ) } void -acl_operation_ext_destructor ( void *ext, void *object, void *parent ) +acl_operation_ext_destructor ( void *ext, void *object __attribute__((unused)), void *parent __attribute__((unused))) { struct acl_cblock *aclcb = NULL; @@ -432,7 +432,7 @@ acl__handle_config_entry (Slapi_Entry *e, void *callback_data ) } static int -acl__handle_plugin_config_entry (Slapi_Entry *e, void *callback_data ) +acl__handle_plugin_config_entry (Slapi_Entry *e, void *callback_data __attribute__((unused))) { int value = slapi_entry_attr_get_int(e, ATTR_ACLPB_MAX_SELECTED_ACLS); if (value) { diff --git a/ldap/servers/plugins/acl/acleffectiverights.c b/ldap/servers/plugins/acl/acleffectiverights.c index 1e940a3..2414ef4 100644 --- a/ldap/servers/plugins/acl/acleffectiverights.c +++ b/ldap/servers/plugins/acl/acleffectiverights.c @@ -302,11 +302,11 @@ _ger_release_gerpb ( static int _ger_new_gerpb ( Slapi_PBlock *pb, - Slapi_Entry *e, + Slapi_Entry *e __attribute__((unused)), const char *subjectndn, Slapi_PBlock **gerpb, void **aclcb, /* original aclcb */ - char **errbuf + char **errbuf __attribute__((unused)) ) { Connection *conn; @@ -389,11 +389,11 @@ unsigned long _ger_get_entry_rights ( Slapi_PBlock *gerpb, Slapi_Entry *e, - const char *subjectndn, + const char *subjectndn __attribute__((unused)), char **gerstr, size_t *gerstrsize, size_t *gerstrcap, - char **errbuf + char **errbuf __attribute__((unused)) ) { unsigned long entryrights = 0; @@ -1015,8 +1015,8 @@ acl_get_effective_rights ( Slapi_PBlock *pb, Slapi_Entry *e, /* target entry */ char **attrs, /* Attribute of the entry */ - struct berval *val, /* value of attr. NOT USED */ - int access, /* requested access rights */ + struct berval *val __attribute__((unused)), /* value of attr. NOT USED */ + int access __attribute__((unused)), /* requested access rights */ char **errbuf ) { diff --git a/ldap/servers/plugins/acl/acllas.c b/ldap/servers/plugins/acl/acllas.c index 627f300..856f483 100644 --- a/ldap/servers/plugins/acl/acllas.c +++ b/ldap/servers/plugins/acl/acllas.c @@ -249,7 +249,7 @@ acllas_eval_one_target_filter( char * str, Slapi_Entry *e); int DS_LASIpGetter(NSErr_t *errp, PList_t subject, PList_t resource, PList_t - auth_info, PList_t global_auth, void *arg) + auth_info, PList_t global_auth, void *arg __attribute__((unused))) { struct acl_pblock *aclpb = NULL; PRNetAddr *client_praddr = NULL; @@ -303,7 +303,7 @@ DS_LASIpGetter(NSErr_t *errp, PList_t subject, PList_t resource, PList_t int DS_LASDnsGetter(NSErr_t *errp, PList_t subject, PList_t resource, PList_t - auth_info, PList_t global_auth, void *arg) + auth_info, PList_t global_auth, void *arg __attribute__((unused))) { struct acl_pblock *aclpb = NULL; PRNetAddr client_praddr; @@ -390,10 +390,10 @@ DS_LASDnsGetter(NSErr_t *errp, PList_t subject, PList_t resource, PList_t /* */ /***************************************************************************/ int -DS_LASUserEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator, - char *attr_pattern, int *cachable, void **LAS_cookie, - PList_t subject, PList_t resource, PList_t auth_info, - PList_t global_auth) +DS_LASUserEval(NSErr_t *errp __attribute__((unused)), char *attr_name __attribute__((unused)), CmpOp_t comparator __attribute__((unused)), + char *attr_pattern __attribute__((unused)), int *cachable __attribute__((unused)), void **LAS_cookie __attribute__((unused)), + PList_t subject __attribute__((unused)), PList_t resource __attribute__((unused)), PList_t auth_info __attribute__((unused)), + PList_t global_auth __attribute__((unused))) { slapi_log_err(SLAPI_LOG_ERR, plugin_name, "DS_LASUserEval - User LAS is not supported in the ACL\n"); @@ -402,10 +402,10 @@ DS_LASUserEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator, } int -DS_LASGroupEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator, - char *attr_pattern, int *cachable, void **LAS_cookie, - PList_t subject, PList_t resource, PList_t auth_info, - PList_t global_auth) +DS_LASGroupEval(NSErr_t *errp __attribute__((unused)), char *attr_name __attribute__((unused)), CmpOp_t comparator __attribute__((unused)), + char *attr_pattern __attribute__((unused)), int *cachable __attribute__((unused)), void **LAS_cookie __attribute__((unused)), + PList_t subject __attribute__((unused)), PList_t resource __attribute__((unused)), PList_t auth_info __attribute__((unused)), + PList_t global_auth __attribute__((unused))) { slapi_log_err(SLAPI_LOG_ERR, plugin_name, "DS_LASGroupEval - Group LAS is not supported in the ACL\n"); @@ -1407,10 +1407,10 @@ DS_LASUserDnAttrEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator, * **************************************************************************/ int -DS_LASLdapUrlAttrEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator, - char *attr_pattern, int *cachable, void **LAS_cookie, - PList_t subject, PList_t resource, PList_t auth_info, - PList_t global_auth, lasInfo lasinfo) +DS_LASLdapUrlAttrEval(NSErr_t *errp __attribute__((unused)), char *attr_name __attribute__((unused)), CmpOp_t comparator, + char *attr_pattern, int *cachable __attribute__((unused)), void **LAS_cookie __attribute__((unused)), + PList_t subject __attribute__((unused)), PList_t resource __attribute__((unused)), PList_t auth_info __attribute__((unused)), + PList_t global_auth __attribute__((unused)), lasInfo lasinfo) { char *n_currEntryDn = NULL; @@ -4148,7 +4148,7 @@ aclutil_evaluate_macro( char * rule, lasInfo *lasinfo, */ static char ** -acllas_replace_dn_macro( char *rule, char *matched_val, lasInfo *lasinfo) { +acllas_replace_dn_macro( char *rule, char *matched_val, lasInfo *lasinfo __attribute__((unused))) { char **a = NULL; char *patched_rule = NULL; diff --git a/ldap/servers/plugins/acl/acllist.c b/ldap/servers/plugins/acl/acllist.c index e907f1e..dd19ae2 100644 --- a/ldap/servers/plugins/acl/acllist.c +++ b/ldap/servers/plugins/acl/acllist.c @@ -106,7 +106,7 @@ acllist_free(void) * */ -void acl_be_state_change_fnc ( void *handle, char *be_name, int old_state, +void acl_be_state_change_fnc ( void *handle __attribute__((unused)), char *be_name, int old_state, int new_state) { Slapi_Backend *be=NULL; const Slapi_DN *sdn; @@ -314,7 +314,7 @@ __acllist_aciContainer_node_cmp ( caddr_t d1, caddr_t d2 ) } static int -__acllist_aciContainer_node_dup ( caddr_t d1, caddr_t d2 ) +__acllist_aciContainer_node_dup ( caddr_t d1 __attribute__((unused)), caddr_t d2 __attribute__((unused))) { /* we allow duplicates -- they are not exactly duplicates @@ -605,7 +605,7 @@ free_targetattrfilters( Targetattrfilter ***attrFilterArray) /* SEARCH */ void -acllist_init_scan (Slapi_PBlock *pb, int scope, const char *base) +acllist_init_scan (Slapi_PBlock *pb, int scope __attribute__((unused)), const char *base) { Acl_PBlock *aclpb; AciContainer *root; diff --git a/ldap/servers/plugins/acl/aclplugin.c b/ldap/servers/plugins/acl/aclplugin.c index bd768d1..5bae529 100644 --- a/ldap/servers/plugins/acl/aclplugin.c +++ b/ldap/servers/plugins/acl/aclplugin.c @@ -263,7 +263,7 @@ void * aclplugin_get_identity(int plug) { } int -aclplugin_init (Slapi_PBlock *pb ) +aclplugin_init (Slapi_PBlock *pb __attribute__((unused))) { int rc = 0; /* OK */ @@ -273,7 +273,7 @@ aclplugin_init (Slapi_PBlock *pb ) } int -aclplugin_stop ( Slapi_PBlock *pb ) +aclplugin_stop ( Slapi_PBlock *pb __attribute__((unused))) { int rc = 0; /* OK */ diff --git a/ldap/servers/plugins/acl/aclutil.c b/ldap/servers/plugins/acl/aclutil.c index 23f6e5c..b865847 100644 --- a/ldap/servers/plugins/acl/aclutil.c +++ b/ldap/servers/plugins/acl/aclutil.c @@ -124,7 +124,7 @@ acl_print_acllib_err (NSErr_t *errp , char * str) } void -aclutil_print_aci (aci_t *aci_item, char *type) +aclutil_print_aci (aci_t *aci_item, char *type __attribute__((unused))) { char str[BUFSIZ]; const char *dn; @@ -668,7 +668,7 @@ __aclutil_extract_dn_component ( char **e_dns, int position, char *attrName ) */ int -acl_dn_component_match( const char *ndn, char *match_this, int component_number) { +acl_dn_component_match( const char *ndn __attribute__((unused)), char *match_this __attribute__((unused)), int component_number __attribute__((unused))) { return(1); } @@ -1439,7 +1439,7 @@ void acl_ht_free_all_entries_and_values( acl_ht_t *acl_ht) { } static PRIntn -acl_ht_free_entry_and_value(PLHashEntry *he, PRIntn i, void *arg) +acl_ht_free_entry_and_value(PLHashEntry *he, PRIntn i __attribute__((unused)), void *arg __attribute__((unused))) { slapi_ch_free((void **)&he->value); /* free value */ @@ -1449,11 +1449,12 @@ acl_ht_free_entry_and_value(PLHashEntry *he, PRIntn i, void *arg) } /* Free all the values in the ht */ -void acl_ht_display_ht( acl_ht_t *acl_ht) { +void acl_ht_display_ht( acl_ht_t *acl_ht __attribute__((unused))) { #ifdef FOR_DEBUGGING PL_HashTableEnumerateEntries( acl_ht, acl_ht_display_entry, NULL); #endif + return; } #ifdef FOR_DEBUGGING diff --git a/ldap/servers/plugins/automember/automember.c b/ldap/servers/plugins/automember/automember.c index 2b52ae8..a74d48c 100644 --- a/ldap/servers/plugins/automember/automember.c +++ b/ldap/servers/plugins/automember/automember.c @@ -363,7 +363,7 @@ automember_start(Slapi_PBlock * pb) * Cleans up the config cache. */ static int -automember_close(Slapi_PBlock * pb) +automember_close(Slapi_PBlock * pb __attribute__((unused))) { slapi_log_err(SLAPI_LOG_TRACE, AUTOMEMBER_PLUGIN_SUBSYSTEM, "--> automember_close\n"); @@ -2008,8 +2008,8 @@ automember_task_map_destructor(Slapi_Task *task) * basedn and filter are required. If scope is omitted, the default is sub */ static int -automember_task_add(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter, - int *returncode, char *returntext, void *arg) +automember_task_add(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter __attribute__((unused)), + int *returncode, char *returntext __attribute__((unused)), void *arg) { int rv = SLAPI_DSE_CALLBACK_OK; task_data *mytaskdata = NULL; @@ -2236,8 +2236,8 @@ out: * ldif: /tmp/automem-updates.ldif */ static int -automember_task_add_export_updates(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter, - int *returncode, char *returntext, void *arg) +automember_task_add_export_updates(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter __attribute__((unused)), + int *returncode, char *returntext __attribute__((unused)), void *arg) { int rv = SLAPI_DSE_CALLBACK_OK; task_data *mytaskdata = NULL; @@ -2444,8 +2444,8 @@ out: * ldif_out: /tmp/automem-updates.ldif */ static int -automember_task_add_map_entries(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter, - int *returncode, char *returntext, void *arg) +automember_task_add_map_entries(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter __attribute__((unused)), + int *returncode, char *returntext __attribute__((unused)), void *arg) { int rv = SLAPI_DSE_CALLBACK_OK; task_data *mytaskdata = NULL; diff --git a/ldap/servers/plugins/bitwise/bitwise.c b/ldap/servers/plugins/bitwise/bitwise.c index 5ceffac..6289c53 100644 --- a/ldap/servers/plugins/bitwise/bitwise.c +++ b/ldap/servers/plugins/bitwise/bitwise.c @@ -70,7 +70,7 @@ bitwise_filter_destroy(Slapi_PBlock* pb) #define BITWISE_OP_OR 1 static int -internal_bitwise_filter_match(void* obj, Slapi_Entry* entry, Slapi_Attr* attr, int op) +internal_bitwise_filter_match(void* obj, Slapi_Entry* entry, Slapi_Attr* attr __attribute__((unused)), int op) /* returns: 0 filter matched * -1 filter did not match * >0 an LDAP error code diff --git a/ldap/servers/plugins/chainingdb/cb_abandon.c b/ldap/servers/plugins/chainingdb/cb_abandon.c index b0b0a52..a9ab910 100644 --- a/ldap/servers/plugins/chainingdb/cb_abandon.c +++ b/ldap/servers/plugins/chainingdb/cb_abandon.c @@ -23,7 +23,7 @@ */ int -chaining_back_abandon ( Slapi_PBlock *pb ) +chaining_back_abandon ( Slapi_PBlock *pb __attribute__((unused)) ) { /* * Abandon forwarded to the farm server for scoped diff --git a/ldap/servers/plugins/chainingdb/cb_acl.c b/ldap/servers/plugins/chainingdb/cb_acl.c index e8e046a..ab1e35c 100644 --- a/ldap/servers/plugins/chainingdb/cb_acl.c +++ b/ldap/servers/plugins/chainingdb/cb_acl.c @@ -19,7 +19,6 @@ */ void cb_set_acl_policy(Slapi_PBlock *pb) { - Slapi_Backend *be; cb_backend_instance *cb; int noacl; @@ -27,13 +26,14 @@ void cb_set_acl_policy(Slapi_PBlock *pb) { slapi_pblock_get( pb, SLAPI_BACKEND, &be ); cb = cb_get_instance(be); - /* disable acl checking if the local_acl flag is not set - or if the associated backend is disabled */ + /* disable acl checking if the local_acl flag is not set + or if the associated backend is disabled */ noacl=!(cb->local_acl) || cb->associated_be_is_disabled; - + + /* These branches are identical. Can we remove the if condition? */ if (noacl) { slapi_pblock_set(pb, SLAPI_PLUGIN_DB_NO_ACL, &noacl); - } else { + } else { /* Be very conservative about acl evaluation */ slapi_pblock_set(pb, SLAPI_PLUGIN_DB_NO_ACL, &noacl); } @@ -45,7 +45,7 @@ int cb_access_allowed( char *attr, /* Attribute of the entry */ struct berval *val, /* value of attr. NOT USED */ int access, /* access rights */ - char **errbuf + char **errbuf __attribute__((unused)) ) { diff --git a/ldap/servers/plugins/chainingdb/cb_bind.c b/ldap/servers/plugins/chainingdb/cb_bind.c index 663f5b0..5147193 100644 --- a/ldap/servers/plugins/chainingdb/cb_bind.c +++ b/ldap/servers/plugins/chainingdb/cb_bind.c @@ -65,9 +65,9 @@ cb_sasl_bind_s(Slapi_PBlock * pb, cb_conn_pool *pool, int tries, } static int -cb_sasl_bind_once_s( cb_conn_pool *pool, const char *dn, ber_tag_t method, - char * mechanism, struct berval *creds, - LDAPControl **reqctrls, char **matcheddnp, +cb_sasl_bind_once_s( cb_conn_pool *pool, const char *dn, ber_tag_t method __attribute__((unused)), + char * mechanism __attribute__((unused)), struct berval *creds, + LDAPControl **reqctrls, char **matcheddnp, char **errmsgp, struct berval ***refurlsp, LDAPControl ***resctrlsp , int * status ) { diff --git a/ldap/servers/plugins/chainingdb/cb_cleanup.c b/ldap/servers/plugins/chainingdb/cb_cleanup.c index 7c1ec07..dca6be1 100644 --- a/ldap/servers/plugins/chainingdb/cb_cleanup.c +++ b/ldap/servers/plugins/chainingdb/cb_cleanup.c @@ -15,16 +15,16 @@ /* ** cLeanup a chaining backend instance -*/ - -int cb_back_cleanup( Slapi_PBlock *pb ) +*/ + +int cb_back_cleanup( Slapi_PBlock *pb __attribute__((unused))) { - /* - ** Connections have been closed in cb_back_close() - ** For now, don't do more - */ + /* + ** Connections have been closed in cb_back_close() + ** For now, don't do more + */ - return 0; + return 0; } diff --git a/ldap/servers/plugins/chainingdb/cb_config.c b/ldap/servers/plugins/chainingdb/cb_config.c index 96e42da..63adb32 100644 --- a/ldap/servers/plugins/chainingdb/cb_config.c +++ b/ldap/servers/plugins/chainingdb/cb_config.c @@ -184,8 +184,12 @@ int cb_config_load_dse_info(Slapi_PBlock * pb) { /* Check validity of the modification */ -int cb_config_add_check_callback(Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* e2, int *returncode, - char *returntext, void *arg) +int cb_config_add_check_callback(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* e, + Slapi_Entry* e2 __attribute__((unused)), + int *returncode, + char *returntext __attribute__((unused)), + void *arg) { Slapi_Attr *attr = NULL; Slapi_Value *sval; @@ -224,8 +228,12 @@ int cb_config_add_check_callback(Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* */ int -cb_config_add_callback(Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* e2, int *returncode, - char *returntext, void *arg) +cb_config_add_callback(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* e, + Slapi_Entry* e2 __attribute__((unused)), + int *returncode, + char *returntext __attribute__((unused)), + void *arg) { Slapi_Attr *attr = NULL; Slapi_Value *sval; @@ -266,9 +274,13 @@ cb_config_add_callback(Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* e2, int *r return SLAPI_DSE_CALLBACK_OK; } -int -cb_config_search_callback(Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* e2, int *returncode, - char *returntext, void *arg) { +int +cb_config_search_callback(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* e, + Slapi_Entry* e2 __attribute__((unused)), + int *returncode, + char *returntext __attribute__((unused)), + void *arg) { cb_backend *cb = (cb_backend *) arg; struct berval val; @@ -337,9 +349,13 @@ cb_config_search_callback(Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* e2, int /* Check validity of the modification */ -int -cb_config_modify_check_callback(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* e, int *returncode, - char *returntext, void *arg) +int +cb_config_modify_check_callback(Slapi_PBlock *pb, + Slapi_Entry* entryBefore __attribute__((unused)), + Slapi_Entry* e __attribute__((unused)), + int *returncode, + char *returntext __attribute__((unused)), + void *arg) { LDAPMod **mods; char *attr_name; @@ -370,9 +386,13 @@ cb_config_modify_check_callback(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slap return SLAPI_DSE_CALLBACK_OK; } -int -cb_config_modify_callback(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* e, int *returncode, - char *returntext, void *arg) +int +cb_config_modify_callback(Slapi_PBlock *pb, + Slapi_Entry* entryBefore __attribute__((unused)), + Slapi_Entry* e __attribute__((unused)), + int *returncode, + char *returntext __attribute__((unused)), + void *arg) { LDAPMod **mods; char *attr_name; @@ -510,9 +530,13 @@ cb_config_modify_callback(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entr ** Creation of a new backend instance */ -int -cb_config_add_instance_callback(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* e, int *returncode, - char *returntext, void *arg) +int +cb_config_add_instance_callback(Slapi_PBlock *pb, + Slapi_Entry* entryBefore, + Slapi_Entry* e __attribute__((unused)), + int *returncode, + char *returntext, + void *arg) { cb_backend *cb=(cb_backend *)arg; CB_ASSERT(cb!=NULL); @@ -520,9 +544,13 @@ cb_config_add_instance_callback(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slap return SLAPI_DSE_CALLBACK_OK; } -int -cb_config_add_instance_check_callback(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* e, int *returncode, - char *returntext, void *arg) +int +cb_config_add_instance_check_callback(Slapi_PBlock *pb, + Slapi_Entry* entryBefore, + Slapi_Entry* e __attribute__((unused)), + int *returncode, + char *returntext, + void *arg) { cb_backend *cb=(cb_backend *)arg; CB_ASSERT(cb!=NULL); diff --git a/ldap/servers/plugins/chainingdb/cb_controls.c b/ldap/servers/plugins/chainingdb/cb_controls.c index 747f34b..b3b6132 100644 --- a/ldap/servers/plugins/chainingdb/cb_controls.c +++ b/ldap/servers/plugins/chainingdb/cb_controls.c @@ -19,12 +19,12 @@ static char * unsupported_ctrls[] = {LDAP_CONTROL_PERSISTENTSEARCH,NULL}; -int cb_is_control_forwardable(cb_backend * cb, char *controloid) { +int cb_is_control_forwardable(cb_backend * cb __attribute__((unused)), char *controloid) { return (!(charray_inlist(unsupported_ctrls,controloid))); } void -cb_register_supported_control( cb_backend * cb, char *controloid, unsigned long controlops ) +cb_register_supported_control( cb_backend * cb, char *controloid, unsigned long controlops __attribute__((unused))) { /* For now, ignore controlops */ if ( controloid != NULL ) { diff --git a/ldap/servers/plugins/chainingdb/cb_instance.c b/ldap/servers/plugins/chainingdb/cb_instance.c index 1703501..683bf9c 100644 --- a/ldap/servers/plugins/chainingdb/cb_instance.c +++ b/ldap/servers/plugins/chainingdb/cb_instance.c @@ -114,8 +114,12 @@ struct berval *bval, char *err_buf, int phase, int apply_mod); int -cb_dont_allow_that(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* e, - int *returncode, char *returntext, void *arg) +cb_dont_allow_that(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* entryBefore __attribute__((unused)), + Slapi_Entry* e __attribute__((unused)), + int *returncode, + char *returntext __attribute__((unused)), + void *arg __attribute__((unused))) { *returncode=LDAP_UNWILLING_TO_PERFORM; return SLAPI_DSE_CALLBACK_ERROR; @@ -263,8 +267,12 @@ void cb_instance_free(cb_backend_instance * inst) { ** backend instance. */ -int cb_instance_modify_config_check_callback(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* e, - int *returncode, char *returntext, void *arg) { +int cb_instance_modify_config_check_callback(Slapi_PBlock *pb, + Slapi_Entry* entryBefore __attribute__((unused)), + Slapi_Entry* e __attribute__((unused)), + int *returncode, + char *returntext, + void *arg) { cb_backend_instance * inst = (cb_backend_instance *) arg; LDAPMod **mods; @@ -334,8 +342,12 @@ int cb_instance_modify_config_check_callback(Slapi_PBlock *pb, Slapi_Entry* entr ** backend instance. */ -int cb_instance_modify_config_callback(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* e, - int *returncode, char *returntext, void *arg) { +int cb_instance_modify_config_callback(Slapi_PBlock *pb, + Slapi_Entry* entryBefore __attribute__((unused)), + Slapi_Entry* e __attribute__((unused)), + int *returncode, + char *returntext, + void *arg) { cb_backend_instance * inst = (cb_backend_instance *) arg; LDAPMod **mods; @@ -875,7 +887,7 @@ static void *cb_instance_userpassword_get(void *arg) return data; } -static int cb_instance_userpassword_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int cb_instance_userpassword_set(void *arg, void *value, char *errorbuf __attribute__((unused)), int phase, int apply) { cb_backend_instance * inst=(cb_backend_instance *) arg; int rc=LDAP_SUCCESS; @@ -907,7 +919,7 @@ static void *cb_instance_sizelimit_get(void *arg) return (void *) data; } -static int cb_instance_sizelimit_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int cb_instance_sizelimit_set(void *arg, void *value, char *errorbuf __attribute__((unused)), int phase __attribute__((unused)), int apply) { cb_backend_instance * inst=(cb_backend_instance *) arg; if (apply) { @@ -931,7 +943,7 @@ static void *cb_instance_timelimit_get(void *arg) return (void *) data; } -static int cb_instance_timelimit_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int cb_instance_timelimit_set(void *arg, void *value, char *errorbuf __attribute__((unused)), int phase __attribute__((unused)), int apply) { cb_backend_instance * inst=(cb_backend_instance *) arg; if (apply) { @@ -955,7 +967,7 @@ static void *cb_instance_max_test_get(void *arg) return (void *) data; } -static int cb_instance_max_test_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int cb_instance_max_test_set(void *arg, void *value, char *errorbuf __attribute__((unused)), int phase __attribute__((unused)), int apply) { cb_backend_instance * inst=(cb_backend_instance *) arg; if (apply) { @@ -977,7 +989,7 @@ static void *cb_instance_max_idle_get(void *arg) return (void *) data; } -static int cb_instance_max_idle_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int cb_instance_max_idle_set(void *arg, void *value, char *errorbuf __attribute__((unused)), int phase __attribute__((unused)), int apply) { cb_backend_instance * inst=(cb_backend_instance *) arg; if (apply) { @@ -1000,7 +1012,7 @@ static void *cb_instance_hoplimit_get(void *arg) return (void *) data; } -static int cb_instance_hoplimit_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int cb_instance_hoplimit_set(void *arg, void *value, char *errorbuf __attribute__((unused)), int phase __attribute__((unused)), int apply) { cb_backend_instance * inst=(cb_backend_instance *) arg; if (apply) { @@ -1022,7 +1034,7 @@ static void *cb_instance_maxbconn_get(void *arg) return (void *) data; } -static int cb_instance_maxbconn_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int cb_instance_maxbconn_set(void *arg, void *value, char *errorbuf __attribute__((unused)), int phase __attribute__((unused)), int apply) { cb_backend_instance * inst=(cb_backend_instance *) arg; if (apply) { @@ -1044,7 +1056,7 @@ static void *cb_instance_maxconn_get(void *arg) return (void *) data; } -static int cb_instance_maxconn_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int cb_instance_maxconn_set(void *arg, void *value, char *errorbuf __attribute__((unused)), int phase __attribute__((unused)), int apply) { cb_backend_instance * inst=(cb_backend_instance *) arg; if (apply) { @@ -1066,7 +1078,7 @@ static void *cb_instance_abandonto_get(void *arg) return (void *) data; } -static int cb_instance_abandonto_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int cb_instance_abandonto_set(void *arg, void *value, char *errorbuf __attribute__((unused)), int phase, int apply) { cb_backend_instance * inst=(cb_backend_instance *) arg; @@ -1098,7 +1110,7 @@ static void *cb_instance_maxbconc_get(void *arg) return (void *) data; } -static int cb_instance_maxbconc_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int cb_instance_maxbconc_set(void *arg, void *value, char *errorbuf __attribute__((unused)), int phase __attribute__((unused)), int apply) { cb_backend_instance * inst=(cb_backend_instance *) arg; if (apply) { @@ -1120,7 +1132,7 @@ static void *cb_instance_maxconc_get(void *arg) return (void *) data; } -static int cb_instance_maxconc_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int cb_instance_maxconc_set(void *arg, void *value, char *errorbuf __attribute__((unused)), int phase __attribute__((unused)), int apply) { cb_backend_instance * inst=(cb_backend_instance *) arg; if (apply) { @@ -1142,7 +1154,7 @@ static void *cb_instance_imperson_get(void *arg) return (void *) data; } -static int cb_instance_imperson_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int cb_instance_imperson_set(void *arg, void *value, char *errorbuf, int phase __attribute__((unused)), int apply) { cb_backend_instance * inst=(cb_backend_instance *) arg; int rc=LDAP_SUCCESS; @@ -1183,7 +1195,7 @@ static void *cb_instance_connlife_get(void *arg) return (void *) data; } -static int cb_instance_connlife_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int cb_instance_connlife_set(void *arg, void *value, char *errorbuf __attribute__((unused)), int phase __attribute__((unused)), int apply) { cb_backend_instance * inst=(cb_backend_instance *) arg; if (apply) { @@ -1205,7 +1217,7 @@ static void *cb_instance_bindto_get(void *arg) return (void *) data; } -static int cb_instance_bindto_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int cb_instance_bindto_set(void *arg, void *value, char *errorbuf __attribute__((unused)), int phase __attribute__((unused)), int apply) { cb_backend_instance * inst=(cb_backend_instance *) arg; if (apply) { @@ -1233,7 +1245,7 @@ static void *cb_instance_opto_get(void *arg) return (void *) data; } -static int cb_instance_opto_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int cb_instance_opto_set(void *arg, void *value, char *errorbuf __attribute__((unused)), int phase __attribute__((unused)), int apply) { cb_backend_instance * inst=(cb_backend_instance *) arg; if (apply) { @@ -1256,7 +1268,7 @@ static void *cb_instance_ref_get(void *arg) return (void *) data; } -static int cb_instance_ref_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int cb_instance_ref_set(void *arg, void *value, char *errorbuf __attribute__((unused)), int phase __attribute__((unused)), int apply) { cb_backend_instance * inst=(cb_backend_instance *) arg; if (apply) { @@ -1278,7 +1290,7 @@ static void *cb_instance_acl_get(void *arg) return (void *) data; } -static int cb_instance_acl_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int cb_instance_acl_set(void *arg, void *value, char *errorbuf __attribute__((unused)), int phase, int apply) { cb_backend_instance * inst=(cb_backend_instance *) arg; @@ -1308,7 +1320,7 @@ static void *cb_instance_bindretry_get(void *arg) return (void *) data; } -static int cb_instance_bindretry_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int cb_instance_bindretry_set(void *arg, void *value, char *errorbuf __attribute__((unused)), int phase __attribute__((unused)), int apply) { cb_backend_instance * inst=(cb_backend_instance *) arg; if (apply) { @@ -1578,8 +1590,12 @@ void cb_instance_config_get(void *arg, cb_instance_config_info *config, char *bu ** won't be taken into account until the server restarts */ -int cb_instance_search_config_callback(Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAfter, - int *returncode, char *returntext, void *arg) { +int cb_instance_search_config_callback(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* e, + Slapi_Entry* entryAfter __attribute__((unused)), + int *returncode, + char *returntext __attribute__((unused)), + void *arg) { char buf[CB_BUFSIZE]; struct berval val; @@ -1663,8 +1679,12 @@ int cb_instance_search_config_callback(Slapi_PBlock *pb, Slapi_Entry* e, Slapi_E ** Ooops!!! The backend instance is being deleted */ -int cb_instance_delete_config_callback(Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* e2, - int *returncode, char *returntext, void *arg) { +int cb_instance_delete_config_callback(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* e __attribute__((unused)), + Slapi_Entry* e2 __attribute__((unused)), + int *returncode __attribute__((unused)), + char *returntext __attribute__((unused)), + void *arg) { cb_backend_instance * inst = (cb_backend_instance *) arg; int rc; @@ -1710,7 +1730,7 @@ int cb_instance_delete_config_callback(Slapi_PBlock *pb, Slapi_Entry* e, Slapi_E return SLAPI_DSE_CALLBACK_OK; } -static void cb_instance_add_monitor_later(time_t when, void *arg) { +static void cb_instance_add_monitor_later(time_t when __attribute__((unused)), void *arg) { cb_backend_instance * inst = (cb_backend_instance *) arg; @@ -1737,8 +1757,12 @@ static void cb_instance_add_monitor_later(time_t when, void *arg) { } -int cb_instance_add_config_check_callback(Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* e2, - int *returncode, char *returntext, void *arg) { +int cb_instance_add_config_check_callback(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* e, + Slapi_Entry* e2 __attribute__((unused)), + int *returncode, + char *returntext, + void *arg) { int rc=LDAP_SUCCESS; cb_backend_instance *inst; @@ -1793,8 +1817,12 @@ int cb_instance_add_config_check_callback(Slapi_PBlock *pb, Slapi_Entry* e, Slap ** : (cb_backend *) */ -int cb_instance_add_config_callback(Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* e2, - int *returncode, char *returntext, void *arg) { +int cb_instance_add_config_callback(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* e, + Slapi_Entry* e2 __attribute__((unused)), + int *returncode, + char *returntext, + void *arg) { int rc=LDAP_SUCCESS; cb_backend_instance *inst; diff --git a/ldap/servers/plugins/chainingdb/cb_monitor.c b/ldap/servers/plugins/chainingdb/cb_monitor.c index dbe67b3..f541c90 100644 --- a/ldap/servers/plugins/chainingdb/cb_monitor.c +++ b/ldap/servers/plugins/chainingdb/cb_monitor.c @@ -46,7 +46,12 @@ extern cb_instance_config_info cb_the_instance_config[]; */ int -cb_search_monitor_callback(Slapi_PBlock * pb, Slapi_Entry * e, Slapi_Entry * entryAfter, int * returnCode, char * returnText, void * arg) +cb_search_monitor_callback(Slapi_PBlock * pb __attribute__((unused)), + Slapi_Entry * e, + Slapi_Entry * entryAfter __attribute__((unused)), + int * returnCode, + char * returnText __attribute__((unused)), + void * arg) { char buf[CB_BUFSIZE]; @@ -219,7 +224,12 @@ cb_update_monitor_info(Slapi_PBlock * pb, cb_backend_instance * inst,int op) int -cb_delete_monitor_callback(Slapi_PBlock * pb, Slapi_Entry * e, Slapi_Entry * entryAfter, int * returnCode, char * returnText, void * arg) +cb_delete_monitor_callback(Slapi_PBlock * pb __attribute__((unused)), + Slapi_Entry * e __attribute__((unused)), + Slapi_Entry * entryAfter __attribute__((unused)), + int * returnCode, + char * returnText __attribute__((unused)), + void * arg) { cb_backend_instance *inst = (cb_backend_instance *)arg; diff --git a/ldap/servers/plugins/chainingdb/cb_search.c b/ldap/servers/plugins/chainingdb/cb_search.c index 2cd8221..dad2785 100644 --- a/ldap/servers/plugins/chainingdb/cb_search.c +++ b/ldap/servers/plugins/chainingdb/cb_search.c @@ -728,7 +728,7 @@ chainingdb_next_search_entry ( Slapi_PBlock *pb ) } int -chaining_back_entry_release ( Slapi_PBlock *pb ) { +chaining_back_entry_release ( Slapi_PBlock *pb __attribute__((unused))) { slapi_log_err(SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, "chaining_back_entry_release\n"); return 0; } diff --git a/ldap/servers/plugins/chainingdb/cb_utils.c b/ldap/servers/plugins/chainingdb/cb_utils.c index 6d01c62..21195b6 100644 --- a/ldap/servers/plugins/chainingdb/cb_utils.c +++ b/ldap/servers/plugins/chainingdb/cb_utils.c @@ -308,7 +308,7 @@ void cb_set_debug(int on) { set associated_be_is_disabled */ void -cb_be_state_change (void *handle, char *be_name, int old_be_state, int new_be_state) +cb_be_state_change (void *handle __attribute__((unused)), char *be_name, int old_be_state __attribute__((unused)), int new_be_state) { const Slapi_DN *tmpsdn; Slapi_DN *the_be_suffix; diff --git a/ldap/servers/plugins/collation/collate.c b/ldap/servers/plugins/collation/collate.c index 0e1d528..9666592 100644 --- a/ldap/servers/plugins/collation/collate.c +++ b/ldap/servers/plugins/collation/collate.c @@ -24,10 +24,11 @@ #include /* for strcasecmp on non-UNIX platforms and correct debug macro */ void -collation_init( char *configpath ) +collation_init( char *configpath __attribute__((unused))) /* Called once per process, to initialize globals. */ { /* ICU needs no initialization? */ + return; } typedef struct coll_profile_t { /* Collator characteristics */ diff --git a/ldap/servers/plugins/cos/cos.c b/ldap/servers/plugins/cos/cos.c index 5234b2b..4d44226 100644 --- a/ldap/servers/plugins/cos/cos.c +++ b/ldap/servers/plugins/cos/cos.c @@ -189,7 +189,7 @@ bailout: and inits the cos cache. It is called after cos_init. */ -int cos_start( Slapi_PBlock *pb ) +int cos_start( Slapi_PBlock *pb __attribute__((unused))) { int ret = 0; @@ -217,7 +217,7 @@ int cos_start( Slapi_PBlock *pb ) --------- closes down the cache */ -int cos_close( Slapi_PBlock *pb ) +int cos_close( Slapi_PBlock *pb __attribute__((unused))) { slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_close\n"); @@ -243,7 +243,10 @@ int cos_close( Slapi_PBlock *pb ) 1 on outright failure -1 when doesn't know about attribute */ -int cos_compute(computed_attr_context *c,char* type,Slapi_Entry *e,slapi_compute_output_t outputfn) +int cos_compute(computed_attr_context *c __attribute__((unused)), + char* type __attribute__((unused)), + Slapi_Entry *e __attribute__((unused)), + slapi_compute_output_t outputfn __attribute__((unused))) { int ret = -1; diff --git a/ldap/servers/plugins/cos/cos_cache.c b/ldap/servers/plugins/cos/cos_cache.c index 8942254..00cae9c 100644 --- a/ldap/servers/plugins/cos/cos_cache.c +++ b/ldap/servers/plugins/cos/cos_cache.c @@ -376,7 +376,7 @@ out: "skipping cos definition cn=cosPointerGenerateSt,ou=People,o=cosAll--no templates found" */ -static void cos_cache_wait_on_change(void *arg) +static void cos_cache_wait_on_change(void *arg __attribute__((unused))) { slapi_log_err(SLAPI_LOG_TRACE, COS_PLUGIN_SUBSYSTEM, "--> cos_cache_wait_on_change thread\n"); @@ -2122,7 +2122,16 @@ static int cos_cache_attrval_exists(cosAttrValue *pAttrs, const char *val) -static int cos_cache_vattr_get(vattr_sp_handle *handle, vattr_context *c, Slapi_Entry *e, char *type, Slapi_ValueSet** results,int *type_name_disposition, char** actual_type_name, int flags, int *free_flags, void *hint) +static int cos_cache_vattr_get(vattr_sp_handle *handle __attribute__((unused)), + vattr_context *c, + Slapi_Entry *e, + char *type, + Slapi_ValueSet** results, + int *type_name_disposition, + char** actual_type_name, + int flags __attribute__((unused)), + int *free_flags, + void *hint __attribute__((unused))) { cos_cache *pCache = 0; int indirect_cos = 0; @@ -2159,7 +2168,14 @@ bail: } -static int cos_cache_vattr_compare(vattr_sp_handle *handle, vattr_context *c, Slapi_Entry *e, char *type, Slapi_Value *test_this, int* result, int flags, void *hint) +static int cos_cache_vattr_compare(vattr_sp_handle *handle __attribute__((unused)), + vattr_context *c, + Slapi_Entry *e, + char *type, + Slapi_Value *test_this, + int* result, + int flags __attribute__((unused)), + void *hint __attribute__((unused))) { int ret = -1; cos_cache *pCache = 0; @@ -2187,8 +2203,10 @@ bail: * this imp is damn slow * */ -static int cos_cache_vattr_types(vattr_sp_handle *handle,Slapi_Entry *e, - vattr_type_list_context *type_context,int flags) +static int cos_cache_vattr_types(vattr_sp_handle *handle __attribute__((unused)), + Slapi_Entry *e, + vattr_type_list_context *type_context, + int flags __attribute__((unused))) { int ret = 0; int index = 0; @@ -3610,8 +3628,10 @@ static int cos_cache_follow_pointer( vattr_context *c, const char *dn, char *typ * We simply signal to rebuild the cos cache in this case * */ -void cos_cache_backend_state_change(void *handle, char *be_name, - int old_be_state, int new_be_state) +void cos_cache_backend_state_change(void *handle __attribute__((unused)), + char *be_name __attribute__((unused)), + int old_be_state __attribute__((unused)), + int new_be_state __attribute__((unused))) { slapi_lock_mutex(change_lock); slapi_notify_condvar( something_changed, 1 ); diff --git a/ldap/servers/plugins/deref/deref.c b/ldap/servers/plugins/deref/deref.c index b5dec11..d35bea9 100644 --- a/ldap/servers/plugins/deref/deref.c +++ b/ldap/servers/plugins/deref/deref.c @@ -202,7 +202,7 @@ deref_init(Slapi_PBlock *pb) * Creates config lock and loads config cache. */ static int -deref_start(Slapi_PBlock * pb) +deref_start(Slapi_PBlock * pb __attribute__((unused))) { slapi_log_err(SLAPI_LOG_TRACE, DEREF_PLUGIN_SUBSYSTEM, "--> deref_start\n"); @@ -222,7 +222,7 @@ deref_start(Slapi_PBlock * pb) * Cleans up the config cache. */ static int -deref_close(Slapi_PBlock * pb) +deref_close(Slapi_PBlock * pb __attribute__((unused))) { slapi_log_err(SLAPI_LOG_TRACE, DEREF_PLUGIN_SUBSYSTEM, "--> deref_close\n"); @@ -386,7 +386,7 @@ deref_parse_ctrl_value(DerefSpecList *speclist, const struct berval *ctrlbv, int } static int -deref_incompatible_ctrl(const char *oid) +deref_incompatible_ctrl(const char *oid __attribute__((unused))) { return 0; /* no known incompatible ctrls yet */ } @@ -756,7 +756,7 @@ deref_pre_entry(Slapi_PBlock *pb) /* consumer operation extension constructor */ static void * -deref_operation_extension_ctor(void *object, void *parent) +deref_operation_extension_ctor(void *object __attribute__((unused)), void *parent __attribute__((unused))) { /* we only set the extension value explicitly if the client requested the control - see deref_pre_search */ @@ -765,7 +765,7 @@ deref_operation_extension_ctor(void *object, void *parent) /* consumer operation extension destructor */ static void -deref_operation_extension_dtor(void *ext, void *object, void *parent) +deref_operation_extension_dtor(void *ext, void *object __attribute__((unused)), void *parent __attribute__((unused))) { DerefSpecList *speclist = (DerefSpecList *)ext; delete_DerefSpecList(&speclist); diff --git a/ldap/servers/plugins/distrib/distrib.c b/ldap/servers/plugins/distrib/distrib.c index 7cf1a88..ee60316 100644 --- a/ldap/servers/plugins/distrib/distrib.c +++ b/ldap/servers/plugins/distrib/distrib.c @@ -53,7 +53,7 @@ * This example only works for a flat namespace below the node DN */ int alpha_distribution(Slapi_PBlock *pb, Slapi_DN * target_dn, - char **mtn_be_names, int be_count, Slapi_DN * node_dn) + char **mtn_be_names __attribute__((unused)), int be_count, Slapi_DN * node_dn) { unsigned long op_type; Slapi_Operation *op; @@ -102,7 +102,7 @@ int alpha_distribution(Slapi_PBlock *pb, Slapi_DN * target_dn, * Distribute the entries based on a simple hash algorithme */ int hash_distribution(Slapi_PBlock *pb, Slapi_DN * target_dn, - char **mtn_be_names, int be_count, Slapi_DN * node_dn) + char **mtn_be_names __attribute__((unused)), int be_count, Slapi_DN * node_dn) { unsigned long op_type; Slapi_Operation *op; @@ -161,8 +161,8 @@ int hash_distribution(Slapi_PBlock *pb, Slapi_DN * target_dn, * backend in the mapping tree node * */ -int chaining_distribution(Slapi_PBlock *pb, Slapi_DN * target_dn, - char **mtn_be_names, int be_count, Slapi_DN * node_dn) +int chaining_distribution(Slapi_PBlock *pb, Slapi_DN * target_dn __attribute__((unused)), + char **mtn_be_names, int be_count, Slapi_DN * node_dn __attribute__((unused))) { char * requestor_dn; unsigned long op_type; diff --git a/ldap/servers/plugins/dna/dna.c b/ldap/servers/plugins/dna/dna.c index 34011b9..bcde83c 100644 --- a/ldap/servers/plugins/dna/dna.c +++ b/ldap/servers/plugins/dna/dna.c @@ -677,7 +677,7 @@ dna_start(Slapi_PBlock * pb) closes down the cache */ static int -dna_close(Slapi_PBlock * pb) +dna_close(Slapi_PBlock * pb __attribute__((unused))) { slapi_log_err(SLAPI_LOG_TRACE, DNA_PLUGIN_SUBSYSTEM, "--> dna_close\n"); @@ -1570,7 +1570,7 @@ dna_load_host_port(void) * config is used, and then freed. */ static void -dna_update_config_event(time_t event_time, void *arg) +dna_update_config_event(time_t event_time __attribute__((unused)), void *arg __attribute__((unused))) { Slapi_PBlock *pb = NULL; struct configEntry *config_entry = NULL; @@ -2450,7 +2450,7 @@ static int dna_get_next_value(struct configEntry *config_entry, LDAPMod *mods[2]; char *replace_val[2]; /* 16 for max 64-bit unsigned plus the trailing '\0' */ - char next_value[17]; + char next_value[22] = {0}; PRUint64 setval = 0; PRUint64 nextval = 0; int ret; @@ -2605,7 +2605,7 @@ dna_update_shared_config(struct configEntry *config_entry) LDAPMod *mods[2]; char *replace_val[2]; /* 16 for max 64-bit unsigned plus the trailing '\0' */ - char remaining_vals[17]; + char remaining_vals[22]; /* We store the number of remaining assigned values * in the shared config entry. */ @@ -2705,7 +2705,7 @@ dna_update_next_range(struct configEntry *config_entry, LDAPMod *mods[2]; char *replace_val[2]; /* 32 for the two numbers, 1 for the '-', and one for the '\0' */ - char nextrange_value[34]; + char nextrange_value[44]; int ret = 0; /* Try to set the new next range in the config entry. */ @@ -2773,8 +2773,8 @@ dna_activate_next_range(struct configEntry *config_entry) char *nextval_vals[2]; char *nextrange_vals[1]; /* 16 for max 64-bit unsigned plus the trailing '\0' */ - char maxval_val[17]; - char nextval_val[17]; + char maxval_val[22]; + char nextval_val[22]; int ret = 0; /* Setup the modify operation for the config entry */ @@ -4407,8 +4407,8 @@ static int dna_extend_exop(Slapi_PBlock *pb) struct berval *respdata = NULL; struct berval range_low = {0, NULL}; struct berval range_high = {0, NULL}; - char lowstr[16]; - char highstr[16]; + char lowstr[22]; + char highstr[22]; /* Create the exop response */ snprintf(lowstr, sizeof(lowstr), "%" NSPRIu64, lower); @@ -4515,7 +4515,7 @@ dna_release_range(char *range_dn, PRUint64 *lower, PRUint64 *upper) LDAPMod *mods[2]; char *replace_val[2]; /* 16 for max 64-bit unsigned plus the trailing '\0' */ - char max_value[17]; + char max_value[22]; /* Need to bail if we're performing a range request * for this range. This is to prevent the case where two diff --git a/ldap/servers/plugins/http/http_client.c b/ldap/servers/plugins/http/http_client.c index 719add0..2a25f51 100644 --- a/ldap/servers/plugins/http/http_client.c +++ b/ldap/servers/plugins/http/http_client.c @@ -107,7 +107,7 @@ int http_client_init(Slapi_PBlock *pb) return status; } -static int http_client_start(Slapi_PBlock *pb) +static int http_client_start(Slapi_PBlock *pb __attribute__((unused))) { int status = HTTP_SUCCESS; /** @@ -135,7 +135,7 @@ static int http_client_start(Slapi_PBlock *pb) return status; } -static int http_client_close(Slapi_PBlock *pb) +static int http_client_close(Slapi_PBlock *pb __attribute__((unused))) { int status = HTTP_SUCCESS; /** diff --git a/ldap/servers/plugins/http/http_impl.c b/ldap/servers/plugins/http/http_impl.c index a03c5f2..7accdf6 100644 --- a/ldap/servers/plugins/http/http_impl.c +++ b/ldap/servers/plugins/http/http_impl.c @@ -1060,7 +1060,7 @@ authCertificate(void *arg, PRFileDesc *socket, } SECStatus -badCertHandler(void *arg, PRFileDesc *socket) +badCertHandler(void *arg, PRFileDesc *socket __attribute__((unused))) { SECStatus secStatus = SECFailure; @@ -1171,7 +1171,7 @@ SECStatus } SECStatus -handshakeCallback(PRFileDesc *socket, void *arg) +handshakeCallback(PRFileDesc *socket __attribute__((unused)), void *arg __attribute__((unused))) { slapi_log_err(SLAPI_LOG_PLUGIN, HTTP_PLUGIN_SUBSYSTEM, "handshakeCallback - Handshake has completed, ready to send data securely.\n"); diff --git a/ldap/servers/plugins/linkedattrs/fixup_task.c b/ldap/servers/plugins/linkedattrs/fixup_task.c index 5648db0..8dfc407 100644 --- a/ldap/servers/plugins/linkedattrs/fixup_task.c +++ b/ldap/servers/plugins/linkedattrs/fixup_task.c @@ -29,9 +29,12 @@ static const char *fetch_attr(Slapi_Entry *e, const char *attrname, * Function Implementations */ int -linked_attrs_fixup_task_add(Slapi_PBlock *pb, Slapi_Entry *e, - Slapi_Entry *eAfter, int *returncode, - char *returntext, void *arg) +linked_attrs_fixup_task_add(Slapi_PBlock *pb, + Slapi_Entry *e, + Slapi_Entry *eAfter __attribute__((unused)), + int *returncode, + char *returntext __attribute__((unused)), + void *arg) { PRThread *thread = NULL; int rv = SLAPI_DSE_CALLBACK_OK; diff --git a/ldap/servers/plugins/linkedattrs/linked_attrs.c b/ldap/servers/plugins/linkedattrs/linked_attrs.c index d046542..31664d5 100644 --- a/ldap/servers/plugins/linkedattrs/linked_attrs.c +++ b/ldap/servers/plugins/linkedattrs/linked_attrs.c @@ -347,7 +347,7 @@ linked_attrs_start(Slapi_PBlock * pb) * Cleans up the config cache. */ static int -linked_attrs_close(Slapi_PBlock * pb) +linked_attrs_close(Slapi_PBlock * pb __attribute__((unused))) { slapi_log_err(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, "--> linked_attrs_close\n"); @@ -1280,7 +1280,7 @@ linked_attrs_del_backpointers(Slapi_PBlock *pb, char *linkdn, */ static int linked_attrs_replace_backpointers(Slapi_PBlock *pb, char *linkdn, - struct configEntry *config, Slapi_Mod *smod) + struct configEntry *config, Slapi_Mod *smod __attribute__((unused))) { Slapi_Entry *pre_e = NULL; Slapi_Entry *post_e = NULL; diff --git a/ldap/servers/plugins/memberof/memberof.c b/ldap/servers/plugins/memberof/memberof.c index 81ef092..899358d 100644 --- a/ldap/servers/plugins/memberof/memberof.c +++ b/ldap/servers/plugins/memberof/memberof.c @@ -471,7 +471,7 @@ bail: * Do plugin shut down stuff * */ -int memberof_postop_close(Slapi_PBlock *pb) +int memberof_postop_close(Slapi_PBlock *pb __attribute__((unused))) { slapi_log_err(SLAPI_LOG_TRACE, MEMBEROF_PLUGIN_SUBSYSTEM, "--> memberof_postop_close\n" ); @@ -776,7 +776,7 @@ add_ancestors_cbdata(memberof_cached_value *ancestors, void *callback_data) * could want type to be either "member" or "memberOf" depending on the case. */ int -memberof_call_foreach_dn(Slapi_PBlock *pb, Slapi_DN *sdn, +memberof_call_foreach_dn(Slapi_PBlock *pb __attribute__((unused)), Slapi_DN *sdn, MemberOfConfig *config, char **types, plugin_search_entry_callback callback, void *callback_data, int *cached) { Slapi_PBlock *search_pb = NULL; @@ -3111,9 +3111,12 @@ const char *fetch_attr(Slapi_Entry *e, const char *attrname, return slapi_value_get_string(val); } -int memberof_task_add(Slapi_PBlock *pb, Slapi_Entry *e, - Slapi_Entry *eAfter, int *returncode, char *returntext, - void *arg) +int memberof_task_add(Slapi_PBlock *pb, + Slapi_Entry *e, + Slapi_Entry *eAfter __attribute__((unused)), + int *returncode, + char *returntext __attribute__((unused)), + void *arg) { PRThread *thread = NULL; int rv = SLAPI_DSE_CALLBACK_OK; @@ -3594,7 +3597,7 @@ static PLHashTable *hashtable_new() memberof_hash_compare_values, NULL, NULL); } /* this function called for each hash node during hash destruction */ -static PRIntn fixup_hashtable_remove(PLHashEntry *he, PRIntn index, void *arg) +static PRIntn fixup_hashtable_remove(PLHashEntry *he, PRIntn index __attribute__((unused)), void *arg __attribute__((unused))) { char *dn_copy; @@ -3638,19 +3641,20 @@ void ancestor_hashtable_entry_free(memberof_cached_value *entry) slapi_ch_free((void**) &entry[i].key); } /* this function called for each hash node during hash destruction */ -static PRIntn ancestor_hashtable_remove(PLHashEntry *he, PRIntn index, void *arg) +static PRIntn ancestor_hashtable_remove(PLHashEntry *he, PRIntn index __attribute__((unused)), void *arg __attribute__((unused))) { - memberof_cached_value *group_ancestor_array; + memberof_cached_value *group_ancestor_array; - if (he == NULL) - return HT_ENUMERATE_NEXT; + if (he == NULL) { + return HT_ENUMERATE_NEXT; + } - group_ancestor_array = (memberof_cached_value *) he->value; - ancestor_hashtable_entry_free(group_ancestor_array); - slapi_ch_free((void **)&group_ancestor_array); + group_ancestor_array = (memberof_cached_value *) he->value; + ancestor_hashtable_entry_free(group_ancestor_array); + slapi_ch_free((void **)&group_ancestor_array); - return HT_ENUMERATE_REMOVE; + return HT_ENUMERATE_REMOVE; } static void ancestor_hashtable_empty(char *msg) diff --git a/ldap/servers/plugins/memberof/memberof_config.c b/ldap/servers/plugins/memberof/memberof_config.c index c3474bf..522bfb7 100644 --- a/ldap/servers/plugins/memberof/memberof_config.c +++ b/ldap/servers/plugins/memberof/memberof_config.c @@ -36,8 +36,12 @@ */ static int memberof_validate_config (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* e, int *returncode, char *returntext, void *arg); -static int memberof_search (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* e, - int *returncode, char *returntext, void *arg) +static int memberof_search (Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* entryBefore __attribute__((unused)), + Slapi_Entry* e __attribute__((unused)), + int *returncode __attribute__((unused)), + char *returntext __attribute__((unused)), + void *arg __attribute__((unused))) { return SLAPI_DSE_CALLBACK_OK; } @@ -53,8 +57,12 @@ static Slapi_RWLock *memberof_config_lock = 0; static int inited = 0; -static int dont_allow_that(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* e, - int *returncode, char *returntext, void *arg) +static int dont_allow_that(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* entryBefore __attribute__((unused)), + Slapi_Entry* e __attribute__((unused)), + int *returncode, + char *returntext __attribute__((unused)), + void *arg __attribute__((unused))) { *returncode = LDAP_UNWILLING_TO_PERFORM; return SLAPI_DSE_CALLBACK_ERROR; @@ -63,7 +71,7 @@ static int dont_allow_that(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Ent static void memberof_free_scope(Slapi_DN **scopes, int *count) { - int i = 0; + size_t i = 0; while(scopes && scopes[i]){ slapi_sdn_free(&scopes[i]); @@ -169,8 +177,12 @@ memberof_release_config() * Validate the pending changes in the e entry. */ int -memberof_validate_config (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* e, - int *returncode, char *returntext, void *arg) +memberof_validate_config (Slapi_PBlock *pb, + Slapi_Entry* entryBefore __attribute__((unused)), + Slapi_Entry* e, + int *returncode, + char *returntext, + void *arg __attribute__((unused))) { Slapi_Attr *memberof_attr = NULL; Slapi_Attr *group_attr = NULL; @@ -448,8 +460,12 @@ done: * memberof_validate_config() must have already been called. */ int -memberof_apply_config (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* e, - int *returncode, char *returntext, void *arg) +memberof_apply_config (Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* entryBefore __attribute__((unused)), + Slapi_Entry* e, + int *returncode, + char *returntext, + void *arg __attribute__((unused))) { Slapi_Entry *config_entry = NULL; Slapi_DN *config_sdn = NULL; diff --git a/ldap/servers/plugins/mep/mep.c b/ldap/servers/plugins/mep/mep.c index 7c4c8a1..558a7fb 100644 --- a/ldap/servers/plugins/mep/mep.c +++ b/ldap/servers/plugins/mep/mep.c @@ -359,7 +359,7 @@ mep_start(Slapi_PBlock * pb) * Cleans up the config cache. */ static int -mep_close(Slapi_PBlock * pb) +mep_close(Slapi_PBlock * pb __attribute__((unused))) { slapi_log_err(SLAPI_LOG_TRACE, MEP_PLUGIN_SUBSYSTEM, "--> mep_close\n"); diff --git a/ldap/servers/plugins/pam_passthru/pam_ptimpl.c b/ldap/servers/plugins/pam_passthru/pam_ptimpl.c index 5073ff7..e3d051e 100644 --- a/ldap/servers/plugins/pam_passthru/pam_ptimpl.c +++ b/ldap/servers/plugins/pam_passthru/pam_ptimpl.c @@ -62,7 +62,7 @@ struct my_pam_conv_str { * Get the PAM identity from the value of the leftmost RDN in the BIND DN. */ static char * -derive_from_bind_dn(Slapi_PBlock *pb, const Slapi_DN *bindsdn, MyStrBuf *pam_id) +derive_from_bind_dn(Slapi_PBlock *pb __attribute__((unused)), const Slapi_DN *bindsdn, MyStrBuf *pam_id) { Slapi_RDN *rdn; char *type = NULL; diff --git a/ldap/servers/plugins/posix-winsync/posix-group-func.c b/ldap/servers/plugins/posix-winsync/posix-group-func.c index 9318561..cfbfa1a 100644 --- a/ldap/servers/plugins/posix-winsync/posix-group-func.c +++ b/ldap/servers/plugins/posix-winsync/posix-group-func.c @@ -935,7 +935,7 @@ addUserToGroupMembership(Slapi_Entry *entry) } int -addGroupMembership(Slapi_Entry *entry, Slapi_Entry *ad_entry) +addGroupMembership(Slapi_Entry *entry, Slapi_Entry *ad_entry __attribute__((unused))) { int rc = 0; int i; diff --git a/ldap/servers/plugins/posix-winsync/posix-group-task.c b/ldap/servers/plugins/posix-winsync/posix-group-task.c index f010090..e804264 100644 --- a/ldap/servers/plugins/posix-winsync/posix-group-task.c +++ b/ldap/servers/plugins/posix-winsync/posix-group-task.c @@ -61,8 +61,12 @@ fetch_attr(Slapi_Entry *e, const char *attrname, const char *default_val) /* e configEntry */ int -posix_group_task_add(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter, int *returncode, - char *returntext, void *arg) +posix_group_task_add(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry *e, + Slapi_Entry *eAfter __attribute__((unused)), + int *returncode, + char *returntext __attribute__((unused)), + void *arg __attribute__((unused))) { PRThread *thread = NULL; int rv = SLAPI_DSE_CALLBACK_OK; diff --git a/ldap/servers/plugins/posix-winsync/posix-winsync-config.c b/ldap/servers/plugins/posix-winsync/posix-winsync-config.c index 614a942..5eec6e2 100644 --- a/ldap/servers/plugins/posix-winsync/posix-winsync-config.c +++ b/ldap/servers/plugins/posix-winsync/posix-winsync-config.c @@ -222,8 +222,12 @@ posix_winsync_config_free() static int -posix_winsync_apply_config(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* e, - int *returncode, char *returntext, void *arg) +posix_winsync_apply_config(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* entryBefore __attribute__((unused)), + Slapi_Entry* e, + int *returncode, + char *returntext __attribute__((unused)), + void *arg __attribute__((unused))) { PRBool mssfuSchema = PR_FALSE; PRBool mapMemberUID = PR_TRUE; diff --git a/ldap/servers/plugins/posix-winsync/posix-winsync.c b/ldap/servers/plugins/posix-winsync/posix-winsync.c index 63444e5..855079c 100644 --- a/ldap/servers/plugins/posix-winsync/posix-winsync.c +++ b/ldap/servers/plugins/posix-winsync/posix-winsync.c @@ -223,7 +223,7 @@ _check_account_lock(Slapi_Entry *ds_entry, int *isvirt) * that entry. */ static void -sync_acct_disable(void *cbdata, /* the usual domain config data */ +sync_acct_disable(void *cbdata __attribute__((unused)), /* the usual domain config data */ const Slapi_Entry *ad_entry, /* the AD entry */ Slapi_Entry *ds_entry, /* the DS entry */ int direction, /* the direction - TO_AD or TO_DS */ @@ -539,8 +539,13 @@ addNisDomainName(Slapi_Mod *smod, const Slapi_Entry *ds_entry) } static void -posix_winsync_dirsync_search_params_cb(void *cbdata, const char *agmt_dn, char **base, int *scope, - char **filter, char ***attrs, LDAPControl ***serverctrls) +posix_winsync_dirsync_search_params_cb(void *cbdata __attribute__((unused)), + const char *agmt_dn __attribute__((unused)), + char **base __attribute__((unused)), + int *scope __attribute__((unused)), + char **filter __attribute__((unused)), + char ***attrs __attribute__((unused)), + LDAPControl ***serverctrls __attribute__((unused))) { slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> posix_winsync_dirsync_search_params_cb -- begin\n"); @@ -553,8 +558,13 @@ posix_winsync_dirsync_search_params_cb(void *cbdata, const char *agmt_dn, char * /* called before searching for a single entry from AD - agmt_dn will be NULL */ static void -posix_winsync_pre_ad_search_cb(void *cbdata, const char *agmt_dn, char **base, int *scope, - char **filter, char ***attrs, LDAPControl ***serverctrls) +posix_winsync_pre_ad_search_cb(void *cbdata __attribute__((unused)), + const char *agmt_dn __attribute__((unused)), + char **base __attribute__((unused)), + int *scope __attribute__((unused)), + char **filter __attribute__((unused)), + char ***attrs __attribute__((unused)), + LDAPControl ***serverctrls __attribute__((unused))) { slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> posix_winsync_pre_ad_search_cb -- begin\n"); @@ -567,8 +577,13 @@ posix_winsync_pre_ad_search_cb(void *cbdata, const char *agmt_dn, char **base, i /* called before an internal search to get a single DS entry - agmt_dn will be NULL */ static void -posix_winsync_pre_ds_search_entry_cb(void *cbdata, const char *agmt_dn, char **base, int *scope, - char **filter, char ***attrs, LDAPControl ***serverctrls) +posix_winsync_pre_ds_search_entry_cb(void *cbdata __attribute__((unused)), + const char *agmt_dn __attribute__((unused)), + char **base, + int *scope, + char **filter, + char ***attrs __attribute__((unused)), + LDAPControl ***serverctrls __attribute__((unused))) { /* char *tmpbase=slapi_ch_strdup(*base); @@ -603,8 +618,13 @@ posix_winsync_pre_ds_search_entry_cb(void *cbdata, const char *agmt_dn, char **b /* called before the total update to get all entries from the DS to sync to AD */ static void -posix_winsync_pre_ds_search_all_cb(void *cbdata, const char *agmt_dn, char **base, int *scope, - char **filter, char ***attrs, LDAPControl ***serverctrls) +posix_winsync_pre_ds_search_all_cb(void *cbdata __attribute__((unused)), + const char *agmt_dn __attribute__((unused)), + char **base __attribute__((unused)), + int *scope __attribute__((unused)), + char **filter, + char ***attrs __attribute__((unused)), + LDAPControl ***serverctrls __attribute__((unused))) { slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> posix_winsync_pre_ds_search_all_cb -- orig filter [%s] -- begin\n", @@ -715,8 +735,12 @@ posix_winsync_pre_ad_mod_user_cb(void *cbdata, const Slapi_Entry *rawentry, Slap } static void -posix_winsync_pre_ad_mod_group_cb(void *cbdata, const Slapi_Entry *rawentry, Slapi_Entry *ad_entry, - Slapi_Entry *ds_entry, Slapi_Mods *smods, int *do_modify) +posix_winsync_pre_ad_mod_group_cb(void *cbdata __attribute__((unused)), + const Slapi_Entry *rawentry __attribute__((unused)), + Slapi_Entry *ad_entry, + Slapi_Entry *ds_entry, + Slapi_Mods *smods, + int *do_modify) { LDAPMod *mod = NULL; int rc = 0; @@ -834,8 +858,12 @@ posix_winsync_pre_ad_mod_group_cb(void *cbdata, const Slapi_Entry *rawentry, Sla } static void -posix_winsync_pre_ds_mod_user_cb(void *cbdata, const Slapi_Entry *rawentry, Slapi_Entry *ad_entry, - Slapi_Entry *ds_entry, Slapi_Mods *smods, int *do_modify) +posix_winsync_pre_ds_mod_user_cb(void *cbdata, + const Slapi_Entry *rawentry __attribute__((unused)), + Slapi_Entry *ad_entry, + Slapi_Entry *ds_entry, + Slapi_Mods *smods, + int *do_modify) { LDAPMod* mod = NULL; Slapi_Attr *attr = NULL; @@ -994,8 +1022,12 @@ posix_winsync_pre_ds_mod_user_cb(void *cbdata, const Slapi_Entry *rawentry, Slap } static void -posix_winsync_pre_ds_mod_group_cb(void *cbdata, const Slapi_Entry *rawentry, Slapi_Entry *ad_entry, - Slapi_Entry *ds_entry, Slapi_Mods *smods, int *do_modify) +posix_winsync_pre_ds_mod_group_cb(void *cbdata __attribute__((unused)), + const Slapi_Entry *rawentry __attribute__((unused)), + Slapi_Entry *ad_entry, + Slapi_Entry *ds_entry, + Slapi_Mods *smods, + int *do_modify) { LDAPMod* mod = NULL; Slapi_Attr *attr = NULL; @@ -1117,8 +1149,10 @@ posix_winsync_pre_ds_mod_group_cb(void *cbdata, const Slapi_Entry *rawentry, Sla } static void -posix_winsync_pre_ds_add_user_cb(void *cbdata, const Slapi_Entry *rawentry, Slapi_Entry *ad_entry, - Slapi_Entry *ds_entry) +posix_winsync_pre_ds_add_user_cb(void *cbdata, + const Slapi_Entry *rawentry __attribute__((unused)), + Slapi_Entry *ad_entry, + Slapi_Entry *ds_entry) { Slapi_Attr *attr = NULL; char *type = NULL; @@ -1213,8 +1247,10 @@ posix_winsync_pre_ds_add_user_cb(void *cbdata, const Slapi_Entry *rawentry, Slap } static void -posix_winsync_pre_ds_add_group_cb(void *cbdata, const Slapi_Entry *rawentry, Slapi_Entry *ad_entry, - Slapi_Entry *ds_entry) +posix_winsync_pre_ds_add_group_cb(void *cbdata __attribute__((unused)), + const Slapi_Entry *rawentry __attribute__((unused)), + Slapi_Entry *ad_entry, + Slapi_Entry *ds_entry) { Slapi_Attr *attr = NULL; char *type = NULL; @@ -1281,9 +1317,12 @@ posix_winsync_pre_ds_add_group_cb(void *cbdata, const Slapi_Entry *rawentry, Sla } static void -posix_winsync_get_new_ds_user_dn_cb(void *cbdata, const Slapi_Entry *rawentry, - Slapi_Entry *ad_entry, char **new_dn_string, const Slapi_DN *ds_suffix, - const Slapi_DN *ad_suffix) +posix_winsync_get_new_ds_user_dn_cb(void *cbdata __attribute__((unused)), + const Slapi_Entry *rawentry __attribute__((unused)), + Slapi_Entry *ad_entry __attribute__((unused)), + char **new_dn_string, + const Slapi_DN *ds_suffix __attribute__((unused)), + const Slapi_DN *ad_suffix __attribute__((unused))) { slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> posix_winsync_get_new_ds_user_dn_cb -- old dn [%s] -- begin\n", @@ -1297,9 +1336,12 @@ posix_winsync_get_new_ds_user_dn_cb(void *cbdata, const Slapi_Entry *rawentry, } static void -posix_winsync_get_new_ds_group_dn_cb(void *cbdata, const Slapi_Entry *rawentry, - Slapi_Entry *ad_entry, char **new_dn_string, const Slapi_DN *ds_suffix, - const Slapi_DN *ad_suffix) +posix_winsync_get_new_ds_group_dn_cb(void *cbdata __attribute__((unused)), + const Slapi_Entry *rawentry __attribute__((unused)), + Slapi_Entry *ad_entry __attribute__((unused)), + char **new_dn_string __attribute__((unused)), + const Slapi_DN *ds_suffix __attribute__((unused)), + const Slapi_DN *ad_suffix __attribute__((unused))) { slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> posix_winsync_get_new_ds_group_dn_cb -- begin\n"); @@ -1311,9 +1353,13 @@ posix_winsync_get_new_ds_group_dn_cb(void *cbdata, const Slapi_Entry *rawentry, } static void -posix_winsync_pre_ad_mod_user_mods_cb(void *cbdata, const Slapi_Entry *rawentry, - const Slapi_DN *local_dn, const Slapi_Entry *ds_entry, LDAPMod * const *origmods, - Slapi_DN *remote_dn, LDAPMod ***modstosend) +posix_winsync_pre_ad_mod_user_mods_cb(void *cbdata, + const Slapi_Entry *rawentry, + const Slapi_DN *local_dn __attribute__((unused)), + const Slapi_Entry *ds_entry, + LDAPMod * const *origmods, + Slapi_DN *remote_dn __attribute__((unused)), + LDAPMod ***modstosend) { Slapi_Mods *smods; Slapi_Mods *new_smods; @@ -1390,9 +1436,13 @@ posix_winsync_pre_ad_mod_user_mods_cb(void *cbdata, const Slapi_Entry *rawentry, } static void -posix_winsync_pre_ad_mod_group_mods_cb(void *cbdata, const Slapi_Entry *rawentry, - const Slapi_DN *local_dn, const Slapi_Entry *ds_entry, LDAPMod * const *origmods, - Slapi_DN *remote_dn, LDAPMod ***modstosend) +posix_winsync_pre_ad_mod_group_mods_cb(void *cbdata __attribute__((unused)), + const Slapi_Entry *rawentry __attribute__((unused)), + const Slapi_DN *local_dn __attribute__((unused)), + const Slapi_Entry *ds_entry, + LDAPMod * const *origmods, + Slapi_DN *remote_dn __attribute__((unused)), + LDAPMod ***modstosend) { Slapi_Mods *smods; Slapi_Mods *new_smods; @@ -1468,8 +1518,9 @@ posix_winsync_pre_ad_mod_group_mods_cb(void *cbdata, const Slapi_Entry *rawentry } static int -posix_winsync_can_add_entry_to_ad_cb(void *cbdata, const Slapi_Entry *local_entry, - const Slapi_DN *remote_dn) +posix_winsync_can_add_entry_to_ad_cb(void *cbdata __attribute__((unused)), + const Slapi_Entry *local_entry __attribute__((unused)), + const Slapi_DN *remote_dn __attribute__((unused))) { slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> posix_winsync_can_add_entry_to_ad_cb -- begin\n"); @@ -1481,8 +1532,10 @@ posix_winsync_can_add_entry_to_ad_cb(void *cbdata, const Slapi_Entry *local_entr } static void -posix_winsync_begin_update_cb(void *cbdata, const Slapi_DN *ds_subtree, const Slapi_DN *ad_subtree, - int is_total) +posix_winsync_begin_update_cb(void *cbdata __attribute__((unused)), + const Slapi_DN *ds_subtree __attribute__((unused)), + const Slapi_DN *ad_subtree __attribute__((unused)), + int is_total __attribute__((unused))) { plugin_op_started(); if(!get_plugin_started()){ @@ -1502,8 +1555,10 @@ posix_winsync_begin_update_cb(void *cbdata, const Slapi_DN *ds_subtree, const Sl } static void -posix_winsync_end_update_cb(void *cbdata, const Slapi_DN *ds_subtree, const Slapi_DN *ad_subtree, - int is_total) +posix_winsync_end_update_cb(void *cbdata __attribute__((unused)), + const Slapi_DN *ds_subtree, + const Slapi_DN *ad_subtree __attribute__((unused)), + int is_total __attribute__((unused))) { plugin_op_started(); @@ -1581,7 +1636,9 @@ posix_winsync_end_update_cb(void *cbdata, const Slapi_DN *ds_subtree, const Slap } static void -posix_winsync_destroy_agmt_cb(void *cbdata, const Slapi_DN *ds_subtree, const Slapi_DN *ad_subtree) +posix_winsync_destroy_agmt_cb(void *cbdata __attribute__((unused)), + const Slapi_DN *ds_subtree __attribute__((unused)), + const Slapi_DN *ad_subtree __attribute__((unused))) { slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> posix_winsync_destroy_agmt_cb -- begin\n"); @@ -1593,7 +1650,12 @@ posix_winsync_destroy_agmt_cb(void *cbdata, const Slapi_DN *ds_subtree, const Sl } static void -posix_winsync_post_ad_mod_user_cb(void *cookie, const Slapi_Entry *rawentry, Slapi_Entry *ad_entry, Slapi_Entry *ds_entry, Slapi_Mods *smods, int *result) +posix_winsync_post_ad_mod_user_cb(void *cookie __attribute__((unused)), + const Slapi_Entry *rawentry __attribute__((unused)), + Slapi_Entry *ad_entry __attribute__((unused)), + Slapi_Entry *ds_entry __attribute__((unused)), + Slapi_Mods *smods __attribute__((unused)), + int *result __attribute__((unused))) { slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> posix_winsync_post_ad_mod_user_cb -- begin\n"); @@ -1611,7 +1673,12 @@ posix_winsync_post_ad_mod_user_cb(void *cookie, const Slapi_Entry *rawentry, Sla } static void -posix_winsync_post_ad_mod_group_cb(void *cookie, const Slapi_Entry *rawentry, Slapi_Entry *ad_entry, Slapi_Entry *ds_entry, Slapi_Mods *smods, int *result) +posix_winsync_post_ad_mod_group_cb(void *cookie __attribute__((unused)), + const Slapi_Entry *rawentry __attribute__((unused)), + Slapi_Entry *ad_entry __attribute__((unused)), + Slapi_Entry *ds_entry __attribute__((unused)), + Slapi_Mods *smods __attribute__((unused)), + int *result __attribute__((unused))) { slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> posix_winsync_post_ad_mod_group_cb -- begin\n"); @@ -1629,7 +1696,12 @@ posix_winsync_post_ad_mod_group_cb(void *cookie, const Slapi_Entry *rawentry, Sl } static void -posix_winsync_post_ds_mod_user_cb(void *cookie, const Slapi_Entry *rawentry, Slapi_Entry *ad_entry, Slapi_Entry *ds_entry, Slapi_Mods *smods, int *result) +posix_winsync_post_ds_mod_user_cb(void *cookie __attribute__((unused)), + const Slapi_Entry *rawentry __attribute__((unused)), + Slapi_Entry *ad_entry __attribute__((unused)), + Slapi_Entry *ds_entry __attribute__((unused)), + Slapi_Mods *smods __attribute__((unused)), + int *result __attribute__((unused))) { slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> posix_winsync_post_ds_mod_user_cb -- begin\n"); @@ -1647,7 +1719,12 @@ posix_winsync_post_ds_mod_user_cb(void *cookie, const Slapi_Entry *rawentry, Sla } static void -posix_winsync_post_ds_mod_group_cb(void *cookie, const Slapi_Entry *rawentry, Slapi_Entry *ad_entry, Slapi_Entry *ds_entry, Slapi_Mods *smods, int *result) +posix_winsync_post_ds_mod_group_cb(void *cookie __attribute__((unused)), + const Slapi_Entry *rawentry __attribute__((unused)), + Slapi_Entry *ad_entry __attribute__((unused)), + Slapi_Entry *ds_entry __attribute__((unused)), + Slapi_Mods *smods __attribute__((unused)), + int *result __attribute__((unused))) { slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> posix_winsync_post_ds_mod_group_cb -- begin\n"); @@ -1665,7 +1742,11 @@ posix_winsync_post_ds_mod_group_cb(void *cookie, const Slapi_Entry *rawentry, Sl } static void -posix_winsync_post_ds_add_user_cb(void *cookie, const Slapi_Entry *rawentry, Slapi_Entry *ad_entry, Slapi_Entry *ds_entry, int *result) +posix_winsync_post_ds_add_user_cb(void *cookie __attribute__((unused)), + const Slapi_Entry *rawentry __attribute__((unused)), + Slapi_Entry *ad_entry __attribute__((unused)), + Slapi_Entry *ds_entry __attribute__((unused)), + int *result __attribute__((unused))) { slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> posix_winsync_post_ds_add_user_cb -- begin\n"); @@ -1683,7 +1764,11 @@ posix_winsync_post_ds_add_user_cb(void *cookie, const Slapi_Entry *rawentry, Sla } static void -posix_winsync_post_ds_add_group_cb(void *cookie, const Slapi_Entry *rawentry, Slapi_Entry *ad_entry, Slapi_Entry *ds_entry, int *result) +posix_winsync_post_ds_add_group_cb(void *cookie __attribute__((unused)), + const Slapi_Entry *rawentry __attribute__((unused)), + Slapi_Entry *ad_entry __attribute__((unused)), + Slapi_Entry *ds_entry __attribute__((unused)), + int *result __attribute__((unused))) { slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> posix_winsync_post_ds_add_group_cb -- begin\n"); @@ -1702,7 +1787,9 @@ posix_winsync_post_ds_add_group_cb(void *cookie, const Slapi_Entry *rawentry, Sl /* winsync_plugin_call_pre_ad_add_user_cb(prp->agmt, mapped_entry, e); */ static void -posix_winsync_pre_ad_add_user_cb(void *cookie, Slapi_Entry *ad_entry, Slapi_Entry *ds_entry) +posix_winsync_pre_ad_add_user_cb(void *cookie __attribute__((unused)), + Slapi_Entry *ad_entry, + Slapi_Entry *ds_entry) { Slapi_Attr * obj_attr = NULL; /* Entry attributes */ windows_attribute_map *attr_map=user_attribute_map; @@ -1785,7 +1872,9 @@ posix_winsync_pre_ad_add_user_cb(void *cookie, Slapi_Entry *ad_entry, Slapi_Entr } static void -posix_winsync_pre_ad_add_group_cb(void *cookie, Slapi_Entry *ad_entry, Slapi_Entry *ds_entry) +posix_winsync_pre_ad_add_group_cb(void *cookie __attribute__((unused)), + Slapi_Entry *ad_entry, + Slapi_Entry *ds_entry) { Slapi_Attr * obj_attr = NULL; /* Entry attributes */ windows_attribute_map *attr_map = group_attribute_map; @@ -1864,7 +1953,10 @@ posix_winsync_pre_ad_add_group_cb(void *cookie, Slapi_Entry *ad_entry, Slapi_Ent } static void -posix_winsync_post_ad_add_user_cb(void *cookie, Slapi_Entry *ds_entry, Slapi_Entry *ad_entry, int *result) +posix_winsync_post_ad_add_user_cb(void *cookie __attribute__((unused)), + Slapi_Entry *ds_entry __attribute__((unused)), + Slapi_Entry *ad_entry __attribute__((unused)), + int *result __attribute__((unused))) { slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> posix_winsync_post_ad_add_user_cb -- begin\n"); @@ -1882,7 +1974,10 @@ posix_winsync_post_ad_add_user_cb(void *cookie, Slapi_Entry *ds_entry, Slapi_Ent } static void -posix_winsync_post_ad_add_group_cb(void *cookie, Slapi_Entry *ds_entry, Slapi_Entry *ad_entry, int *result) +posix_winsync_post_ad_add_group_cb(void *cookie __attribute__((unused)), + Slapi_Entry *ds_entry __attribute__((unused)), + Slapi_Entry *ad_entry __attribute__((unused)), + int *result __attribute__((unused))) { slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> posix_winsync_post_ad_add_group_cb -- begin\n"); @@ -1900,7 +1995,14 @@ posix_winsync_post_ad_add_group_cb(void *cookie, Slapi_Entry *ds_entry, Slapi_En } static void -posix_winsync_post_ad_mod_user_mods_cb(void *cookie, const Slapi_Entry *rawentry, const Slapi_DN *local_dn, const Slapi_Entry *ds_entry, LDAPMod * const *origmods, Slapi_DN *remote_dn, LDAPMod ***modstosend, int *result) +posix_winsync_post_ad_mod_user_mods_cb(void *cookie __attribute__((unused)), + const Slapi_Entry *rawentry __attribute__((unused)), + const Slapi_DN *local_dn __attribute__((unused)), + const Slapi_Entry *ds_entry __attribute__((unused)), + LDAPMod * const *origmods __attribute__((unused)), + Slapi_DN *remote_dn __attribute__((unused)), + LDAPMod ***modstosend __attribute__((unused)), + int *result __attribute__((unused))) { slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> posix_winsync_post_ad_mod_user_mods_cb -- begin\n"); @@ -1918,7 +2020,14 @@ posix_winsync_post_ad_mod_user_mods_cb(void *cookie, const Slapi_Entry *rawentry } static void -posix_winsync_post_ad_mod_group_mods_cb(void *cookie, const Slapi_Entry *rawentry, const Slapi_DN *local_dn, const Slapi_Entry *ds_entry, LDAPMod * const *origmods, Slapi_DN *remote_dn, LDAPMod ***modstosend, int *result) +posix_winsync_post_ad_mod_group_mods_cb(void *cookie __attribute__((unused)), + const Slapi_Entry *rawentry __attribute__((unused)), + const Slapi_DN *local_dn __attribute__((unused)), + const Slapi_Entry *ds_entry __attribute__((unused)), + LDAPMod * const *origmods __attribute__((unused)), + Slapi_DN *remote_dn __attribute__((unused)), + LDAPMod ***modstosend __attribute__((unused)), + int *result __attribute__((unused))) { slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> posix_winsync_post_ad_mod_group_mods_cb -- begin\n"); @@ -2030,7 +2139,7 @@ posix_winsync_plugin_start(Slapi_PBlock *pb) } static int -posix_winsync_plugin_close(Slapi_PBlock *pb) +posix_winsync_plugin_close(Slapi_PBlock *pb __attribute__((unused))) { slapi_log_err(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "--> posix_winsync_plugin_close -- begin\n"); diff --git a/ldap/servers/plugins/referint/referint.c b/ldap/servers/plugins/referint/referint.c index 9feb91b..0d95a86 100644 --- a/ldap/servers/plugins/referint/referint.c +++ b/ldap/servers/plugins/referint/referint.c @@ -1090,8 +1090,8 @@ bail: int update_integrity(Slapi_DN *origSDN, - char *newrDN, Slapi_DN *newsuperior, - int logChanges) + char *newrDN, Slapi_DN *newsuperior, + int logChanges __attribute__((unused))) { Slapi_PBlock *search_result_pb = NULL; Slapi_PBlock *mod_pb = slapi_pblock_new(); @@ -1354,7 +1354,7 @@ bail: return rc; } -int referint_postop_close( Slapi_PBlock *pb) +int referint_postop_close( Slapi_PBlock *pb __attribute__((unused))) { /* signal the thread to exit */ if (NULL != keeprunning_mutex) { @@ -1378,7 +1378,7 @@ int referint_postop_close( Slapi_PBlock *pb) } void -referint_thread_func(void *arg) +referint_thread_func(void *arg __attribute__((unused))) { PRFileDesc *prfd = NULL; char *logfilename = NULL; diff --git a/ldap/servers/plugins/replication/cl5_api.c b/ldap/servers/plugins/replication/cl5_api.c index 5c2233f..58d13b3 100644 --- a/ldap/servers/plugins/replication/cl5_api.c +++ b/ldap/servers/plugins/replication/cl5_api.c @@ -2294,7 +2294,7 @@ static int _cl5Entry2DBData (const CL5Entry *entry, char **data, PRUint32 *len) int -cl5DBData2Entry (const char *data, PRUint32 len, CL5Entry *entry) +cl5DBData2Entry (const char *data, PRUint32 len __attribute__((unused)), CL5Entry *entry) { int rc; PRUint8 version; @@ -2808,7 +2808,7 @@ static void _cl5WriteBerval (struct berval *bv, char** buff) } /* data format: ..... */ -static int _cl5ReadBervals (struct berval ***bv, char** buff, unsigned int size) +static int _cl5ReadBervals (struct berval ***bv, char** buff, unsigned int size __attribute__((unused))) { PRInt32 count; int i; @@ -3430,7 +3430,7 @@ static void _cl5TrimCleanup(void) memset (&s_cl5Desc.dbTrim, 0, sizeof (s_cl5Desc.dbTrim)); } -static int _cl5TrimMain (void *param) +static int _cl5TrimMain (void *param __attribute__((unused))) { time_t timePrev = current_time (); time_t timeCompactPrev = current_time (); @@ -5047,7 +5047,7 @@ _cl5LDIF2Operation (char *ldifEntry, slapi_operation_parameters *op, char **repl } static int _cl5WriteOperationTxn(const char *replName, const char *replGen, - const slapi_operation_parameters *op, PRBool local, void *txn) + const slapi_operation_parameters *op, PRBool local __attribute__((unused)), void *txn) { int rc; int cnt; diff --git a/ldap/servers/plugins/replication/cl5_config.c b/ldap/servers/plugins/replication/cl5_config.c index ba3c016..4c299ab 100644 --- a/ldap/servers/plugins/replication/cl5_config.c +++ b/ldap/servers/plugins/replication/cl5_config.c @@ -145,8 +145,12 @@ void changelog5_config_free (changelog5Config **config) } static int -changelog5_config_add (Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAfter, - int *returncode, char *returntext, void *arg) +changelog5_config_add (Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* e, + Slapi_Entry* entryAfter __attribute__((unused)), + int *returncode, + char *returntext, + void *arg __attribute__((unused))) { int rc; changelog5Config config; @@ -252,9 +256,13 @@ done:; return SLAPI_DSE_CALLBACK_ERROR; } -static int -changelog5_config_modify (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* e, - int *returncode, char *returntext, void *arg) +static int +changelog5_config_modify (Slapi_PBlock *pb, + Slapi_Entry* entryBefore __attribute__((unused)), + Slapi_Entry* e, + int *returncode, + char *returntext, + void *arg __attribute__((unused))) { int rc= 0; LDAPMod **mods; @@ -600,8 +608,12 @@ done:; } static int -changelog5_config_delete (Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAfter, - int *returncode, char *returntext, void *arg) +changelog5_config_delete (Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* e __attribute__((unused)), + Slapi_Entry* entryAfter __attribute__((unused)), + int *returncode, + char *returntext, + void *arg __attribute__((unused))) { int rc; char *currentDir = NULL; @@ -702,10 +714,14 @@ done:; return SLAPI_DSE_CALLBACK_ERROR; } -static int dont_allow_that(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* e, - int *returncode, char *returntext, void *arg) +static int dont_allow_that(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* entryBefore __attribute__((unused)), + Slapi_Entry* e __attribute__((unused)), + int *returncode, + char *returntext __attribute__((unused)), + void *arg __attribute__((unused))) { - *returncode = LDAP_UNWILLING_TO_PERFORM; + *returncode = LDAP_UNWILLING_TO_PERFORM; return SLAPI_DSE_CALLBACK_ERROR; } @@ -854,7 +870,7 @@ static void replace_bslash (char *dir) } } -static int notify_replica (Replica *r, void *arg) +static int notify_replica (Replica *r, void *arg __attribute__((unused))) { return replica_log_ruv_elements (r); } diff --git a/ldap/servers/plugins/replication/legacy_consumer.c b/ldap/servers/plugins/replication/legacy_consumer.c index de07add..e8173f9 100644 --- a/ldap/servers/plugins/replication/legacy_consumer.c +++ b/ldap/servers/plugins/replication/legacy_consumer.c @@ -192,8 +192,8 @@ process_legacy_cf(Slapi_PBlock *pb) } } -void legacy_consumer_be_state_change (void *handle, char *be_name, - int old_be_state, int new_be_state) +void legacy_consumer_be_state_change (void *handle __attribute__((unused)), char *be_name, + int old_be_state __attribute__((unused)), int new_be_state) { Object *r_obj; Replica *r; @@ -217,9 +217,14 @@ void legacy_consumer_be_state_change (void *handle, char *be_name, static int -dont_allow_that(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* e, int *returncode, char *returntext, void *arg) +dont_allow_that(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* entryBefore __attribute__((unused)), + Slapi_Entry* e __attribute__((unused)), + int *returncode, + char *returntext __attribute__((unused)), + void *arg __attribute__((unused))) { - *returncode = LDAP_UNWILLING_TO_PERFORM; + *returncode = LDAP_UNWILLING_TO_PERFORM; return SLAPI_DSE_CALLBACK_ERROR; } @@ -252,7 +257,12 @@ legacy_consumer_config_init() } static int -legacy_consumer_config_add (Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAfter, int *returncode, char *returntext, void *arg) +legacy_consumer_config_add (Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* e, + Slapi_Entry* entryAfter __attribute__((unused)), + int *returncode, + char *returntext, + void *arg __attribute__((unused))) { int rc; @@ -274,8 +284,13 @@ legacy_consumer_config_add (Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entry #define config_copy_strval( s ) s ? slapi_ch_strdup (s) : NULL; -static int -legacy_consumer_config_modify (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* e, int *returncode, char *returntext, void *arg) +static int +legacy_consumer_config_modify (Slapi_PBlock *pb, + Slapi_Entry* entryBefore __attribute__((unused)), + Slapi_Entry* e, + int *returncode, + char *returntext, + void *arg __attribute__((unused))) { int rc= 0; LDAPMod **mods; @@ -386,12 +401,18 @@ legacy_consumer_config_modify (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi } static int -legacy_consumer_config_delete (Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAfter, int *returncode, char *returntext, void *arg) +legacy_consumer_config_delete (Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* e __attribute__((unused)), + Slapi_Entry* entryAfter __attribute__((unused)), + int *returncode, + char *returntext __attribute__((unused)), + void *arg __attribute__((unused))) { slapi_rwlock_wrlock (legacy_consumer_config_lock); - if (legacy_consumer_replicationdn) + if (legacy_consumer_replicationdn) { slapi_sdn_free (&legacy_consumer_replicationdn); + } slapi_ch_free_string(&legacy_consumer_replicationpw); legacy_consumer_replicationdn = NULL; slapi_rwlock_unlock (legacy_consumer_config_lock); @@ -404,7 +425,7 @@ legacy_consumer_config_delete (Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* en * Given the changelog configuration entry, extract the configuration directives. */ static int -legacy_consumer_extract_config(Slapi_Entry* entry, char *returntext) +legacy_consumer_extract_config(Slapi_Entry* entry, char *returntext __attribute__((unused))) { int rc = LDAP_SUCCESS; /* OK */ char *arg; @@ -412,8 +433,9 @@ legacy_consumer_extract_config(Slapi_Entry* entry, char *returntext) slapi_rwlock_wrlock (legacy_consumer_config_lock); arg= slapi_entry_attr_get_charptr(entry,CONFIG_LEGACY_REPLICATIONDN_ATTRIBUTE); - if (arg) + if (arg) { legacy_consumer_replicationdn = slapi_sdn_new_dn_passin (arg); + } arg= slapi_entry_attr_get_charptr(entry,CONFIG_LEGACY_REPLICATIONPW_ATTRIBUTE); slapi_ch_free_string(&legacy_consumer_replicationpw); diff --git a/ldap/servers/plugins/replication/repl5_agmt.c b/ldap/servers/plugins/replication/repl5_agmt.c index 6aee261..7718868 100644 --- a/ldap/servers/plugins/replication/repl5_agmt.c +++ b/ldap/servers/plugins/replication/repl5_agmt.c @@ -901,7 +901,7 @@ Send any pending updates as soon as possible, ignoring any replication schedules. */ int -agmt_replicate_now(Repl_Agmt *ra) +agmt_replicate_now(Repl_Agmt *ra __attribute__((unused))) { int return_value = 0; @@ -2304,7 +2304,7 @@ agmt_notify_change(Repl_Agmt *agmt, Slapi_PBlock *pb) int -agmt_is_50_mm_protocol(const Repl_Agmt *agmt) +agmt_is_50_mm_protocol(const Repl_Agmt *agmt __attribute__((unused))) { return 1; /* XXXggood could support > 1 protocol */ } @@ -2805,8 +2805,12 @@ agmt_get_changecount_string (Repl_Agmt *ra, char *buf, int bufsize) } static int -get_agmt_status(Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAfter, - int *returncode, char *returntext, void *arg) +get_agmt_status(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* e, + Slapi_Entry* entryAfter __attribute__((unused)), + int *returncode __attribute__((unused)), + char *returntext __attribute__((unused)), + void *arg __attribute__((unused))) { char *time_tmp = NULL; char changecount_string[BUFSIZ]; diff --git a/ldap/servers/plugins/replication/repl5_agmtlist.c b/ldap/servers/plugins/replication/repl5_agmtlist.c index b4dd032..2d03186 100644 --- a/ldap/servers/plugins/replication/repl5_agmtlist.c +++ b/ldap/servers/plugins/replication/repl5_agmtlist.c @@ -170,7 +170,7 @@ add_new_agreement(Slapi_Entry *e) } int -id_extended_agreement(Repl_Agmt *agmt, LDAPMod** mods, Slapi_Entry *e) +id_extended_agreement(Repl_Agmt *agmt __attribute__((unused)), LDAPMod** mods, Slapi_Entry *e) { Slapi_Attr *sattr = NULL; char *val = NULL; @@ -221,8 +221,12 @@ id_extended_agreement(Repl_Agmt *agmt, LDAPMod** mods, Slapi_Entry *e) } static int -agmtlist_add_callback(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *entryAfter, - int *returncode, char *returntext, void *arg) +agmtlist_add_callback(Slapi_PBlock *pb, + Slapi_Entry *e, + Slapi_Entry *entryAfter __attribute__((unused)), + int *returncode, + char *returntext __attribute__((unused)), + void *arg __attribute__((unused))) { int rc; slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "agmt_add: begin\n"); @@ -241,8 +245,12 @@ agmtlist_add_callback(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *entryAfter, } static int -agmtlist_modify_callback(Slapi_PBlock *pb, Slapi_Entry *entryBefore, Slapi_Entry *e, - int *returncode, char *returntext, void *arg) +agmtlist_modify_callback(Slapi_PBlock *pb, + Slapi_Entry *entryBefore __attribute__((unused)), + Slapi_Entry *e, + int *returncode, + char *returntext, + void *arg __attribute__((unused))) { int i; Slapi_DN *sdn = NULL; @@ -696,8 +704,12 @@ done: } static int -agmtlist_delete_callback(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *entryAfter, - int *returncode, char *returntext, void *arg) +agmtlist_delete_callback(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry *e, + Slapi_Entry *entryAfter __attribute__((unused)), + int *returncode, + char *returntext __attribute__((unused)), + void *arg __attribute__((unused))) { Repl_Agmt *ra; Object *ro; @@ -723,8 +735,12 @@ agmtlist_delete_callback(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *entryAft } static int -agmtlist_rename_callback(Slapi_PBlock *pb, Slapi_Entry *entryBefore, Slapi_Entry *e, - int *returncode, char *returntext, void *arg) +agmtlist_rename_callback(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry *entryBefore __attribute__((unused)), + Slapi_Entry *e __attribute__((unused)), + int *returncode, + char *returntext __attribute__((unused)), + void *arg __attribute__((unused))) { slapi_log_err(SLAPI_LOG_REPL, repl_plugin_name, "agmtlist_rename_callback - Begin\n"); @@ -760,9 +776,10 @@ handle_agmt_search(Slapi_Entry *e, void *callback_data) static void -agmtlist_objset_destructor(void **o) +agmtlist_objset_destructor(void **o __attribute__((unused))) { /* XXXggood Nothing to do, I think. */ + return; } diff --git a/ldap/servers/plugins/replication/repl5_connection.c b/ldap/servers/plugins/replication/repl5_connection.c index b3c86bc..55ebd54 100644 --- a/ldap/servers/plugins/replication/repl5_connection.c +++ b/ldap/servers/plugins/replication/repl5_connection.c @@ -1097,7 +1097,7 @@ conn_cancel_linger(Repl_Connection *conn) * we close the connection. */ static void -linger_timeout(time_t event_time, void *arg) +linger_timeout(time_t event_time __attribute__((unused)), void *arg) { PRBool delete_now; Repl_Connection *conn = (Repl_Connection *)arg; diff --git a/ldap/servers/plugins/replication/repl5_inc_protocol.c b/ldap/servers/plugins/replication/repl5_inc_protocol.c index a5ae885..7df5367 100644 --- a/ldap/servers/plugins/replication/repl5_inc_protocol.c +++ b/ldap/servers/plugins/replication/repl5_inc_protocol.c @@ -2157,7 +2157,7 @@ repl5_inc_stop(Private_Repl_Protocol *prp) } static int -repl5_inc_status(Private_Repl_Protocol *prp) +repl5_inc_status(Private_Repl_Protocol *prp __attribute__((unused))) { int return_value = 0; @@ -2239,7 +2239,7 @@ loser: } static void -repl5_inc_backoff_expired(time_t timer_fire_time, void *arg) +repl5_inc_backoff_expired(time_t timer_fire_time __attribute__((unused)), void *arg) { Private_Repl_Protocol *prp = (Private_Repl_Protocol *)arg; PR_ASSERT(NULL != prp); diff --git a/ldap/servers/plugins/replication/repl5_init.c b/ldap/servers/plugins/replication/repl5_init.c index 9549dcf..9d9a454 100644 --- a/ldap/servers/plugins/replication/repl5_init.c +++ b/ldap/servers/plugins/replication/repl5_init.c @@ -339,7 +339,7 @@ multimaster_bepreop_init( Slapi_PBlock *pb ) * betxnpreop: if betxn is on, call preop urp at betxnpreop. */ int -multimaster_betxnpreop_init( Slapi_PBlock *pb ) +multimaster_betxnpreop_init( Slapi_PBlock *pb __attribute__((unused))) { int rc= 0; /* OK */ @@ -811,7 +811,7 @@ out: } int -multimaster_stop( Slapi_PBlock *pb ) +multimaster_stop( Slapi_PBlock *pb __attribute__((unused))) { int rc= 0; /* OK */ diff --git a/ldap/servers/plugins/replication/repl5_mtnode_ext.c b/ldap/servers/plugins/replication/repl5_mtnode_ext.c index 70fe2cc..9f65485 100644 --- a/ldap/servers/plugins/replication/repl5_mtnode_ext.c +++ b/ldap/servers/plugins/replication/repl5_mtnode_ext.c @@ -111,7 +111,7 @@ multimaster_mtnode_construct_replicas () } void * -multimaster_mtnode_extension_constructor (void *object, void *parent) +multimaster_mtnode_extension_constructor (void *object, void *parent __attribute__((unused))) { mapping_tree_node *node; const Slapi_DN *root; @@ -141,7 +141,7 @@ multimaster_mtnode_extension_constructor (void *object, void *parent) } void -multimaster_mtnode_extension_destructor (void* ext, void *object, void *parent) +multimaster_mtnode_extension_destructor (void* ext, void *object __attribute__((unused)), void *parent __attribute__((unused))) { if (ext) { diff --git a/ldap/servers/plugins/replication/repl5_plugins.c b/ldap/servers/plugins/replication/repl5_plugins.c index 357c093..7362c37 100644 --- a/ldap/servers/plugins/replication/repl5_plugins.c +++ b/ldap/servers/plugins/replication/repl5_plugins.c @@ -136,7 +136,7 @@ multimaster_get_local_purl() int -multimaster_preop_bind (Slapi_PBlock *pb) +multimaster_preop_bind (Slapi_PBlock *pb __attribute__((unused))) { return 0; } @@ -600,13 +600,13 @@ multimaster_preop_modrdn (Slapi_PBlock *pb) } int -multimaster_preop_search (Slapi_PBlock *pb) +multimaster_preop_search (Slapi_PBlock *pb __attribute__((unused))) { return SLAPI_PLUGIN_SUCCESS; } int -multimaster_preop_compare (Slapi_PBlock *pb) +multimaster_preop_compare (Slapi_PBlock *pb __attribute__((unused))) { return SLAPI_PLUGIN_SUCCESS; } @@ -839,7 +839,7 @@ multimaster_bepostop_delete (Slapi_PBlock *pb) /* postop - write to changelog */ int -multimaster_postop_bind (Slapi_PBlock *pb) +multimaster_postop_bind (Slapi_PBlock *pb __attribute__((unused))) { return SLAPI_PLUGIN_SUCCESS; } @@ -1517,7 +1517,7 @@ is_mmr_replica (Slapi_PBlock *pb) return mmr; } -static const char *replica_get_purl_for_op (const Replica *r, Slapi_PBlock *pb, const CSN *opcsn) +static const char *replica_get_purl_for_op (const Replica *r __attribute__((unused)), Slapi_PBlock *pb, const CSN *opcsn) { int is_replicated_op; const char *purl = NULL; @@ -1606,7 +1606,7 @@ static void strip_legacy_info (slapi_operation_parameters *op_params) /* this function is called when state of a backend changes */ void -multimaster_be_state_change (void *handle, char *be_name, int old_be_state, int new_be_state) +multimaster_be_state_change (void *handle __attribute__((unused)), char *be_name, int old_be_state, int new_be_state) { Object *r_obj; Replica *r; diff --git a/ldap/servers/plugins/replication/repl5_replica.c b/ldap/servers/plugins/replication/repl5_replica.c index 7beef50..58fb210 100644 --- a/ldap/servers/plugins/replication/repl5_replica.c +++ b/ldap/servers/plugins/replication/repl5_replica.c @@ -1788,7 +1788,7 @@ replica_reload_ruv (Replica *r) thread safe. Locking replica lock while calling changelog functions causes a deadlock because changelog calls replica functions that that lock the same lock */ -int replica_check_for_data_reload (Replica *r, void *arg) +int replica_check_for_data_reload (Replica *r, void *arg __attribute__((unused))) { int rc = 0; RUV *upper_bound_ruv = NULL; @@ -2532,7 +2532,7 @@ _replica_get_config_dn (const Slapi_DN *root) * Returns 0 on success, -1 on failure. If 0 is returned, the RUV is present in the replica. */ static int -_replica_configure_ruv (Replica *r, PRBool isLocked) +_replica_configure_ruv (Replica *r, PRBool isLocked __attribute__((unused))) { Slapi_PBlock *pb = NULL; char *attrs[2]; @@ -2805,7 +2805,7 @@ done: /* NOTE - this is the only non-api function that performs locking because it is called by the event queue */ void -replica_update_state (time_t when, void *arg) +replica_update_state (time_t when __attribute__((unused)), void *arg) { int rc; const char *replica_name = (const char *)arg; @@ -3425,7 +3425,7 @@ done: that does the real work. */ static void -eq_cb_reap_tombstones(time_t when, void *arg) +eq_cb_reap_tombstones(time_t when __attribute__((unused)), void *arg) { const char *replica_name = (const char *)arg; Object *replica_object = NULL; @@ -4119,7 +4119,7 @@ replica_enable_replication (Replica *r) /* replica is about to be taken offline */ void -replica_disable_replication (Replica *r, Object *r_obj) +replica_disable_replication (Replica *r, Object *r_obj __attribute__((unused))) { char *current_purl = NULL; char *p_locking_purl = NULL; diff --git a/ldap/servers/plugins/replication/repl5_replica_config.c b/ldap/servers/plugins/replication/repl5_replica_config.c index 053103b..f09055b 100644 --- a/ldap/servers/plugins/replication/repl5_replica_config.c +++ b/ldap/servers/plugins/replication/repl5_replica_config.c @@ -93,9 +93,14 @@ static void clean_agmts(cleanruv_data *data); static PRLock *s_configLock; static int -dont_allow_that(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* e, int *returncode, char *returntext, void *arg) +dont_allow_that(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* entryBefore __attribute__((unused)), + Slapi_Entry* e __attribute__((unused)), + int *returncode, + char *returntext __attribute__((unused)), + void *arg __attribute__((unused))) { - *returncode = LDAP_UNWILLING_TO_PERFORM; + *returncode = LDAP_UNWILLING_TO_PERFORM; return SLAPI_DSE_CALLBACK_ERROR; } @@ -185,8 +190,12 @@ replica_config_destroy () } static int -replica_config_add (Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAfter, - int *returncode, char *errorbuf, void *arg) +replica_config_add (Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* e, + Slapi_Entry* entryAfter __attribute__((unused)), + int *returncode, + char *errorbuf, + void *arg __attribute__((unused))) { Replica *r = NULL; multimaster_mtnode_extension *mtnode_ext; @@ -257,8 +266,12 @@ done: } static int -replica_config_modify (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* e, - int *returncode, char *returntext, void *arg) +replica_config_modify (Slapi_PBlock *pb, + Slapi_Entry* entryBefore __attribute__((unused)), + Slapi_Entry* e, + int *returncode, + char *returntext, + void *arg __attribute__((unused))) { int rc= 0; LDAPMod **mods; @@ -662,11 +675,11 @@ done: static int replica_config_post_modify(Slapi_PBlock *pb, - Slapi_Entry* entryBefore, + Slapi_Entry* entryBefore __attribute__((unused)), Slapi_Entry* e, int *returncode, char *returntext, - void *arg) + void *arg __attribute__((unused))) { int rc= 0; LDAPMod **mods; @@ -801,8 +814,12 @@ done: } static int -replica_config_delete (Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAfter, - int *returncode, char *returntext, void *arg) +replica_config_delete (Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* e, + Slapi_Entry* entryAfter __attribute__((unused)), + int *returncode, + char *returntext __attribute__((unused)), + void *arg __attribute__((unused))) { multimaster_mtnode_extension *mtnode_ext; Replica *r; @@ -835,7 +852,7 @@ replica_config_delete (Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAfter } static void -replica_config_search_last_modified(Slapi_PBlock *pb, Slapi_Entry* e, Replica *replica) +replica_config_search_last_modified(Slapi_PBlock *pb __attribute__((unused)), Slapi_Entry* e, Replica *replica) { Object *ruv_obj = NULL; RUV *ruv = NULL; @@ -856,7 +873,7 @@ replica_config_search_last_modified(Slapi_PBlock *pb, Slapi_Entry* e, Replica *r } static void -replica_config_search_ruv(Slapi_PBlock *pb, Slapi_Entry* e, Replica *replica) +replica_config_search_ruv(Slapi_PBlock *pb __attribute__((unused)), Slapi_Entry* e, Replica *replica) { Object *ruv_obj = NULL; RUV *ruv = NULL; @@ -900,8 +917,12 @@ search_requested_attr(Slapi_PBlock *pb, const char *attr) } static int -replica_config_search (Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAfter, int *returncode, - char *returntext, void *arg) +replica_config_search (Slapi_PBlock *pb, + Slapi_Entry* e, + Slapi_Entry* entryAfter __attribute__((unused)), + int *returncode __attribute__((unused)), + char *returntext __attribute__((unused)), + void *arg __attribute__((unused))) { multimaster_mtnode_extension *mtnode_ext; int changeCount = 0; @@ -1053,7 +1074,7 @@ replica_config_change_type_and_id (Replica *r, const char *new_type, } static int -replica_config_change_updatedn (Replica *r, const LDAPMod *mod, char *returntext, +replica_config_change_updatedn (Replica *r, const LDAPMod *mod, char *returntext __attribute__((unused)), int apply_mods) { PR_ASSERT (r); @@ -1073,7 +1094,7 @@ replica_config_change_updatedn (Replica *r, const LDAPMod *mod, char *returntext } static int -replica_config_change_updatedngroup (Replica *r, const LDAPMod *mod, char *returntext, +replica_config_change_updatedngroup (Replica *r, const LDAPMod *mod, char *returntext __attribute__((unused)), int apply_mods) { PR_ASSERT (r); @@ -1093,7 +1114,7 @@ replica_config_change_updatedngroup (Replica *r, const LDAPMod *mod, char *retur } static int replica_config_change_flags (Replica *r, const char *new_flags, - char *returntext, int apply_mods) + char *returntext __attribute__((unused)), int apply_mods) { PR_ASSERT (r); @@ -1173,7 +1194,7 @@ static int replica_execute_task (Object *r, const char *task_name, char *returnt } static int -replica_cleanup_task (Object *r, const char *task_name, char *returntext, +replica_cleanup_task (Object *r, const char *task_name __attribute__((unused)), char *returntext __attribute__((unused)), int apply_mods) { int rc = LDAP_SUCCESS; @@ -1432,7 +1453,7 @@ replica_execute_cleanruv_task_ext(Object *r, ReplicaId rid) } static int -replica_execute_cleanruv_task (Object *r, ReplicaId rid, char *returntext /* not used */) +replica_execute_cleanruv_task (Object *r, ReplicaId rid, char *returntext __attribute__((unused))) { Object *RUVObj; RUV *local_ruv = NULL; @@ -1500,8 +1521,12 @@ fetch_attr(Slapi_Entry *e, const char *attrname, const char *default_val) } static int -replica_cleanall_ruv_task(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter, - int *returncode, char *returntext, void *arg) +replica_cleanall_ruv_task(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry *e, + Slapi_Entry *eAfter __attribute__((unused)), + int *returncode, + char *returntext, + void *arg __attribute__((unused))) { Slapi_Task *task = NULL; const Slapi_DN *task_dn; @@ -1611,7 +1636,7 @@ out: * */ static int -replica_execute_cleanall_ruv_task (Object *r, ReplicaId rid, Slapi_Task *task, const char* force_cleaning, char *returntext) +replica_execute_cleanall_ruv_task (Object *r, ReplicaId rid, Slapi_Task *task, const char* force_cleaning, char *returntext __attribute__((unused))) { struct berval *payload = NULL; Slapi_Task *pre_task = NULL; /* this is supposed to be null for logging */ @@ -2203,7 +2228,7 @@ check_replicas_are_done_cleaning(cleanruv_data *data ) * an entry, we know it has finished cleaning. */ static int -replica_cleanallruv_is_finished(Repl_Agmt *agmt, char *filter, Slapi_Task *task) +replica_cleanallruv_is_finished(Repl_Agmt *agmt, char *filter, Slapi_Task *task __attribute__((unused))) { Repl_Connection *conn = NULL; ConnResult crc = 0; @@ -2241,8 +2266,9 @@ replica_cleanallruv_is_finished(Repl_Agmt *agmt, char *filter, Slapi_Task *task) } } conn_delete_internal_ext(conn); - if(payload) - ber_bvfree(payload); + if(payload) { + ber_bvfree(payload); + } return rc; } @@ -2922,8 +2948,12 @@ remove_cleaned_rid(ReplicaId rid) * Abort the CLEANALLRUV task */ int -replica_cleanall_ruv_abort(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter, - int *returncode, char *returntext, void *arg) +replica_cleanall_ruv_abort(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry *e, + Slapi_Entry *eAfter __attribute__((unused)), + int *returncode, + char *returntext, + void *arg __attribute__((unused))) { struct berval *payload = NULL; cleanruv_data *data = NULL; @@ -3528,7 +3558,7 @@ replica_cleanallruv_replica_alive(Repl_Agmt *agmt) } static int -replica_cleanallruv_check_ruv(char *repl_root, Repl_Agmt *agmt, char *rid_text, Slapi_Task *task, char *force) +replica_cleanallruv_check_ruv(char *repl_root, Repl_Agmt *agmt, char *rid_text, Slapi_Task *task __attribute__((unused)), char *force) { Repl_Connection *conn = NULL; ConnResult crc = 0; diff --git a/ldap/servers/plugins/replication/repl5_replica_dnhash.c b/ldap/servers/plugins/replication/repl5_replica_dnhash.c index 1518437..59c52ea 100644 --- a/ldap/servers/plugins/replication/repl5_replica_dnhash.c +++ b/ldap/servers/plugins/replication/repl5_replica_dnhash.c @@ -183,12 +183,13 @@ int replica_is_being_configured (const char *dn) /* Helper functions */ /* this function called for each hash node during hash destruction */ -static PRIntn replica_destroy_hash_entry (PLHashEntry *he, PRIntn index, void *arg) +static PRIntn replica_destroy_hash_entry (PLHashEntry *he, PRIntn index __attribute__((unused)), void *arg __attribute__((unused))) { char *dn_copy; - if (he == NULL) + if (he == NULL) { return HT_ENUMERATE_NEXT; + } dn_copy = (char*)he->value; slapi_ch_free((void **)&dn_copy); diff --git a/ldap/servers/plugins/replication/repl5_replica_hash.c b/ldap/servers/plugins/replication/repl5_replica_hash.c index 55a1267..ee5e065 100644 --- a/ldap/servers/plugins/replication/repl5_replica_hash.c +++ b/ldap/servers/plugins/replication/repl5_replica_hash.c @@ -208,13 +208,14 @@ void replica_enumerate_replicas (FNEnumReplica fn, void *arg) /* Helper functions */ /* this function called for each hash node during hash destruction */ -static PRIntn replica_destroy_hash_entry (PLHashEntry *he, PRIntn index, void *arg) +static PRIntn replica_destroy_hash_entry (PLHashEntry *he, PRIntn index __attribute__((unused)), void *arg __attribute__((unused))) { Object *r_obj; Replica *r; - if (he == NULL) + if (he == NULL) { return HT_ENUMERATE_NEXT; + } r_obj = (Object*)he->value; r = (Replica*)object_get_data (r_obj); @@ -229,7 +230,7 @@ static PRIntn replica_destroy_hash_entry (PLHashEntry *he, PRIntn index, void *a return HT_ENUMERATE_REMOVE; } -static PRIntn replica_enumerate (PLHashEntry *he, PRIntn index, void *hash_data) +static PRIntn replica_enumerate (PLHashEntry *he, PRIntn index __attribute__((unused)), void *hash_data) { Object *r_obj; Replica *r; diff --git a/ldap/servers/plugins/replication/repl5_schedule.c b/ldap/servers/plugins/replication/repl5_schedule.c index 60ee6f2..c248264 100644 --- a/ldap/servers/plugins/replication/repl5_schedule.c +++ b/ldap/servers/plugins/replication/repl5_schedule.c @@ -233,7 +233,7 @@ schedule_set(Schedule *sch, Slapi_Attr *attr) * Returns the schedule. */ char ** -schedule_get(Schedule *sch) +schedule_get(Schedule *sch __attribute__((unused))) { char **return_value = NULL; @@ -466,7 +466,7 @@ schedule_next_nolock (Schedule *sch, PRBool start) * should commence, zero if it should not. */ int -schedule_notify(Schedule *sch, Slapi_PBlock *pb) +schedule_notify(Schedule *sch __attribute__((unused)), Slapi_PBlock *pb __attribute__((unused))) { int return_value = 0; @@ -604,7 +604,7 @@ schedule_window_state_change_event (Schedule *sch) /* this function is called by the even queue the next time the window is opened or closed */ static void -window_state_changed (time_t when, void *arg) +window_state_changed (time_t when __attribute__((unused)), void *arg) { Schedule *sch = (Schedule*)arg; int open; diff --git a/ldap/servers/plugins/replication/repl5_tot_protocol.c b/ldap/servers/plugins/replication/repl5_tot_protocol.c index 45a084a..cb10b16 100644 --- a/ldap/servers/plugins/replication/repl5_tot_protocol.c +++ b/ldap/servers/plugins/replication/repl5_tot_protocol.c @@ -664,7 +664,7 @@ repl5_tot_stop(Private_Repl_Protocol *prp) static int -repl5_tot_status(Private_Repl_Protocol *prp) +repl5_tot_status(Private_Repl_Protocol *prp __attribute__((unused))) { int return_value = 0; return return_value; @@ -673,9 +673,10 @@ repl5_tot_status(Private_Repl_Protocol *prp) static void -repl5_tot_noop(Private_Repl_Protocol *prp) +repl5_tot_noop(Private_Repl_Protocol *prp __attribute__((unused))) { /* noop */ + return; } diff --git a/ldap/servers/plugins/replication/repl5_total.c b/ldap/servers/plugins/replication/repl5_total.c index af570a8..182d4a3 100644 --- a/ldap/servers/plugins/replication/repl5_total.c +++ b/ldap/servers/plugins/replication/repl5_total.c @@ -272,7 +272,7 @@ my_ber_printf_csn(BerElement *ber, const CSN *csn, const CSNType t) * Send a single annotated attribute value. */ static int -my_ber_printf_value(BerElement *ber, const char *type, const Slapi_Value *value, PRBool deleted) +my_ber_printf_value(BerElement *ber, const char *type __attribute__((unused)), const Slapi_Value *value, PRBool deleted) { const struct berval *bval = NULL; int rc = -1; diff --git a/ldap/servers/plugins/replication/repl5_updatedn_list.c b/ldap/servers/plugins/replication/repl5_updatedn_list.c index f715acb..d57b52d 100644 --- a/ldap/servers/plugins/replication/repl5_updatedn_list.c +++ b/ldap/servers/plugins/replication/repl5_updatedn_list.c @@ -344,12 +344,13 @@ replica_updatedn_list_enumerate(ReplicaUpdateDNList list, FNEnumDN fn, void *arg /* this function called for each hash node during hash destruction */ static PRIntn -replica_destroy_hash_entry(PLHashEntry *he, PRIntn index, void *arg) +replica_destroy_hash_entry(PLHashEntry *he, PRIntn index __attribute__((unused)), void *arg __attribute__((unused))) { Slapi_DN *dn = NULL; - if (he == NULL) + if (he == NULL) { return HT_ENUMERATE_NEXT; + } dn = (Slapi_DN *)he->value; PR_ASSERT (dn); @@ -360,7 +361,7 @@ replica_destroy_hash_entry(PLHashEntry *he, PRIntn index, void *arg) } static PRIntn -updatedn_list_enumerate(PLHashEntry *he, PRIntn index, void *hash_data) +updatedn_list_enumerate(PLHashEntry *he, PRIntn index __attribute__((unused)), void *hash_data) { Slapi_DN *dn = NULL; struct repl_enum_data *data = hash_data; diff --git a/ldap/servers/plugins/replication/repl_add.c b/ldap/servers/plugins/replication/repl_add.c index e5cb463..d0881d8 100644 --- a/ldap/servers/plugins/replication/repl_add.c +++ b/ldap/servers/plugins/replication/repl_add.c @@ -25,7 +25,7 @@ legacy_preop_add( Slapi_PBlock *pb ) } int -legacy_bepreop_add( Slapi_PBlock *pb ) +legacy_bepreop_add( Slapi_PBlock *pb __attribute__((unused))) { int rc= 0; /* OK */ return rc; diff --git a/ldap/servers/plugins/replication/repl_connext.c b/ldap/servers/plugins/replication/repl_connext.c index 29dc2a7..c12cd9b 100644 --- a/ldap/servers/plugins/replication/repl_connext.c +++ b/ldap/servers/plugins/replication/repl_connext.c @@ -26,7 +26,7 @@ /* ***** Consumer side ***** */ /* consumer connection extension constructor */ -void* consumer_connection_extension_constructor (void *object, void *parent) +void* consumer_connection_extension_constructor (void *object __attribute__((unused)), void *parent __attribute__((unused))) { consumer_connection_extension *ext = (consumer_connection_extension*) slapi_ch_malloc (sizeof (consumer_connection_extension)); if (ext == NULL) @@ -58,7 +58,7 @@ void* consumer_connection_extension_constructor (void *object, void *parent) } /* consumer connection extension destructor */ -void consumer_connection_extension_destructor (void *ext, void *object, void *parent) +void consumer_connection_extension_destructor (void *ext, void *object __attribute__((unused)), void *parent __attribute__((unused))) { PRUint64 connid = 0; if (ext) diff --git a/ldap/servers/plugins/replication/repl_delete.c b/ldap/servers/plugins/replication/repl_delete.c index 6419cc4..ce4bb7c 100644 --- a/ldap/servers/plugins/replication/repl_delete.c +++ b/ldap/servers/plugins/replication/repl_delete.c @@ -22,7 +22,7 @@ legacy_preop_delete( Slapi_PBlock *pb ) } int -legacy_bepreop_delete( Slapi_PBlock *pb ) +legacy_bepreop_delete( Slapi_PBlock *pb __attribute__((unused))) { return 0; /* OK */ } diff --git a/ldap/servers/plugins/replication/repl_extop.c b/ldap/servers/plugins/replication/repl_extop.c index 80580f9..c92c364 100644 --- a/ldap/servers/plugins/replication/repl_extop.c +++ b/ldap/servers/plugins/replication/repl_extop.c @@ -608,7 +608,7 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb) PRBool isInc = PR_FALSE; /* true if incremental update */ char *locking_purl = NULL; /* the supplier contacting us */ char *current_purl = NULL; /* the supplier which already has exclusive access */ - char locking_session[24]; + char locking_session[42] = {0}; char *data_guid = NULL; struct berval *data = NULL; int is90 = 0; @@ -1921,7 +1921,7 @@ free_and_return: * supportedextension attribute in the root DSE. */ int -extop_noop(Slapi_PBlock *pb) +extop_noop(Slapi_PBlock *pb __attribute__((unused))) { return SLAPI_PLUGIN_EXTENDED_NOT_HANDLED; } diff --git a/ldap/servers/plugins/replication/repl_init.c b/ldap/servers/plugins/replication/repl_init.c index 29855b6..32de019 100644 --- a/ldap/servers/plugins/replication/repl_init.c +++ b/ldap/servers/plugins/replication/repl_init.c @@ -236,7 +236,7 @@ legacy_start( Slapi_PBlock *pb ) /* Post-start function for the legacy replication plugin */ static int -legacy_poststart( Slapi_PBlock *pb ) +legacy_poststart( Slapi_PBlock *pb __attribute__((unused))) { int rc = 0; /* OK */ return rc; @@ -245,7 +245,7 @@ legacy_poststart( Slapi_PBlock *pb ) /* Stop the legacy replication plugin */ static int -legacy_stop( Slapi_PBlock *pb ) +legacy_stop( Slapi_PBlock *pb __attribute__((unused))) { int rc= 0; /* OK */ diff --git a/ldap/servers/plugins/replication/repl_modify.c b/ldap/servers/plugins/replication/repl_modify.c index d429508..4022a37 100644 --- a/ldap/servers/plugins/replication/repl_modify.c +++ b/ldap/servers/plugins/replication/repl_modify.c @@ -24,7 +24,7 @@ legacy_preop_modify( Slapi_PBlock *pb ) } int -legacy_bepreop_modify( Slapi_PBlock *pb ) +legacy_bepreop_modify( Slapi_PBlock *pb __attribute__((unused))) { int rc= 0; /* OK */ return rc; diff --git a/ldap/servers/plugins/replication/repl_modrdn.c b/ldap/servers/plugins/replication/repl_modrdn.c index 0ee8c6b..0528180 100644 --- a/ldap/servers/plugins/replication/repl_modrdn.c +++ b/ldap/servers/plugins/replication/repl_modrdn.c @@ -24,7 +24,7 @@ legacy_preop_modrdn( Slapi_PBlock *pb ) } int -legacy_bepreop_modrdn( Slapi_PBlock *pb ) +legacy_bepreop_modrdn( Slapi_PBlock *pb __attribute__((unused))) { return 0; /* OK */ } diff --git a/ldap/servers/plugins/replication/repl_opext.c b/ldap/servers/plugins/replication/repl_opext.c index 2f622bd..d9fdd2d 100644 --- a/ldap/servers/plugins/replication/repl_opext.c +++ b/ldap/servers/plugins/replication/repl_opext.c @@ -21,7 +21,7 @@ /* ***** Supplier side ***** */ /* supplier operation extension constructor */ -void* supplier_operation_extension_constructor (void *object, void *parent) +void* supplier_operation_extension_constructor (void *object __attribute__((unused)), void *parent __attribute__((unused))) { supplier_operation_extension *ext = (supplier_operation_extension*) slapi_ch_calloc (1, sizeof (supplier_operation_extension)); if (ext == NULL) @@ -36,7 +36,7 @@ void* supplier_operation_extension_constructor (void *object, void *parent) } /* supplier operation extension destructor */ -void supplier_operation_extension_destructor (void *ext,void *object, void *parent) +void supplier_operation_extension_destructor (void *ext, void *object __attribute__((unused)), void *parent __attribute__((unused))) { if (ext) { @@ -87,7 +87,7 @@ void* consumer_operation_extension_constructor (void *object, void *parent) } /* consumer operation extension destructor */ -void consumer_operation_extension_destructor (void *ext,void *object, void *parent) +void consumer_operation_extension_destructor (void *ext,void *object __attribute__((unused)), void *parent __attribute__((unused))) { if (NULL != ext) { diff --git a/ldap/servers/plugins/replication/repl_ops.c b/ldap/servers/plugins/replication/repl_ops.c index 76f0f48..81e0103 100644 --- a/ldap/servers/plugins/replication/repl_ops.c +++ b/ldap/servers/plugins/replication/repl_ops.c @@ -17,7 +17,7 @@ #include "repl5.h" int -legacy_postop( Slapi_PBlock *pb, const char *caller, int operation_type) +legacy_postop( Slapi_PBlock *pb, const char *caller __attribute__((unused)), int operation_type) { int rc = 0; Object *r_obj; @@ -64,7 +64,7 @@ legacy_postop( Slapi_PBlock *pb, const char *caller, int operation_type) } int -legacy_preop(Slapi_PBlock *pb, const char *caller, int operation_type) +legacy_preop(Slapi_PBlock *pb, const char *caller __attribute__((unused)), int operation_type) { int rc = 0; Slapi_Operation *operation = NULL; diff --git a/ldap/servers/plugins/replication/repl_rootdse.c b/ldap/servers/plugins/replication/repl_rootdse.c index a9854cd..be7be22 100644 --- a/ldap/servers/plugins/replication/repl_rootdse.c +++ b/ldap/servers/plugins/replication/repl_rootdse.c @@ -33,7 +33,12 @@ repl_rootdse_init() } static int -repl_rootdse_search(Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAfter, int *returncode, char *returntext, void *arg) +repl_rootdse_search(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* e __attribute__((unused)), + Slapi_Entry* entryAfter __attribute__((unused)), + int *returncode __attribute__((unused)), + char *returntext __attribute__((unused)), + void *arg __attribute__((unused))) { #if 0 diff --git a/ldap/servers/plugins/replication/repl_search.c b/ldap/servers/plugins/replication/repl_search.c index 2ad2337..66330d0 100644 --- a/ldap/servers/plugins/replication/repl_search.c +++ b/ldap/servers/plugins/replication/repl_search.c @@ -17,7 +17,7 @@ /* XXXggood I think we no longer need this - the mapping tree should do it for us */ int -legacy_preop_search( Slapi_PBlock *pb ) +legacy_preop_search( Slapi_PBlock *pb __attribute__((unused))) { int return_code = 0; return return_code; @@ -26,7 +26,7 @@ legacy_preop_search( Slapi_PBlock *pb ) /* XXXggood I think we no longer need this - the mapping tree should do it for us */ int -legacy_pre_entry( Slapi_PBlock *pb ) +legacy_pre_entry( Slapi_PBlock *pb __attribute__((unused))) { int return_code = 0; return return_code; diff --git a/ldap/servers/plugins/replication/replutil.c b/ldap/servers/plugins/replication/replutil.c index fe95559..f1b114e 100644 --- a/ldap/servers/plugins/replication/replutil.c +++ b/ldap/servers/plugins/replication/replutil.c @@ -151,7 +151,7 @@ entry_print( Slapi_Entry *e ) replication module. I will switch it to NSPR once that stuff works. */ -int copyfile(char* source, char * destination, int overwrite, int mode) +int copyfile(char* source, char * destination, int overwrite __attribute__((unused)), int mode) { #ifdef DB_USE_64LFS #define OPEN_FUNCTION dblayer_open_large @@ -739,9 +739,9 @@ repl_set_mtn_state_and_referrals( * */ int -repl_chain_on_update(Slapi_PBlock *pb, Slapi_DN * target_dn, +repl_chain_on_update(Slapi_PBlock *pb, Slapi_DN * target_dn __attribute__((unused)), char **mtn_be_names, int be_count, - Slapi_DN * node_dn, int *mtn_be_states, + Slapi_DN * node_dn __attribute__((unused)), int *mtn_be_states, int root_mode) { char * requestor_dn; diff --git a/ldap/servers/plugins/replication/windows_connection.c b/ldap/servers/plugins/replication/windows_connection.c index fae17a3..c5486e3 100644 --- a/ldap/servers/plugins/replication/windows_connection.c +++ b/ldap/servers/plugins/replication/windows_connection.c @@ -277,8 +277,8 @@ static ConnResult windows_perform_operation(Repl_Connection *conn, int optype, const char *dn, LDAPMod **attrs, const char *newrdn, const char *newparent, int deleteoldrdn, LDAPControl **server_controls, - const char *extop_oid, struct berval *extop_payload, char **retoidp, - struct berval **retdatap, LDAPControl ***returned_controls) + const char *extop_oid, struct berval *extop_payload, char **retoidp __attribute__((unused)), + struct berval **retdatap __attribute__((unused)), LDAPControl ***returned_controls) { int rc = -1; ConnResult return_value; @@ -1173,7 +1173,7 @@ windows_conn_cancel_linger(Repl_Connection *conn) * we close the connection. */ static void -linger_timeout(time_t event_time, void *arg) +linger_timeout(time_t event_time __attribute__((unused)), void *arg) { PRBool delete_now; Repl_Connection *conn = (Repl_Connection *)arg; diff --git a/ldap/servers/plugins/replication/windows_inc_protocol.c b/ldap/servers/plugins/replication/windows_inc_protocol.c index e235f2d..b878f2b 100644 --- a/ldap/servers/plugins/replication/windows_inc_protocol.c +++ b/ldap/servers/plugins/replication/windows_inc_protocol.c @@ -1518,7 +1518,7 @@ windows_inc_stop(Private_Repl_Protocol *prp) } static int -windows_inc_status(Private_Repl_Protocol *prp) +windows_inc_status(Private_Repl_Protocol *prp __attribute__((unused))) { int return_value = 0; @@ -1624,7 +1624,7 @@ loser: static void -windows_inc_backoff_expired(time_t timer_fire_time, void *arg) +windows_inc_backoff_expired(time_t timer_fire_time __attribute__((unused)), void *arg) { Private_Repl_Protocol *prp = (Private_Repl_Protocol *)arg; @@ -1765,7 +1765,7 @@ event2name (int event) static void -periodic_dirsync(time_t when, void *arg) +periodic_dirsync(time_t when __attribute__((unused)), void *arg) { slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> periodic_dirsync\n" ); diff --git a/ldap/servers/plugins/replication/windows_private.c b/ldap/servers/plugins/replication/windows_private.c index d82a080..7442801 100644 --- a/ldap/servers/plugins/replication/windows_private.c +++ b/ldap/servers/plugins/replication/windows_private.c @@ -324,7 +324,7 @@ windows_handle_modify_agreement(Repl_Agmt *ra, const char *type, Slapi_Entry *e) } void -windows_update_done(Repl_Agmt *agmt, int is_total) +windows_update_done(Repl_Agmt *agmt, int is_total __attribute__((unused))) { /* "flush" the changes made during the update to the agmt */ /* get the agmt entry */ @@ -2185,9 +2185,9 @@ test_winsync_api_init(const Slapi_DN *ds_subtree, const Slapi_DN *ad_subtree) } static void -test_winsync_dirsync_search_params_cb(void *cbdata, const char *agmt_dn, - char **base, int *scope, char **filter, - char ***attrs, LDAPControl ***serverctrls) +test_winsync_dirsync_search_params_cb(void *cbdata __attribute__((unused)), const char *agmt_dn __attribute__((unused)), + char **base __attribute__((unused)), int *scope __attribute__((unused)), char **filter __attribute__((unused)), + char ***attrs __attribute__((unused)), LDAPControl ***serverctrls __attribute__((unused))) { slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_dirsync_search_params_cb -- begin\n"); @@ -2200,9 +2200,9 @@ test_winsync_dirsync_search_params_cb(void *cbdata, const char *agmt_dn, /* called before searching for a single entry from AD - agmt_dn will be NULL */ static void -test_winsync_pre_ad_search_cb(void *cbdata, const char *agmt_dn, - char **base, int *scope, char **filter, - char ***attrs, LDAPControl ***serverctrls) +test_winsync_pre_ad_search_cb(void *cbdata __attribute__((unused)), const char *agmt_dn __attribute__((unused)), + char **base __attribute__((unused)), int *scope __attribute__((unused)), char **filter __attribute__((unused)), + char ***attrs __attribute__((unused)), LDAPControl ***serverctrls __attribute__((unused))) { slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_pre_ad_search_cb -- begin\n"); @@ -2215,9 +2215,9 @@ test_winsync_pre_ad_search_cb(void *cbdata, const char *agmt_dn, /* called before an internal search to get a single DS entry - agmt_dn will be NULL */ static void -test_winsync_pre_ds_search_entry_cb(void *cbdata, const char *agmt_dn, - char **base, int *scope, char **filter, - char ***attrs, LDAPControl ***serverctrls) +test_winsync_pre_ds_search_entry_cb(void *cbdata __attribute__((unused)), const char *agmt_dn __attribute__((unused)), + char **base __attribute__((unused)), int *scope __attribute__((unused)), char **filter __attribute__((unused)), + char ***attrs __attribute__((unused)), LDAPControl ***serverctrls __attribute__((unused))) { slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_pre_ds_search_cb -- begin\n"); @@ -2230,9 +2230,9 @@ test_winsync_pre_ds_search_entry_cb(void *cbdata, const char *agmt_dn, /* called before the total update to get all entries from the DS to sync to AD */ static void -test_winsync_pre_ds_search_all_cb(void *cbdata, const char *agmt_dn, - char **base, int *scope, char **filter, - char ***attrs, LDAPControl ***serverctrls) +test_winsync_pre_ds_search_all_cb(void *cbdata __attribute__((unused)), const char *agmt_dn __attribute__((unused)), + char **base __attribute__((unused)), int *scope __attribute__((unused)), char **filter, + char ***attrs __attribute__((unused)), LDAPControl ***serverctrls __attribute__((unused))) { slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_pre_ds_search_all_cb -- orig filter [%s] -- begin\n", @@ -2259,9 +2259,9 @@ test_winsync_pre_ds_search_all_cb(void *cbdata, const char *agmt_dn, } static void -test_winsync_pre_ad_mod_user_cb(void *cbdata, const Slapi_Entry *rawentry, - Slapi_Entry *ad_entry, Slapi_Entry *ds_entry, - Slapi_Mods *smods, int *do_modify) +test_winsync_pre_ad_mod_user_cb(void *cbdata __attribute__((unused)), const Slapi_Entry *rawentry __attribute__((unused)), + Slapi_Entry *ad_entry __attribute__((unused)), Slapi_Entry *ds_entry __attribute__((unused)), + Slapi_Mods *smods __attribute__((unused)), int *do_modify __attribute__((unused))) { slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_pre_ad_mod_user_cb -- begin\n"); @@ -2273,9 +2273,9 @@ test_winsync_pre_ad_mod_user_cb(void *cbdata, const Slapi_Entry *rawentry, } static void -test_winsync_pre_ad_mod_group_cb(void *cbdata, const Slapi_Entry *rawentry, - Slapi_Entry *ad_entry, Slapi_Entry *ds_entry, - Slapi_Mods *smods, int *do_modify) +test_winsync_pre_ad_mod_group_cb(void *cbdata __attribute__((unused)), const Slapi_Entry *rawentry __attribute__((unused)), + Slapi_Entry *ad_entry __attribute__((unused)), Slapi_Entry *ds_entry __attribute__((unused)), + Slapi_Mods *smods __attribute__((unused)), int *do_modify __attribute__((unused))) { slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_pre_ad_mod_group_cb -- begin\n"); @@ -2287,9 +2287,9 @@ test_winsync_pre_ad_mod_group_cb(void *cbdata, const Slapi_Entry *rawentry, } static void -test_winsync_pre_ds_mod_user_cb(void *cbdata, const Slapi_Entry *rawentry, - Slapi_Entry *ad_entry, Slapi_Entry *ds_entry, - Slapi_Mods *smods, int *do_modify) +test_winsync_pre_ds_mod_user_cb(void *cbdata __attribute__((unused)), const Slapi_Entry *rawentry __attribute__((unused)), + Slapi_Entry *ad_entry __attribute__((unused)), Slapi_Entry *ds_entry __attribute__((unused)), + Slapi_Mods *smods __attribute__((unused)), int *do_modify __attribute__((unused))) { slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_pre_ds_mod_user_cb -- begin\n"); @@ -2301,9 +2301,9 @@ test_winsync_pre_ds_mod_user_cb(void *cbdata, const Slapi_Entry *rawentry, } static void -test_winsync_pre_ds_mod_group_cb(void *cbdata, const Slapi_Entry *rawentry, - Slapi_Entry *ad_entry, Slapi_Entry *ds_entry, - Slapi_Mods *smods, int *do_modify) +test_winsync_pre_ds_mod_group_cb(void *cbdata __attribute__((unused)), const Slapi_Entry *rawentry __attribute__((unused)), + Slapi_Entry *ad_entry __attribute__((unused)), Slapi_Entry *ds_entry __attribute__((unused)), + Slapi_Mods *smods __attribute__((unused)), int *do_modify __attribute__((unused))) { slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_pre_ds_mod_group_cb -- begin\n"); @@ -2315,8 +2315,8 @@ test_winsync_pre_ds_mod_group_cb(void *cbdata, const Slapi_Entry *rawentry, } static void -test_winsync_pre_ds_add_user_cb(void *cbdata, const Slapi_Entry *rawentry, - Slapi_Entry *ad_entry, Slapi_Entry *ds_entry) +test_winsync_pre_ds_add_user_cb(void *cbdata __attribute__((unused)), const Slapi_Entry *rawentry __attribute__((unused)), + Slapi_Entry *ad_entry __attribute__((unused)), Slapi_Entry *ds_entry __attribute__((unused))) { slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_pre_ds_add_user_cb -- begin\n"); @@ -2328,8 +2328,8 @@ test_winsync_pre_ds_add_user_cb(void *cbdata, const Slapi_Entry *rawentry, } static void -test_winsync_pre_ds_add_group_cb(void *cbdata, const Slapi_Entry *rawentry, - Slapi_Entry *ad_entry, Slapi_Entry *ds_entry) +test_winsync_pre_ds_add_group_cb(void *cbdata __attribute__((unused)), const Slapi_Entry *rawentry __attribute__((unused)), + Slapi_Entry *ad_entry __attribute__((unused)), Slapi_Entry *ds_entry __attribute__((unused))) { slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_pre_ds_add_group_cb -- begin\n"); @@ -2341,9 +2341,9 @@ test_winsync_pre_ds_add_group_cb(void *cbdata, const Slapi_Entry *rawentry, } static void -test_winsync_get_new_ds_user_dn_cb(void *cbdata, const Slapi_Entry *rawentry, - Slapi_Entry *ad_entry, char **new_dn_string, - const Slapi_DN *ds_suffix, const Slapi_DN *ad_suffix) +test_winsync_get_new_ds_user_dn_cb(void *cbdata __attribute__((unused)), const Slapi_Entry *rawentry __attribute__((unused)), + Slapi_Entry *ad_entry __attribute__((unused)), char **new_dn_string, + const Slapi_DN *ds_suffix __attribute__((unused)), const Slapi_DN *ad_suffix __attribute__((unused))) { slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_get_new_ds_user_dn_cb -- old dn [%s] -- begin\n", @@ -2369,9 +2369,9 @@ test_winsync_get_new_ds_user_dn_cb(void *cbdata, const Slapi_Entry *rawentry, } static void -test_winsync_get_new_ds_group_dn_cb(void *cbdata, const Slapi_Entry *rawentry, - Slapi_Entry *ad_entry, char **new_dn_string, - const Slapi_DN *ds_suffix, const Slapi_DN *ad_suffix) +test_winsync_get_new_ds_group_dn_cb(void *cbdata __attribute__((unused)), const Slapi_Entry *rawentry __attribute__((unused)), + Slapi_Entry *ad_entry __attribute__((unused)), char **new_dn_string __attribute__((unused)), + const Slapi_DN *ds_suffix __attribute__((unused)), const Slapi_DN *ad_suffix __attribute__((unused))) { slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_get_new_ds_group_dn_cb -- begin\n"); @@ -2383,10 +2383,10 @@ test_winsync_get_new_ds_group_dn_cb(void *cbdata, const Slapi_Entry *rawentry, } static void -test_winsync_pre_ad_mod_user_mods_cb(void *cbdata, const Slapi_Entry *rawentry, - const Slapi_Entry *ds_entry, - const Slapi_DN *local_dn, LDAPMod * const *origmods, - Slapi_DN *remote_dn, LDAPMod ***modstosend) +test_winsync_pre_ad_mod_user_mods_cb(void *cbdata __attribute__((unused)), const Slapi_Entry *rawentry __attribute__((unused)), + const Slapi_Entry *ds_entry __attribute__((unused)), + const Slapi_DN *local_dn __attribute__((unused)), LDAPMod * const *origmods __attribute__((unused)), + Slapi_DN *remote_dn __attribute__((unused)), LDAPMod ***modstosend __attribute__((unused))) { slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_pre_ad_mod_user_mods_cb -- begin\n"); @@ -2398,10 +2398,10 @@ test_winsync_pre_ad_mod_user_mods_cb(void *cbdata, const Slapi_Entry *rawentry, } static void -test_winsync_pre_ad_mod_group_mods_cb(void *cbdata, const Slapi_Entry *rawentry, - const Slapi_Entry *ds_entry, - const Slapi_DN *local_dn, LDAPMod * const *origmods, - Slapi_DN *remote_dn, LDAPMod ***modstosend) +test_winsync_pre_ad_mod_group_mods_cb(void *cbdata __attribute__((unused)), const Slapi_Entry *rawentry __attribute__((unused)), + const Slapi_Entry *ds_entry __attribute__((unused)), + const Slapi_DN *local_dn __attribute__((unused)), LDAPMod * const *origmods __attribute__((unused)), + Slapi_DN *remote_dn __attribute__((unused)), LDAPMod ***modstosend __attribute__((unused))) { slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_pre_ad_mod_group_mods_cb -- begin\n"); @@ -2413,8 +2413,8 @@ test_winsync_pre_ad_mod_group_mods_cb(void *cbdata, const Slapi_Entry *rawentry, } static int -test_winsync_can_add_entry_to_ad_cb(void *cbdata, const Slapi_Entry *local_entry, - const Slapi_DN *remote_dn) +test_winsync_can_add_entry_to_ad_cb(void *cbdata __attribute__((unused)), const Slapi_Entry *local_entry __attribute__((unused)), + const Slapi_DN *remote_dn __attribute__((unused))) { slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_can_add_entry_to_ad_cb -- begin\n"); @@ -2427,8 +2427,8 @@ test_winsync_can_add_entry_to_ad_cb(void *cbdata, const Slapi_Entry *local_entry } static void -test_winsync_begin_update_cb(void *cbdata, const Slapi_DN *ds_subtree, - const Slapi_DN *ad_subtree, int is_total) +test_winsync_begin_update_cb(void *cbdata __attribute__((unused)), const Slapi_DN *ds_subtree __attribute__((unused)), + const Slapi_DN *ad_subtree __attribute__((unused)), int is_total __attribute__((unused))) { slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_begin_update_cb -- begin\n"); @@ -2440,8 +2440,8 @@ test_winsync_begin_update_cb(void *cbdata, const Slapi_DN *ds_subtree, } static void -test_winsync_end_update_cb(void *cbdata, const Slapi_DN *ds_subtree, - const Slapi_DN *ad_subtree, int is_total) +test_winsync_end_update_cb(void *cbdata __attribute__((unused)), const Slapi_DN *ds_subtree __attribute__((unused)), + const Slapi_DN *ad_subtree __attribute__((unused)), int is_total __attribute__((unused))) { slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_end_update_cb -- begin\n"); @@ -2453,8 +2453,8 @@ test_winsync_end_update_cb(void *cbdata, const Slapi_DN *ds_subtree, } static void -test_winsync_destroy_agmt_cb(void *cbdata, const Slapi_DN *ds_subtree, - const Slapi_DN *ad_subtree) +test_winsync_destroy_agmt_cb(void *cbdata __attribute__((unused)), const Slapi_DN *ds_subtree __attribute__((unused)), + const Slapi_DN *ad_subtree __attribute__((unused))) { slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_destroy_agmt_cb -- begin\n"); @@ -2468,7 +2468,9 @@ test_winsync_destroy_agmt_cb(void *cbdata, const Slapi_DN *ds_subtree, } static void -test_winsync_post_ad_mod_user_cb(void *cookie, const Slapi_Entry *rawentry, Slapi_Entry *ad_entry, Slapi_Entry *ds_entry, Slapi_Mods *smods, int *result) +test_winsync_post_ad_mod_user_cb(void *cookie __attribute__((unused)), const Slapi_Entry *rawentry __attribute__((unused)), + Slapi_Entry *ad_entry __attribute__((unused)), Slapi_Entry *ds_entry __attribute__((unused)), + Slapi_Mods *smods __attribute__((unused)), int *result __attribute__((unused))) { slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_post_ad_mod_user_cb -- begin\n"); @@ -2486,7 +2488,9 @@ test_winsync_post_ad_mod_user_cb(void *cookie, const Slapi_Entry *rawentry, Slap } static void -test_winsync_post_ad_mod_group_cb(void *cookie, const Slapi_Entry *rawentry, Slapi_Entry *ad_entry, Slapi_Entry *ds_entry, Slapi_Mods *smods, int *result) +test_winsync_post_ad_mod_group_cb(void *cookie __attribute__((unused)), const Slapi_Entry *rawentry __attribute__((unused)), + Slapi_Entry *ad_entry __attribute__((unused)), Slapi_Entry *ds_entry __attribute__((unused)), + Slapi_Mods *smods __attribute__((unused)), int *result __attribute__((unused))) { slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_post_ad_mod_group_cb -- begin\n"); @@ -2504,7 +2508,9 @@ test_winsync_post_ad_mod_group_cb(void *cookie, const Slapi_Entry *rawentry, Sla } static void -test_winsync_post_ds_mod_user_cb(void *cookie, const Slapi_Entry *rawentry, Slapi_Entry *ad_entry, Slapi_Entry *ds_entry, Slapi_Mods *smods, int *result) +test_winsync_post_ds_mod_user_cb(void *cookie __attribute__((unused)), const Slapi_Entry *rawentry __attribute__((unused)), + Slapi_Entry *ad_entry __attribute__((unused)), Slapi_Entry *ds_entry __attribute__((unused)), + Slapi_Mods *smods __attribute__((unused)), int *result __attribute__((unused))) { slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_post_ds_mod_user_cb -- begin\n"); @@ -2522,7 +2528,9 @@ test_winsync_post_ds_mod_user_cb(void *cookie, const Slapi_Entry *rawentry, Slap } static void -test_winsync_post_ds_mod_group_cb(void *cookie, const Slapi_Entry *rawentry, Slapi_Entry *ad_entry, Slapi_Entry *ds_entry, Slapi_Mods *smods, int *result) +test_winsync_post_ds_mod_group_cb(void *cookie __attribute__((unused)), const Slapi_Entry *rawentry __attribute__((unused)), + Slapi_Entry *ad_entry __attribute__((unused)), Slapi_Entry *ds_entry __attribute__((unused)), + Slapi_Mods *smods __attribute__((unused)), int *result __attribute__((unused))) { slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_post_ds_mod_group_cb -- begin\n"); @@ -2540,7 +2548,9 @@ test_winsync_post_ds_mod_group_cb(void *cookie, const Slapi_Entry *rawentry, Sla } static void -test_winsync_post_ds_add_user_cb(void *cookie, const Slapi_Entry *rawentry, Slapi_Entry *ad_entry, Slapi_Entry *ds_entry, int *result) +test_winsync_post_ds_add_user_cb(void *cookie __attribute__((unused)), const Slapi_Entry *rawentry __attribute__((unused)), + Slapi_Entry *ad_entry __attribute__((unused)), Slapi_Entry *ds_entry __attribute__((unused)), + int *result __attribute__((unused))) { slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_post_ds_add_user_cb -- begin\n"); @@ -2558,7 +2568,9 @@ test_winsync_post_ds_add_user_cb(void *cookie, const Slapi_Entry *rawentry, Slap } static void -test_winsync_post_ds_add_group_cb(void *cookie, const Slapi_Entry *rawentry, Slapi_Entry *ad_entry, Slapi_Entry *ds_entry, int *result) +test_winsync_post_ds_add_group_cb(void *cookie __attribute__((unused)), const Slapi_Entry *rawentry __attribute__((unused)), + Slapi_Entry *ad_entry __attribute__((unused)), Slapi_Entry *ds_entry __attribute__((unused)), + int *result __attribute__((unused))) { slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_post_ds_add_group_cb -- begin\n"); @@ -2576,7 +2588,8 @@ test_winsync_post_ds_add_group_cb(void *cookie, const Slapi_Entry *rawentry, Sla } static void -test_winsync_pre_ad_add_user_cb(void *cookie, Slapi_Entry *ds_entry, Slapi_Entry *ad_entry) +test_winsync_pre_ad_add_user_cb(void *cookie __attribute__((unused)), Slapi_Entry *ds_entry __attribute__((unused)), + Slapi_Entry *ad_entry __attribute__((unused))) { slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_pre_ad_add_user_cb -- begin\n"); @@ -2595,7 +2608,8 @@ test_winsync_pre_ad_add_user_cb(void *cookie, Slapi_Entry *ds_entry, Slapi_Entry } static void -test_winsync_pre_ad_add_group_cb(void *cookie, Slapi_Entry *ds_entry, Slapi_Entry *ad_entry) +test_winsync_pre_ad_add_group_cb(void *cookie __attribute__((unused)), Slapi_Entry *ds_entry __attribute__((unused)), + Slapi_Entry *ad_entry __attribute__((unused))) { slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_pre_ad_add_group_cb -- begin\n"); @@ -2614,7 +2628,8 @@ test_winsync_pre_ad_add_group_cb(void *cookie, Slapi_Entry *ds_entry, Slapi_Entr } static void -test_winsync_post_ad_add_user_cb(void *cookie, Slapi_Entry *ds_entry, Slapi_Entry *ad_entry, int *result) +test_winsync_post_ad_add_user_cb(void *cookie __attribute__((unused)), Slapi_Entry *ds_entry __attribute__((unused)), + Slapi_Entry *ad_entry __attribute__((unused)), int *result __attribute__((unused))) { slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_post_ad_add_user_cb -- begin\n"); @@ -2632,7 +2647,8 @@ test_winsync_post_ad_add_user_cb(void *cookie, Slapi_Entry *ds_entry, Slapi_Entr } static void -test_winsync_post_ad_add_group_cb(void *cookie, Slapi_Entry *ds_entry, Slapi_Entry *ad_entry, int *result) +test_winsync_post_ad_add_group_cb(void *cookie __attribute__((unused)), Slapi_Entry *ds_entry __attribute__((unused)), + Slapi_Entry *ad_entry __attribute__((unused)), int *result __attribute__((unused))) { slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_post_ad_add_group_cb -- begin\n"); @@ -2650,7 +2666,10 @@ test_winsync_post_ad_add_group_cb(void *cookie, Slapi_Entry *ds_entry, Slapi_Ent } static void -test_winsync_post_ad_mod_user_mods_cb(void *cookie, const Slapi_Entry *rawentry, const Slapi_DN *local_dn, const Slapi_Entry *ds_entry, LDAPMod * const *origmods, Slapi_DN *remote_dn, LDAPMod ***modstosend, int *result) +test_winsync_post_ad_mod_user_mods_cb(void *cookie __attribute__((unused)), const Slapi_Entry *rawentry __attribute__((unused)), + const Slapi_DN *local_dn __attribute__((unused)), const Slapi_Entry *ds_entry __attribute__((unused)), + LDAPMod * const *origmods __attribute__((unused)), Slapi_DN *remote_dn __attribute__((unused)), + LDAPMod ***modstosend __attribute__((unused)), int *result __attribute__((unused))) { slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_post_ad_mod_user_mods_cb -- begin\n"); @@ -2668,7 +2687,10 @@ test_winsync_post_ad_mod_user_mods_cb(void *cookie, const Slapi_Entry *rawentry, } static void -test_winsync_post_ad_mod_group_mods_cb(void *cookie, const Slapi_Entry *rawentry, const Slapi_DN *local_dn, const Slapi_Entry *ds_entry, LDAPMod * const *origmods, Slapi_DN *remote_dn, LDAPMod ***modstosend, int *result) +test_winsync_post_ad_mod_group_mods_cb(void *cookie __attribute__((unused)), const Slapi_Entry *rawentry __attribute__((unused)), + const Slapi_DN *local_dn __attribute__((unused)), const Slapi_Entry *ds_entry __attribute__((unused)), + LDAPMod * const *origmods __attribute__((unused)), Slapi_DN *remote_dn __attribute__((unused)), + LDAPMod ***modstosend __attribute__((unused)), int *result __attribute__((unused))) { slapi_log_err(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, "--> test_winsync_post_ad_mod_group_mods_cb -- begin\n"); @@ -2802,7 +2824,7 @@ static void *test_winsync_api_v3[] = { }; static int -test_winsync_plugin_start(Slapi_PBlock *pb) +test_winsync_plugin_start(Slapi_PBlock *pb __attribute__((unused))) { slapi_log_err(SLAPI_LOG_TRACE, test_winsync_plugin_name, "--> test_winsync_plugin_start -- begin\n"); @@ -2819,7 +2841,7 @@ test_winsync_plugin_start(Slapi_PBlock *pb) } static int -test_winsync_plugin_close(Slapi_PBlock *pb) +test_winsync_plugin_close(Slapi_PBlock *pb __attribute__((unused))) { slapi_log_err(SLAPI_LOG_TRACE, test_winsync_plugin_name, "--> test_winsync_plugin_close -- begin\n"); diff --git a/ldap/servers/plugins/replication/windows_protocol_util.c b/ldap/servers/plugins/replication/windows_protocol_util.c index 87ab252..0eb0bff 100644 --- a/ldap/servers/plugins/replication/windows_protocol_util.c +++ b/ldap/servers/plugins/replication/windows_protocol_util.c @@ -5836,7 +5836,7 @@ done: } static int -windows_process_dirsync_entry(Private_Repl_Protocol *prp,Slapi_Entry *e, int is_total) +windows_process_dirsync_entry(Private_Repl_Protocol *prp,Slapi_Entry *e, int is_total __attribute__((unused))) { Slapi_DN* local_sdn = NULL; int rc = 0; diff --git a/ldap/servers/plugins/replication/windows_tot_protocol.c b/ldap/servers/plugins/replication/windows_tot_protocol.c index 6749cb6..ad6c4f8 100644 --- a/ldap/servers/plugins/replication/windows_tot_protocol.c +++ b/ldap/servers/plugins/replication/windows_tot_protocol.c @@ -315,7 +315,7 @@ windows_tot_stop(Private_Repl_Protocol *prp) static int -windows_tot_status(Private_Repl_Protocol *prp) +windows_tot_status(Private_Repl_Protocol *prp __attribute__((unused))) { int return_value = 0; slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_tot_status\n" ); @@ -326,7 +326,7 @@ windows_tot_status(Private_Repl_Protocol *prp) static void -windows_tot_noop(Private_Repl_Protocol *prp) +windows_tot_noop(Private_Repl_Protocol *prp __attribute__((unused))) { slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "=> windows_tot_noop\n" ); slapi_log_err(SLAPI_LOG_TRACE, windows_repl_plugin_name, "<= windows_tot_noop\n" ); diff --git a/ldap/servers/plugins/retrocl/retrocl.c b/ldap/servers/plugins/retrocl/retrocl.c index 6e68667..54940f8 100644 --- a/ldap/servers/plugins/retrocl/retrocl.c +++ b/ldap/servers/plugins/retrocl/retrocl.c @@ -575,7 +575,7 @@ retrocl_entry_in_scope(Slapi_Entry *e) * */ -static int retrocl_stop (Slapi_PBlock *pb) +static int retrocl_stop (Slapi_PBlock *pb __attribute__((unused))) { int rc = 0; int i = 0; diff --git a/ldap/servers/plugins/retrocl/retrocl_po.c b/ldap/servers/plugins/retrocl/retrocl_po.c index 35ddd32..1d85ea4 100644 --- a/ldap/servers/plugins/retrocl/retrocl_po.c +++ b/ldap/servers/plugins/retrocl/retrocl_po.c @@ -151,7 +151,7 @@ write_replog_db( struct berval *vals[ 2 ]; struct berval val; Slapi_Entry *e; - char chnobuf[ 20 ]; + char chnobuf[ 22 ] = {0}; char *edn; int extensibleObject = 0; int err = 0; diff --git a/ldap/servers/plugins/retrocl/retrocl_rootdse.c b/ldap/servers/plugins/retrocl/retrocl_rootdse.c index 6484dbd..94f027d 100644 --- a/ldap/servers/plugins/retrocl/retrocl_rootdse.c +++ b/ldap/servers/plugins/retrocl/retrocl_rootdse.c @@ -29,7 +29,12 @@ */ int -retrocl_rootdse_search(Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAfter, int *returncode, char *returntext, void *arg) +retrocl_rootdse_search(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* e, + Slapi_Entry* entryAfter __attribute__((unused)), + int *returncode __attribute__((unused)), + char *returntext __attribute__((unused)), + void *arg __attribute__((unused))) { struct berval val; diff --git a/ldap/servers/plugins/retrocl/retrocl_trim.c b/ldap/servers/plugins/retrocl/retrocl_trim.c index 1258c70..5f30217 100644 --- a/ldap/servers/plugins/retrocl/retrocl_trim.c +++ b/ldap/servers/plugins/retrocl/retrocl_trim.c @@ -324,7 +324,7 @@ static int retrocl_active_threads; */ static void -changelog_trim_thread_fn( void *arg ) +changelog_trim_thread_fn( void *arg __attribute__((unused))) { PR_AtomicIncrement(&retrocl_active_threads); trim_changelog(); @@ -343,7 +343,7 @@ changelog_trim_thread_fn( void *arg ) * the database. */ -void retrocl_housekeeping ( time_t cur_time, void *noarg ) +void retrocl_housekeeping ( time_t cur_time, void *noarg __attribute__((unused))) { int ldrc; diff --git a/ldap/servers/plugins/roles/roles_cache.c b/ldap/servers/plugins/roles/roles_cache.c index 4f27c4c..e48b5fc 100644 --- a/ldap/servers/plugins/roles/roles_cache.c +++ b/ldap/servers/plugins/roles/roles_cache.c @@ -425,7 +425,8 @@ static void roles_cache_wait_on_change(void * arg) This is called when a backend changes state (created|modified|deleted) We simply signal to update the associated role cache in this case */ -static void roles_cache_trigger_update_suffix(void *handle, char *be_name, int old_be_state, int new_be_state) +static void roles_cache_trigger_update_suffix(void *handle __attribute__((unused)), char *be_name, + int old_be_state __attribute__((unused)), int new_be_state) { roles_cache_def *current_role = roles_list; const Slapi_DN *be_suffix_dn = NULL; @@ -2209,7 +2210,7 @@ static int roles_cache_role_object_nested_free(role_object_nested *this_role) return 0; } -static int roles_cache_dump( caddr_t data, caddr_t arg ) +static int roles_cache_dump( caddr_t data, caddr_t arg __attribute__((unused))) { role_object *this_role = (role_object*)data; diff --git a/ldap/servers/plugins/roles/roles_plugin.c b/ldap/servers/plugins/roles/roles_plugin.c index 065c333..14341d4 100644 --- a/ldap/servers/plugins/roles/roles_plugin.c +++ b/ldap/servers/plugins/roles/roles_plugin.c @@ -165,7 +165,7 @@ bailout: ----------- kexcoff: cache build at init or at startup ? */ -static int roles_start( Slapi_PBlock *pb ) +static int roles_start( Slapi_PBlock *pb __attribute__((unused))) { int rc = 0; void **statechange_api; @@ -202,7 +202,7 @@ static int roles_start( Slapi_PBlock *pb ) ----------- kexcoff: ?? */ -static int roles_close( Slapi_PBlock *pb ) +static int roles_close( Slapi_PBlock *pb __attribute__((unused))) { void **statechange_api; int rc = 0; @@ -232,16 +232,16 @@ static int roles_close( Slapi_PBlock *pb ) Then we iterate over the in-scope roles calling Slapi_Role_Check(). For those which pass the check, we add their DN to the attribute's value set. */ -int roles_sp_get_value(vattr_sp_handle *handle, +int roles_sp_get_value(vattr_sp_handle *handle __attribute__((unused)), vattr_context *c, Slapi_Entry *e, - char *type, + char *type __attribute__((unused)), Slapi_ValueSet** results, int *type_name_disposition, char** actual_type_name, - int flags, + int flags __attribute__((unused)), int *free_flags, - void *hint) + void *hint __attribute__((unused))) { int rc = -1; @@ -270,7 +270,14 @@ int roles_sp_get_value(vattr_sp_handle *handle, Return true or false to the client. */ -int roles_sp_compare_value(vattr_sp_handle *handle, vattr_context *c, Slapi_Entry *e, char *type, Slapi_Value *test_this, int* result,int flags, void *hint) +int roles_sp_compare_value(vattr_sp_handle *handle __attribute__((unused)), + vattr_context *c __attribute__((unused)), + Slapi_Entry *e, + char *type __attribute__((unused)), + Slapi_Value *test_this, + int* result, + int flags __attribute__((unused)), + void *hint __attribute__((unused))) { int rv; Slapi_DN the_dn; @@ -288,7 +295,10 @@ int roles_sp_compare_value(vattr_sp_handle *handle, vattr_context *c, Slapi_Entr return rv; } -int roles_sp_list_types(vattr_sp_handle *handle,Slapi_Entry *e,vattr_type_list_context *type_context,int flags) +int roles_sp_list_types(vattr_sp_handle *handle __attribute__((unused)), + Slapi_Entry *e, + vattr_type_list_context *type_context, + int flags) { static char* test_type_name = NSROLEATTR; int ret =0; diff --git a/ldap/servers/plugins/rootdn_access/rootdn_access.c b/ldap/servers/plugins/rootdn_access/rootdn_access.c index 3b65900..3450ce2 100644 --- a/ldap/servers/plugins/rootdn_access/rootdn_access.c +++ b/ldap/servers/plugins/rootdn_access/rootdn_access.c @@ -170,7 +170,7 @@ rootdn_preop_bind_init(Slapi_PBlock *pb) } static int -rootdn_start(Slapi_PBlock *pb) +rootdn_start(Slapi_PBlock *pb __attribute__((unused))) { slapi_log_err(SLAPI_LOG_PLUGIN, ROOTDN_PLUGIN_SUBSYSTEM, "--> rootdn_start\n"); @@ -197,7 +197,7 @@ rootdn_free(void) } static int -rootdn_close(Slapi_PBlock *pb) +rootdn_close(Slapi_PBlock *pb __attribute__((unused))) { rootdn_free(); return 0; diff --git a/ldap/servers/plugins/schema_reload/schema_reload.c b/ldap/servers/plugins/schema_reload/schema_reload.c index 6970e12..012c01c 100644 --- a/ldap/servers/plugins/schema_reload/schema_reload.c +++ b/ldap/servers/plugins/schema_reload/schema_reload.c @@ -102,7 +102,7 @@ schemareload_start(Slapi_PBlock *pb) } static int -schemareload_close(Slapi_PBlock *pb) +schemareload_close(Slapi_PBlock *pb __attribute__((unused))) { slapi_plugin_task_unregister_handler("schema reload task", schemareload_add); @@ -230,9 +230,12 @@ schemareload_destructor(Slapi_Task *task) * the task. */ static int -schemareload_add(Slapi_PBlock *pb, Slapi_Entry *e, - Slapi_Entry *eAfter, int *returncode, char *returntext, - void *arg) +schemareload_add(Slapi_PBlock *pb, + Slapi_Entry *e, + Slapi_Entry *eAfter __attribute__((unused)), + int *returncode, + char *returntext __attribute__((unused)), + void *arg) { PRThread *thread = NULL; const char *schemadir = NULL; diff --git a/ldap/servers/plugins/statechange/statechange.c b/ldap/servers/plugins/statechange/statechange.c index 92fac71..2798811 100644 --- a/ldap/servers/plugins/statechange/statechange.c +++ b/ldap/servers/plugins/statechange/statechange.c @@ -127,7 +127,7 @@ int statechange_init( Slapi_PBlock *pb ) --------- This function publishes the interface for this plugin */ -static int statechange_start( Slapi_PBlock *pb ) +static int statechange_start( Slapi_PBlock *pb __attribute__((unused))) { int ret = SLAPI_PLUGIN_SUCCESS; @@ -169,7 +169,7 @@ static int statechange_start( Slapi_PBlock *pb ) --------- unregisters the interface for this plugin */ -static int statechange_close( Slapi_PBlock *pb ) +static int statechange_close( Slapi_PBlock *pb __attribute__((unused))) { slapi_log_err(SLAPI_LOG_TRACE, SCN_PLUGIN_SUBSYSTEM, "--> statechange_close\n"); @@ -485,7 +485,11 @@ static SCNotify *statechange_find_notify(char *dn, char *filter, notify_callback /* intended for use by vattr service providers * to deal with significant vattr state changes */ -static void _statechange_vattr_cache_invalidator_callback(Slapi_Entry *e, char *dn, int modtype, Slapi_PBlock *pb, void *caller_data) +static void _statechange_vattr_cache_invalidator_callback(Slapi_Entry *e, + char *dn __attribute__((unused)), + int modtype __attribute__((unused)), + Slapi_PBlock *pb __attribute__((unused)), + void *caller_data) { /* simply get the significance data and act */ switch(*(int*)caller_data) diff --git a/ldap/servers/plugins/sync/sync_init.c b/ldap/servers/plugins/sync/sync_init.c index 94f4ca9..de0b927 100644 --- a/ldap/servers/plugins/sync/sync_init.c +++ b/ldap/servers/plugins/sync/sync_init.c @@ -139,7 +139,7 @@ sync_start(Slapi_PBlock * pb) Free locks and queues allocated. */ static int -sync_close(Slapi_PBlock * pb) +sync_close(Slapi_PBlock * pb __attribute__((unused))) { sync_persist_terminate_all(); sync_unregister_operation_entension(); diff --git a/ldap/servers/plugins/sync/sync_refresh.c b/ldap/servers/plugins/sync/sync_refresh.c index 8627667..91b5f4b 100644 --- a/ldap/servers/plugins/sync/sync_refresh.c +++ b/ldap/servers/plugins/sync/sync_refresh.c @@ -631,7 +631,7 @@ sync_send_modified_entries(Slapi_PBlock *pb, Sync_UpdateNode *upd, int chg_count } int -sync_send_entry_from_changelog(Slapi_PBlock *pb,int chg_req, char *uniqueid) +sync_send_entry_from_changelog(Slapi_PBlock *pb, int chg_req __attribute__((unused)), char *uniqueid) { Slapi_Entry *db_entry = NULL; int chg_type = LDAP_SYNC_ADD; @@ -677,7 +677,7 @@ new_SyncOpInfo(int flag, PRThread *tid, Sync_Cookie *cookie) { } /* consumer operation extension constructor */ static void * -sync_operation_extension_ctor(void *object, void *parent) +sync_operation_extension_ctor(void *object __attribute__((unused)), void *parent __attribute__((unused))) { /* we only set the extension value explicitly if the client requested the control - see deref_pre_search */ @@ -695,7 +695,7 @@ sync_delete_SyncOpInfo(SyncOpInfo **info) } static void -sync_operation_extension_dtor(void *ext, void *object, void *parent) +sync_operation_extension_dtor(void *ext, void *object __attribute__((unused)), void *parent __attribute__((unused))) { SyncOpInfo *spec = (SyncOpInfo *)ext; sync_delete_SyncOpInfo(&spec); diff --git a/ldap/servers/plugins/sync/sync_util.c b/ldap/servers/plugins/sync/sync_util.c index 2b22910..26de7d9 100644 --- a/ldap/servers/plugins/sync/sync_util.c +++ b/ldap/servers/plugins/sync/sync_util.c @@ -366,7 +366,7 @@ sync_handle_cnum_entry(Slapi_Entry *e, void *cb_data) * */ static char * -sync_cookie_get_server_info(Slapi_PBlock *pb) +sync_cookie_get_server_info(Slapi_PBlock *pb __attribute__((unused))) { char *info_enc; int rc = 0; diff --git a/ldap/servers/plugins/syntaxes/bin.c b/ldap/servers/plugins/syntaxes/bin.c index 1791eb4..6eff5cf 100644 --- a/ldap/servers/plugins/syntaxes/bin.c +++ b/ldap/servers/plugins/syntaxes/bin.c @@ -260,7 +260,7 @@ fax_init( Slapi_PBlock *pb ) static int -bin_filter_ava( Slapi_PBlock *pb, struct berval *bvfilter, +bin_filter_ava( Slapi_PBlock *pb __attribute__((unused)), struct berval *bvfilter, Slapi_Value **bvals, int ftype, Slapi_Value **retVal ) { int i; @@ -304,7 +304,7 @@ bin_filter_ava( Slapi_PBlock *pb, struct berval *bvfilter, } static int -bin_values2keys( Slapi_PBlock *pb, Slapi_Value **bvals, +bin_values2keys( Slapi_PBlock *pb __attribute__((unused)), Slapi_Value **bvals, Slapi_Value ***ivals, int ftype ) { int i; @@ -337,7 +337,7 @@ bin_values2keys( Slapi_PBlock *pb, Slapi_Value **bvals, } static int -bin_assertion2keys_ava( Slapi_PBlock *pb, Slapi_Value *bval, +bin_assertion2keys_ava( Slapi_PBlock *pb __attribute__((unused)), Slapi_Value *bval, Slapi_Value ***ivals, int ftype ) { Slapi_Value *tmpval=NULL; diff --git a/ldap/servers/plugins/syntaxes/bitstring.c b/ldap/servers/plugins/syntaxes/bitstring.c index f91340c..fb7fff7 100644 --- a/ldap/servers/plugins/syntaxes/bitstring.c +++ b/ldap/servers/plugins/syntaxes/bitstring.c @@ -238,7 +238,7 @@ exit: } static void bitstring_normalize( - Slapi_PBlock *pb, + Slapi_PBlock *pb __attribute__((unused)), char *s, int trim_spaces, char **alt diff --git a/ldap/servers/plugins/syntaxes/ces.c b/ldap/servers/plugins/syntaxes/ces.c index 0c02a65..7908a90 100644 --- a/ldap/servers/plugins/syntaxes/ces.c +++ b/ldap/servers/plugins/syntaxes/ces.c @@ -473,7 +473,7 @@ exit: } static void ces_normalize( - Slapi_PBlock *pb, + Slapi_PBlock *pb __attribute__((unused)), char *s, int trim_spaces, char **alt diff --git a/ldap/servers/plugins/syntaxes/cis.c b/ldap/servers/plugins/syntaxes/cis.c index 918e598..e9f5cbc 100644 --- a/ldap/servers/plugins/syntaxes/cis.c +++ b/ldap/servers/plugins/syntaxes/cis.c @@ -1351,7 +1351,7 @@ exit: } static void cis_normalize( - Slapi_PBlock *pb, + Slapi_PBlock *pb __attribute__((unused)), char *s, int trim_spaces, char **alt diff --git a/ldap/servers/plugins/syntaxes/deliverymethod.c b/ldap/servers/plugins/syntaxes/deliverymethod.c index 6b7df01..4669504 100644 --- a/ldap/servers/plugins/syntaxes/deliverymethod.c +++ b/ldap/servers/plugins/syntaxes/deliverymethod.c @@ -305,7 +305,7 @@ exit: } static void delivery_normalize( - Slapi_PBlock *pb, + Slapi_PBlock *pb __attribute__((unused)), char *s, int trim_spaces, char **alt diff --git a/ldap/servers/plugins/syntaxes/dn.c b/ldap/servers/plugins/syntaxes/dn.c index 23af5ec..abc44b5 100644 --- a/ldap/servers/plugins/syntaxes/dn.c +++ b/ldap/servers/plugins/syntaxes/dn.c @@ -203,7 +203,7 @@ static int dn_validate( struct berval *val ) } static void dn_normalize( - Slapi_PBlock *pb, + Slapi_PBlock *pb __attribute__((unused)), char *s, int trim_spaces, char **alt diff --git a/ldap/servers/plugins/syntaxes/facsimile.c b/ldap/servers/plugins/syntaxes/facsimile.c index dafe7e3..5dbc8f7 100644 --- a/ldap/servers/plugins/syntaxes/facsimile.c +++ b/ldap/servers/plugins/syntaxes/facsimile.c @@ -311,7 +311,7 @@ exit: } static void facsimile_normalize( - Slapi_PBlock *pb, + Slapi_PBlock *pb __attribute__((unused)), char *s, int trim_spaces, char **alt diff --git a/ldap/servers/plugins/syntaxes/guide.c b/ldap/servers/plugins/syntaxes/guide.c index 2a17741..77503ea 100644 --- a/ldap/servers/plugins/syntaxes/guide.c +++ b/ldap/servers/plugins/syntaxes/guide.c @@ -722,7 +722,7 @@ exit: } static void guide_normalize( - Slapi_PBlock *pb, + Slapi_PBlock *pb __attribute__((unused)), char *s, int trim_spaces, char **alt diff --git a/ldap/servers/plugins/syntaxes/int.c b/ldap/servers/plugins/syntaxes/int.c index 4a5c5da..0a9f459 100644 --- a/ldap/servers/plugins/syntaxes/int.c +++ b/ldap/servers/plugins/syntaxes/int.c @@ -286,7 +286,7 @@ exit: } static void int_normalize( - Slapi_PBlock *pb, + Slapi_PBlock *pb __attribute__((unused)), char *s, int trim_spaces, char **alt diff --git a/ldap/servers/plugins/syntaxes/nameoptuid.c b/ldap/servers/plugins/syntaxes/nameoptuid.c index 026bb80..ee2df1a 100644 --- a/ldap/servers/plugins/syntaxes/nameoptuid.c +++ b/ldap/servers/plugins/syntaxes/nameoptuid.c @@ -281,7 +281,7 @@ exit: } static void nameoptuid_normalize( - Slapi_PBlock *pb, + Slapi_PBlock *pb __attribute__((unused)), char *s, int trim_spaces, char **alt diff --git a/ldap/servers/plugins/syntaxes/numericstring.c b/ldap/servers/plugins/syntaxes/numericstring.c index 817cd64..f155124 100644 --- a/ldap/servers/plugins/syntaxes/numericstring.c +++ b/ldap/servers/plugins/syntaxes/numericstring.c @@ -290,7 +290,7 @@ exit: } static void numstr_normalize( - Slapi_PBlock *pb, + Slapi_PBlock *pb __attribute__((unused)), char *s, int trim_spaces, char **alt diff --git a/ldap/servers/plugins/syntaxes/sicis.c b/ldap/servers/plugins/syntaxes/sicis.c index a8fc6b3..137fe58 100644 --- a/ldap/servers/plugins/syntaxes/sicis.c +++ b/ldap/servers/plugins/syntaxes/sicis.c @@ -167,7 +167,7 @@ static int sicis_compare( } static void sicis_normalize( - Slapi_PBlock *pb, + Slapi_PBlock *pb __attribute__((unused)), char *s, int trim_spaces, char **alt diff --git a/ldap/servers/plugins/syntaxes/string.c b/ldap/servers/plugins/syntaxes/string.c index a7cca4e..ac3d532 100644 --- a/ldap/servers/plugins/syntaxes/string.c +++ b/ldap/servers/plugins/syntaxes/string.c @@ -643,7 +643,7 @@ string_values2keys( Slapi_PBlock *pb, Slapi_Value **bvals, int string_assertion2keys_ava( - Slapi_PBlock *pb, + Slapi_PBlock *pb __attribute__((unused)), Slapi_Value *val, Slapi_Value ***ivals, int syntax, @@ -912,7 +912,7 @@ substring_comp_keys( char *str, int lenstr, int prepost, - int syntax, + int syntax __attribute__((unused)), char *comp_buf, int *substrlens ) diff --git a/ldap/servers/plugins/syntaxes/tel.c b/ldap/servers/plugins/syntaxes/tel.c index 2ce59a4..c865ebd 100644 --- a/ldap/servers/plugins/syntaxes/tel.c +++ b/ldap/servers/plugins/syntaxes/tel.c @@ -299,7 +299,7 @@ exit: } static void tel_normalize( - Slapi_PBlock *pb, + Slapi_PBlock *pb __attribute__((unused)), char *s, int trim_spaces, char **alt diff --git a/ldap/servers/plugins/syntaxes/teletex.c b/ldap/servers/plugins/syntaxes/teletex.c index 41a3429..11a8fc2 100644 --- a/ldap/servers/plugins/syntaxes/teletex.c +++ b/ldap/servers/plugins/syntaxes/teletex.c @@ -330,7 +330,7 @@ exit: } static void teletex_normalize( - Slapi_PBlock *pb, + Slapi_PBlock *pb __attribute__((unused)), char *s, int trim_spaces, char **alt diff --git a/ldap/servers/plugins/syntaxes/telex.c b/ldap/servers/plugins/syntaxes/telex.c index 2a415e2..3d42386 100644 --- a/ldap/servers/plugins/syntaxes/telex.c +++ b/ldap/servers/plugins/syntaxes/telex.c @@ -244,7 +244,7 @@ exit: } static void telex_normalize( - Slapi_PBlock *pb, + Slapi_PBlock *pb __attribute__((unused)), char *s, int trim_spaces, char **alt diff --git a/ldap/servers/plugins/syntaxes/validate_task.c b/ldap/servers/plugins/syntaxes/validate_task.c index eae2d2a..0f4e626 100644 --- a/ldap/servers/plugins/syntaxes/validate_task.c +++ b/ldap/servers/plugins/syntaxes/validate_task.c @@ -75,16 +75,19 @@ syntax_validate_task_init(Slapi_PBlock *pb) } static int -syntax_validate_task_start(Slapi_PBlock *pb) +syntax_validate_task_start(Slapi_PBlock *pb __attribute__((unused))) { int rc = slapi_task_register_handler("syntax validate", syntax_validate_task_add); return rc; } static int -syntax_validate_task_add(Slapi_PBlock *pb, Slapi_Entry *e, - Slapi_Entry *eAfter, int *returncode, - char *returntext, void *arg) +syntax_validate_task_add(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry *e, + Slapi_Entry *eAfter __attribute__((unused)), + int *returncode, + char *returntext __attribute__((unused)), + void *arg __attribute__((unused))) { PRThread *thread = NULL; int rv = SLAPI_DSE_CALLBACK_OK; diff --git a/ldap/servers/plugins/syntaxes/value.c b/ldap/servers/plugins/syntaxes/value.c index e8296be..c702324 100644 --- a/ldap/servers/plugins/syntaxes/value.c +++ b/ldap/servers/plugins/syntaxes/value.c @@ -197,9 +197,9 @@ value_normalize_ext( void value_normalize( - char *s, - int syntax, - int trim_spaces + char *s __attribute__((unused)), + int syntax __attribute__((unused)), + int trim_spaces __attribute__((unused)) ) { /* deprecated */ diff --git a/ldap/servers/plugins/uiduniq/utils.c b/ldap/servers/plugins/uiduniq/utils.c index 4fad2f0..b238b14 100644 --- a/ldap/servers/plugins/uiduniq/utils.c +++ b/ldap/servers/plugins/uiduniq/utils.c @@ -88,7 +88,7 @@ readPblockAndEntry( Slapi_DN *baseDN, const char *filter, * 0 - the entry doesn't contain the object class value */ int -entryHasObjectClass(Slapi_PBlock *pb, Slapi_Entry *e, +entryHasObjectClass(Slapi_PBlock *pb __attribute__((unused)), Slapi_Entry *e, const char *objectClass) { Slapi_Attr *attr; Slapi_Value *v; diff --git a/ldap/servers/plugins/usn/usn.c b/ldap/servers/plugins/usn/usn.c index 5e67e0a..baef02e 100644 --- a/ldap/servers/plugins/usn/usn.c +++ b/ldap/servers/plugins/usn/usn.c @@ -267,7 +267,7 @@ bail: } static int -usn_close(Slapi_PBlock *pb) +usn_close(Slapi_PBlock *pb __attribute__((unused))) { slapi_log_err(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM, "--> usn_close\n"); @@ -613,7 +613,7 @@ bail: /* mimic replication to turn on create_tombstone_entry */ static int -usn_get_attr(Slapi_PBlock *pb, const char* type, void *value) +usn_get_attr(Slapi_PBlock *pb __attribute__((unused)), const char* type, void *value) { if (0 == strcasecmp(type, "nsds5ReplicaTombstonePurgeInterval")) { *(int *)value = 1; @@ -647,8 +647,12 @@ usn_get_identity(void) * lastusn;testbackend: 15 */ static int -usn_rootdse_search(Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAfter, - int *returncode, char *returntext, void *arg) +usn_rootdse_search(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* e, + Slapi_Entry* entryAfter __attribute__((unused)), + int *returncode __attribute__((unused)), + char *returntext __attribute__((unused)), + void *arg __attribute__((unused))) { char *cookie = NULL; Slapi_Backend *be; diff --git a/ldap/servers/plugins/usn/usn_cleanup.c b/ldap/servers/plugins/usn/usn_cleanup.c index 4338854..2ddd0e6 100644 --- a/ldap/servers/plugins/usn/usn_cleanup.c +++ b/ldap/servers/plugins/usn/usn_cleanup.c @@ -225,8 +225,12 @@ bail: } static int -usn_cleanup_add(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter, - int *returncode, char *returntext, void *arg) +usn_cleanup_add(Slapi_PBlock *pb, + Slapi_Entry *e, + Slapi_Entry *eAfter __attribute__((unused)), + int *returncode, + char *returntext __attribute__((unused)), + void *arg) { PRThread *thread = NULL; char *cn = NULL; diff --git a/ldap/servers/plugins/views/views.c b/ldap/servers/plugins/views/views.c index b705dda..264edd2 100644 --- a/ldap/servers/plugins/views/views.c +++ b/ldap/servers/plugins/views/views.c @@ -199,7 +199,7 @@ void views_unlock(void) --------- This function publishes the interface for this plugin */ -static int views_start( Slapi_PBlock *pb ) +static int views_start( Slapi_PBlock *pb __attribute__((unused))) { int ret = SLAPI_PLUGIN_SUCCESS; void **statechange_api; @@ -348,7 +348,7 @@ bail: --------- unregisters the interface for this plugin */ -static int views_close( Slapi_PBlock *pb ) +static int views_close( Slapi_PBlock *pb __attribute__((unused))) { void **statechange_api; slapi_log_err(SLAPI_LOG_TRACE, VIEWS_PLUGIN_SUBSYSTEM, "--> views_close\n"); @@ -1362,7 +1362,8 @@ static void views_cache_add_ll_entry(void** attrval, void *theVal) update internal view cache after state change */ -static void views_update_views_cache( Slapi_Entry *e, char *dn, int modtype, Slapi_PBlock *pb, void *caller_data ) +static void views_update_views_cache( Slapi_Entry *e, char *dn __attribute__((unused)), + int modtype, Slapi_PBlock *pb, void *caller_data __attribute__((unused))) { char *pDn; viewEntry *theView; @@ -1861,8 +1862,8 @@ end: * We simply signal to rebuild the cache in this case * */ -static void views_cache_backend_state_change(void *handle, char *be_name, - int old_be_state, int new_be_state) +static void views_cache_backend_state_change(void *handle __attribute__((unused)), char *be_name __attribute__((unused)), + int old_be_state __attribute__((unused)), int new_be_state __attribute__((unused))) { /* we will create a thread to do this since * calling views_cache_create() directly will @@ -1881,7 +1882,7 @@ static void views_cache_backend_state_change(void *handle, char *be_name, } } -static void views_cache_act_on_change_thread(void *arg) +static void views_cache_act_on_change_thread(void *arg __attribute__((unused))) { views_cache_create(); } diff --git a/ldap/servers/slapd/add.c b/ldap/servers/slapd/add.c index 1b994a0..989494b 100644 --- a/ldap/servers/slapd/add.c +++ b/ldap/servers/slapd/add.c @@ -280,7 +280,7 @@ done: tree it is trying to modify. Use slapi_add_internal_pb instead Beware: The entry is consumed. */ Slapi_PBlock * -slapi_add_entry_internal(Slapi_Entry *e, LDAPControl **controls, int dummy) +slapi_add_entry_internal(Slapi_Entry *e, LDAPControl **controls, int dummy __attribute__((unused))) { Slapi_PBlock pb; Slapi_PBlock *result_pb = NULL; diff --git a/ldap/servers/slapd/attr.c b/ldap/servers/slapd/attr.c index 76573ed..b8d991f 100644 --- a/ldap/servers/slapd/attr.c +++ b/ldap/servers/slapd/attr.c @@ -754,7 +754,7 @@ attr_next_deleted_value( Slapi_Attr *a, int hint, Slapi_Value **v) * the csn related information and roll it up higher to the level of entry. */ void -attr_purge_state_information(Slapi_Entry *entry, Slapi_Attr *attr, const CSN *csnUpTo) +attr_purge_state_information(Slapi_Entry *entry __attribute__((unused)), Slapi_Attr *attr, const CSN *csnUpTo) { if(!valueset_isempty(&attr->a_deleted_values)) { @@ -938,7 +938,7 @@ int attr_replace(Slapi_Attr *a, Slapi_Value **vals) } int -attr_check_onoff ( const char *attr_name, char *value, long minval, long maxval, char *errorbuf, size_t ebuflen ) +attr_check_onoff ( const char *attr_name, char *value, long minval __attribute__((unused)), long maxval __attribute__((unused)), char *errorbuf, size_t ebuflen ) { int retVal = LDAP_SUCCESS; diff --git a/ldap/servers/slapd/attrsyntax.c b/ldap/servers/slapd/attrsyntax.c index 9b5be46..9e836b6 100644 --- a/ldap/servers/slapd/attrsyntax.c +++ b/ldap/servers/slapd/attrsyntax.c @@ -629,13 +629,19 @@ attr_syntax_exists(const char *attr_name) static void default_dirstring_normalize_int(char *s, int trim_spaces); static -int default_dirstring_filter_ava( struct berval *bvfilter, Slapi_Value **bvals,int ftype, Slapi_Value **retVal ) +int default_dirstring_filter_ava( struct berval *bvfilter __attribute__((unused)), + Slapi_Value **bvals __attribute__((unused)), + int ftype __attribute__((unused)), + Slapi_Value **retVal __attribute__((unused))) { return(0); } static -int default_dirstring_values2keys( Slapi_PBlock *pb, Slapi_Value **bvals,Slapi_Value ***ivals, int ftype ) +int default_dirstring_values2keys( Slapi_PBlock *pb __attribute__((unused)), + Slapi_Value **bvals, + Slapi_Value ***ivals, + int ftype) { int numbvals = 0; Slapi_Value **nbvals, **nbvlp; @@ -679,19 +685,27 @@ int default_dirstring_values2keys( Slapi_PBlock *pb, Slapi_Value **bvals,Slapi_V } static -int default_dirstring_assertion2keys_ava(Slapi_PBlock *pb,Slapi_Value *val,Slapi_Value ***ivals,int ftype ) +int default_dirstring_assertion2keys_ava(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Value *val __attribute__((unused)), + Slapi_Value ***ivals __attribute__((unused)), + int ftype __attribute__((unused)) ) { return(0); } static -int default_dirstring_cmp(struct berval *v1,struct berval *v2, int normalize) +int default_dirstring_cmp(struct berval *v1 __attribute__((unused)), + struct berval *v2 __attribute__((unused)), + int normalize __attribute__((unused))) { return(0); } static -void default_dirstring_normalize(Slapi_PBlock *pb, char *s, int trim_spaces, char **alt) +void default_dirstring_normalize(Slapi_PBlock *pb __attribute__((unused)), + char *s, + int trim_spaces, + char **alt __attribute__((unused))) { default_dirstring_normalize_int(s, trim_spaces); } diff --git a/ldap/servers/slapd/back-ldbm/cache.c b/ldap/servers/slapd/back-ldbm/cache.c index ade2240..b872f93 100644 --- a/ldap/servers/slapd/back-ldbm/cache.c +++ b/ldap/servers/slapd/back-ldbm/cache.c @@ -1553,7 +1553,7 @@ int cache_lock_entry(struct cache *cache, struct backentry *e) } /* the opposite of above */ -void cache_unlock_entry(struct cache *cache, struct backentry *e) +void cache_unlock_entry(struct cache *cache __attribute__((unused)), struct backentry *e) { LOG("=> cache_unlock_entry\n"); if (PR_ExitMonitor(e->ep_mutexp)) { diff --git a/ldap/servers/slapd/back-ldbm/close.c b/ldap/servers/slapd/back-ldbm/close.c index 73e6d56..2bf2532 100644 --- a/ldap/servers/slapd/back-ldbm/close.c +++ b/ldap/servers/slapd/back-ldbm/close.c @@ -50,7 +50,7 @@ int ldbm_back_flush( Slapi_PBlock *pb ) return 0; } -void ldbm_back_instance_set_destructor(void **arg) +void ldbm_back_instance_set_destructor(void **arg __attribute__((unused))) { /* Objset *instance_set = (Objset *) *arg; diff --git a/ldap/servers/slapd/back-ldbm/dbhelp.c b/ldap/servers/slapd/back-ldbm/dbhelp.c index d273e8b..9892185 100644 --- a/ldap/servers/slapd/back-ldbm/dbhelp.c +++ b/ldap/servers/slapd/back-ldbm/dbhelp.c @@ -24,7 +24,7 @@ static int dblayer_copy_file_keybykey(DB_ENV *env, char *source_file_name, char *destination_file_name, - int overwrite, + int overwrite __attribute__((unused)), dblayer_private *priv, ldbm_instance *inst) { diff --git a/ldap/servers/slapd/back-ldbm/dblayer.c b/ldap/servers/slapd/back-ldbm/dblayer.c index 507a3cc..fcf69c8 100644 --- a/ldap/servers/slapd/back-ldbm/dblayer.c +++ b/ldap/servers/slapd/back-ldbm/dblayer.c @@ -301,7 +301,7 @@ int dblayer_db_uses_logging(DB_ENV *db_env) { */ int -dblayer_set_batch_transactions(void *arg, void *value, char *errorbuf, int phase, int apply) { +dblayer_set_batch_transactions(void *arg __attribute__((unused)), void *value, char *errorbuf __attribute__((unused)), int phase, int apply) { int val = (int)((uintptr_t)value); int retval = LDAP_SUCCESS; @@ -336,7 +336,7 @@ dblayer_set_batch_transactions(void *arg, void *value, char *errorbuf, int phase } int -dblayer_set_batch_txn_min_sleep(void *arg, void *value, char *errorbuf, int phase, int apply) { +dblayer_set_batch_txn_min_sleep(void *arg __attribute__((unused)), void *value, char *errorbuf __attribute__((unused)), int phase, int apply) { int val = (int)((uintptr_t)value); int retval = LDAP_SUCCESS; @@ -367,7 +367,7 @@ dblayer_set_batch_txn_min_sleep(void *arg, void *value, char *errorbuf, int phas } int -dblayer_set_batch_txn_max_sleep(void *arg, void *value, char *errorbuf, int phase, int apply) { +dblayer_set_batch_txn_max_sleep(void *arg __attribute__((unused)), void *value, char *errorbuf __attribute__((unused)), int phase, int apply) { int val = (int)((uintptr_t)value); int retval = LDAP_SUCCESS; @@ -399,17 +399,17 @@ dblayer_set_batch_txn_max_sleep(void *arg, void *value, char *errorbuf, int phas } void * -dblayer_get_batch_transactions(void *arg) { +dblayer_get_batch_transactions(void *arg __attribute__((unused))) { return (void *)((uintptr_t)trans_batch_limit); } void * -dblayer_get_batch_txn_min_sleep(void *arg) { +dblayer_get_batch_txn_min_sleep(void *arg __attribute__((unused))) { return (void *)((uintptr_t)trans_batch_txn_min_sleep); } void * -dblayer_get_batch_txn_max_sleep(void *arg) { +dblayer_get_batch_txn_max_sleep(void *arg __attribute__((unused))) { return (void *)((uintptr_t)trans_batch_txn_max_sleep); } @@ -424,7 +424,7 @@ dblayer_get_batch_txn_max_sleep(void *arg) { static int dblayer_txn_checkpoint(struct ldbminfo *li, struct dblayer_private_env *env, - PRBool use_lock, PRBool busy_skip, PRBool db_force) + PRBool use_lock __attribute__((unused)), PRBool busy_skip, PRBool db_force) { int ret = 0; if (busy_skip && is_anyinstance_busy(li)) @@ -504,10 +504,10 @@ static void dblayer_reset_env(struct ldbminfo *li) /* Callback function for libdb to spit error info into our log */ #if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR >= 4300 -void dblayer_log_print(const DB_ENV *dbenv, const char* prefix, +void dblayer_log_print(const DB_ENV *dbenv __attribute__((unused)), const char* prefix __attribute__((unused)), const char *buffer) #else -void dblayer_log_print(const char* prefix, char *buffer) +void dblayer_log_print(const char* prefix __attribute__((unused)), char *buffer) #endif { /* We ignore the prefix since we know who we are anyway */ @@ -600,7 +600,7 @@ static int dblayer_seek24_large(int fd, size_t pgsize, db_pgno_t pageno, * off64_t st_size; * long st_blksize; */ -static int dblayer_ioinfo_large(const char *path, int fd, u_int32_t *mbytesp, +static int dblayer_ioinfo_large(const char *path __attribute__((unused)), int fd, u_int32_t *mbytesp, u_int32_t *bytesp, u_int32_t *iosizep) { struct stat64 sb; @@ -644,7 +644,7 @@ int dblayer_open_huge_file(const char *path, int oflag, int mode) #endif /* DB_USE_64LFS */ -static int dblayer_override_libdb_functions(DB_ENV *pEnv, dblayer_private *priv) +static int dblayer_override_libdb_functions(DB_ENV *pEnv __attribute__((unused)), dblayer_private *priv __attribute__((unused))) { #ifdef DB_USE_64LFS int major = 0; @@ -997,7 +997,7 @@ static int dblayer_grok_directory(char *directory, int flags) } static void -dblayer_set_data_dir(dblayer_private *priv, struct dblayer_private_env *pEnv, +dblayer_set_data_dir(dblayer_private *priv __attribute__((unused)), struct dblayer_private_env *pEnv, char **data_directories) { char **dirp; @@ -2217,7 +2217,7 @@ int dblayer_get_id2entry(backend *be, DB **ppDB) return 0; } -int dblayer_release_id2entry(backend *be, DB *pDB) +int dblayer_release_id2entry(backend *be __attribute__((unused)), DB *pDB __attribute__((unused))) { return 0; } @@ -2750,7 +2750,7 @@ int dblayer_close(struct ldbminfo *li, int dbmode) * to write a checkpoint. */ int -dblayer_flush(struct ldbminfo *li) +dblayer_flush(struct ldbminfo *li __attribute__((unused))) { return 0; } @@ -3147,7 +3147,7 @@ int dblayer_get_index_file(backend *be, struct attrinfo *a, DB** ppDB, int open_ /* * Unlock the db lib mutex here if we need to. */ -int dblayer_release_index_file(backend *be,struct attrinfo *a, DB* pDB) +int dblayer_release_index_file(backend *be __attribute__((unused)), struct attrinfo *a, DB* pDB __attribute__((unused))) { PR_AtomicDecrement(&a->ai_dblayer_count); return 0; @@ -3335,7 +3335,7 @@ int dblayer_erase_index_file(backend *be, struct attrinfo *a, int no_force_chkpt * The lower levels of the back-end look into this structure, and * take out the DB_TXN they need. */ -int dblayer_txn_init(struct ldbminfo *li, back_txn *txn) +int dblayer_txn_init(struct ldbminfo *li __attribute__((unused)), back_txn *txn) { back_txn *cur_txn = dblayer_get_pvt_txn(); PR_ASSERT(NULL != txn); @@ -5628,7 +5628,7 @@ static int count_dbfiles_in_dir(char *directory, int *count, int recurse) */ int -dblayer_copyfile(char *source, char *destination, int overwrite, int mode) +dblayer_copyfile(char *source, char *destination, int overwrite __attribute__((unused)), int mode) { #ifdef DB_USE_64LFS #define OPEN_FUNCTION dblayer_open_large diff --git a/ldap/servers/slapd/back-ldbm/filterindex.c b/ldap/servers/slapd/back-ldbm/filterindex.c index bde7e9e..4562be9 100644 --- a/ldap/servers/slapd/back-ldbm/filterindex.c +++ b/ldap/servers/slapd/back-ldbm/filterindex.c @@ -181,8 +181,8 @@ ava_candidates( backend *be, Slapi_Filter *f, int ftype, - Slapi_Filter *nextf, - int range, + Slapi_Filter *nextf __attribute__((unused)), + int range __attribute__((unused)), int *err, int allidslimit ) diff --git a/ldap/servers/slapd/back-ldbm/idl.c b/ldap/servers/slapd/back-ldbm/idl.c index 46f4242..ea5df35 100644 --- a/ldap/servers/slapd/back-ldbm/idl.c +++ b/ldap/servers/slapd/back-ldbm/idl.c @@ -78,7 +78,7 @@ static void idl_init_maxids(struct ldbminfo *li,idl_private *priv) } /* routine to initialize the private data used by the IDL code per-attribute */ -int idl_old_init_private(backend *be,struct attrinfo *a) +int idl_old_init_private(backend *be __attribute__((unused)), struct attrinfo *a) { idl_private *priv = NULL; @@ -185,7 +185,7 @@ static void idl_unlock_list(idl_private *priv, DBT *key) */ static IDList * idl_fetch_one( - struct ldbminfo *li, + struct ldbminfo *li __attribute__((unused)), DB *db, DBT *key, DB_TXN *txn, @@ -230,7 +230,7 @@ idl_old_fetch( DB *db, DBT *key, DB_TXN *txn, - struct attrinfo *a, + struct attrinfo *a __attribute__((unused)), int *err ) { @@ -368,7 +368,7 @@ idl_old_fetch( static int idl_store( - backend *be, + backend *be __attribute__((unused)), DB *db, DBT *key, IDList *idl, @@ -1343,7 +1343,7 @@ idl_old_delete_key( DBT *key, ID id, DB_TXN *txn, - struct attrinfo *a + struct attrinfo *a __attribute__((unused)) ) { struct ldbminfo *li = (struct ldbminfo *) be->be_database->plg_private; diff --git a/ldap/servers/slapd/back-ldbm/idl_common.c b/ldap/servers/slapd/back-ldbm/idl_common.c index afd9d52..cd3458e 100644 --- a/ldap/servers/slapd/back-ldbm/idl_common.c +++ b/ldap/servers/slapd/back-ldbm/idl_common.c @@ -438,7 +438,7 @@ idl_nextid( IDList *idl, ID id ) } /* Make an ID list iterator */ -idl_iterator idl_iterator_init(const IDList *idl) +idl_iterator idl_iterator_init(const IDList *idl __attribute__((unused))) { return (idl_iterator) 0; } diff --git a/ldap/servers/slapd/back-ldbm/idl_new.c b/ldap/servers/slapd/back-ldbm/idl_new.c index 4145a1b..94bc7c6 100644 --- a/ldap/servers/slapd/back-ldbm/idl_new.c +++ b/ldap/servers/slapd/back-ldbm/idl_new.c @@ -768,12 +768,12 @@ error: } int idl_new_insert_key( - backend *be, + backend *be __attribute__((unused)), DB* db, DBT *key, ID id, DB_TXN *txn, - struct attrinfo *a, + struct attrinfo *a __attribute__((unused)), int *disposition ) { @@ -875,12 +875,12 @@ error: } int idl_new_delete_key( - backend *be, + backend *be __attribute__((unused)), DB *db, DBT *key, ID id, DB_TXN *txn, - struct attrinfo *a + struct attrinfo *a __attribute__((unused)) ) { int ret = 0; @@ -1006,12 +1006,12 @@ error: #endif int idl_new_store_block( - backend *be, + backend *be __attribute__((unused)), DB *db, DBT *key, IDList *idl, DB_TXN *txn, - struct attrinfo *a + struct attrinfo *a __attribute__((unused)) ) { int ret = 0; @@ -1112,7 +1112,7 @@ error: /* idl_new_compare_dups: comparing ID, pass to libdb for callback */ int idl_new_compare_dups( #if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR >= 3200 - DB *db, + DB *db __attribute__((unused)), #endif const DBT *a, const DBT *b diff --git a/ldap/servers/slapd/back-ldbm/import-threads.c b/ldap/servers/slapd/back-ldbm/import-threads.c index 087103b..a13565f 100644 --- a/ldap/servers/slapd/back-ldbm/import-threads.c +++ b/ldap/servers/slapd/back-ldbm/import-threads.c @@ -3365,12 +3365,12 @@ static int bulk_import_queue(ImportJob *job, Slapi_Entry *entry) return 0; } -void *factory_constructor(void *object, void *parent) +void *factory_constructor(void *object __attribute__((unused)), void *parent __attribute__((unused))) { return NULL; } -void factory_destructor(void *extension, void *object, void *parent) +void factory_destructor(void *extension, void *object __attribute__((unused)), void *parent __attribute__((unused))) { ImportJob *job = (ImportJob *)extension; PRThread *thread; diff --git a/ldap/servers/slapd/back-ldbm/index.c b/ldap/servers/slapd/back-ldbm/index.c index d4de28c..7b4fdb0 100644 --- a/ldap/servers/slapd/back-ldbm/index.c +++ b/ldap/servers/slapd/back-ldbm/index.c @@ -1796,7 +1796,7 @@ static int addordel_values_sv( backend *be, DB *db, - char *type, + char *type __attribute__((unused)), const char *indextype, Slapi_Value **vals, ID id, @@ -2193,10 +2193,10 @@ index_addordel_values_ext_sv( int index_delete_values( - struct ldbminfo *li, - char *type, - struct berval **vals, - ID id + struct ldbminfo *li __attribute__((unused)), + char *type __attribute__((unused)), + struct berval **vals __attribute__((unused)), + ID id __attribute__((unused)) ) { return -1; diff --git a/ldap/servers/slapd/back-ldbm/init.c b/ldap/servers/slapd/back-ldbm/init.c index 07aa27a..ded2f27 100644 --- a/ldap/servers/slapd/back-ldbm/init.c +++ b/ldap/servers/slapd/back-ldbm/init.c @@ -24,7 +24,7 @@ static Slapi_PluginDesc pdesc = { "ldbm-backend", VENDOR, /* pb: not used */ int -ldbm_back_add_schema( Slapi_PBlock *pb ) +ldbm_back_add_schema( Slapi_PBlock *pb __attribute__((unused))) { int rc = 0; rc = slapi_add_internal_attr_syntax( LDBM_ENTRYDN_STR, diff --git a/ldap/servers/slapd/back-ldbm/ldbm_abandon.c b/ldap/servers/slapd/back-ldbm/ldbm_abandon.c index 45a3208..cca713e 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_abandon.c +++ b/ldap/servers/slapd/back-ldbm/ldbm_abandon.c @@ -15,7 +15,7 @@ #include "back-ldbm.h" -int ldbm_back_abandon(Slapi_PBlock *pb) +int ldbm_back_abandon(Slapi_PBlock *pb __attribute__((unused))) { /* DBDB need to implement this */ return 0; diff --git a/ldap/servers/slapd/back-ldbm/ldbm_attr.c b/ldap/servers/slapd/back-ldbm/ldbm_attr.c index 331554e..17c0644 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_attr.c +++ b/ldap/servers/slapd/back-ldbm/ldbm_attr.c @@ -69,7 +69,7 @@ attrinfo_delete(struct attrinfo **pp) } static int -attrinfo_internal_delete( caddr_t data, caddr_t arg ) +attrinfo_internal_delete( caddr_t data, caddr_t arg __attribute__((unused))) { struct attrinfo *n = (struct attrinfo *)data; attrinfo_delete(&n); @@ -644,7 +644,7 @@ attr_index_config( char *fname, int lineno, Slapi_Entry *e, - int init, + int init __attribute__((unused)), int indextype_none ) { diff --git a/ldap/servers/slapd/back-ldbm/ldbm_attrcrypt.c b/ldap/servers/slapd/back-ldbm/ldbm_attrcrypt.c index b558df0..f0df1a5 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_attrcrypt.c +++ b/ldap/servers/slapd/back-ldbm/ldbm_attrcrypt.c @@ -582,7 +582,7 @@ attrcrypt_init(ldbm_instance *li) * If this function succeeds, then its ok to go on to use the * cipher. */ -int attrcrypt_check_enable_cipher(attrcrypt_cipher_entry *ace) +int attrcrypt_check_enable_cipher(attrcrypt_cipher_entry *ace __attribute__((unused))) { int ret = 0; slapi_log_err(SLAPI_LOG_TRACE,"attrcrypt_check_enable_cipher", "->\n"); @@ -1234,7 +1234,7 @@ bail: /* Initialize the structure for a single cipher */ static int _back_crypt_cipher_init(Slapi_Backend *be, - attrcrypt_state_private **state_priv, + attrcrypt_state_private **state_priv __attribute__((unused)), attrcrypt_cipher_entry *ace, SECKEYPrivateKey *private_key, SECKEYPublicKey *public_key, @@ -1493,11 +1493,11 @@ _back_crypt_acs_list_add(attrcrypt_state_private **state_priv, /* Either encipher or decipher an attribute value */ static int -_back_crypt_crypto_op(attrcrypt_private *priv, +_back_crypt_crypto_op(attrcrypt_private *priv __attribute__((unused)), attrcrypt_cipher_state *acs, char *in_data, size_t in_size, char **out_data, size_t *out_size, int encrypt, - backend *be, struct attrinfo *ai /* just for debugging */) + backend *be __attribute__((unused)), struct attrinfo *ai __attribute__((unused))/* just for debugging */) { int rc = -1; SECStatus secret = 0; diff --git a/ldap/servers/slapd/back-ldbm/ldbm_attrcrypt_config.c b/ldap/servers/slapd/back-ldbm/ldbm_attrcrypt_config.c index 0aa6b7e..5fbf6bc 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_attrcrypt_config.c +++ b/ldap/servers/slapd/back-ldbm/ldbm_attrcrypt_config.c @@ -52,7 +52,7 @@ ldbm_attrcrypt_parse_cipher(char* cipher_display_name) } static int -ldbm_attrcrypt_parse_entry(ldbm_instance *inst, Slapi_Entry *e, +ldbm_attrcrypt_parse_entry(ldbm_instance *inst __attribute__((unused)), Slapi_Entry *e, char **attribute_name, int *cipher) { @@ -117,7 +117,12 @@ ldbm_instance_attrcrypt_disable(struct attrinfo *ai) * Config DSE callback for attribute encryption entry add. */ int -ldbm_instance_attrcrypt_config_add_callback(Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* eAfter, int *returncode, char *returntext, void *arg) +ldbm_instance_attrcrypt_config_add_callback(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* e, + Slapi_Entry* eAfter __attribute__((unused)), + int *returncode, + char *returntext, + void *arg) { ldbm_instance *inst = (ldbm_instance *) arg; char *attribute_name = NULL; @@ -194,8 +199,13 @@ ldbm_attrcrypt_init_entry_callback(Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry /* * Config DSE callback for attribute encryption deletes. */ -int -ldbm_instance_attrcrypt_config_delete_callback(Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAfter, int *returncode, char *returntext, void *arg) +int +ldbm_instance_attrcrypt_config_delete_callback(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* e, + Slapi_Entry* entryAfter __attribute__((unused)), + int *returncode, + char *returntext, + void *arg) { ldbm_instance *inst = (ldbm_instance *) arg; char *attribute_name = NULL; @@ -238,7 +248,7 @@ ldbm_instance_attrcrypt_config_delete_callback(Slapi_PBlock *pb, Slapi_Entry* e, */ int ldbm_instance_attrcrypt_config_modify_callback(Slapi_PBlock *pb, Slapi_Entry *e, - Slapi_Entry *entryAfter, int *returncode, char *returntext, void *arg) + Slapi_Entry *entryAfter __attribute__((unused)), int *returncode, char *returntext, void *arg) { ldbm_instance *inst = (ldbm_instance *)arg; Slapi_Attr *attr; diff --git a/ldap/servers/slapd/back-ldbm/ldbm_config.c b/ldap/servers/slapd/back-ldbm/ldbm_config.c index dfe7a13..00dcd3a 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_config.c +++ b/ldap/servers/slapd/back-ldbm/ldbm_config.c @@ -120,7 +120,7 @@ static void *ldbm_config_lookthroughlimit_get(void *arg) return (void *) ((uintptr_t)(li->li_lookthroughlimit)); } -static int ldbm_config_lookthroughlimit_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int ldbm_config_lookthroughlimit_set(void *arg, void *value, char *errorbuf __attribute__((unused)), int phase __attribute__((unused)), int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; @@ -142,7 +142,7 @@ static void *ldbm_config_pagedlookthroughlimit_get(void *arg) return (void *) ((uintptr_t)(li->li_pagedlookthroughlimit)); } -static int ldbm_config_pagedlookthroughlimit_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int ldbm_config_pagedlookthroughlimit_set(void *arg, void *value, char *errorbuf __attribute__((unused)), int phase __attribute__((unused)), int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; @@ -164,7 +164,7 @@ static void *ldbm_config_rangelookthroughlimit_get(void *arg) return (void *) ((uintptr_t)(li->li_rangelookthroughlimit)); } -static int ldbm_config_rangelookthroughlimit_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int ldbm_config_rangelookthroughlimit_set(void *arg, void *value, char *errorbuf __attribute__((unused)), int phase __attribute__((unused)), int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; @@ -186,7 +186,7 @@ static void *ldbm_config_backend_opt_level_get(void *arg) return (void *) ((uintptr_t)(li->li_backend_opt_level)); } -static int ldbm_config_backend_opt_level_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int ldbm_config_backend_opt_level_set(void *arg, void *value, char *errorbuf __attribute__((unused)), int phase __attribute__((unused)), int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; @@ -207,7 +207,7 @@ static void *ldbm_config_mode_get(void *arg) return (void *) ((uintptr_t)(li->li_mode)); } -static int ldbm_config_mode_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int ldbm_config_mode_set(void *arg, void *value, char *errorbuf __attribute__((unused)), int phase __attribute__((unused)), int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; @@ -229,7 +229,7 @@ static void *ldbm_config_allidsthreshold_get(void *arg) return (void *) ((uintptr_t)(li->li_allidsthreshold)); } -static int ldbm_config_allidsthreshold_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int ldbm_config_allidsthreshold_set(void *arg, void *value, char *errorbuf __attribute__((unused)), int phase __attribute__((unused)), int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; @@ -256,7 +256,7 @@ static void *ldbm_config_pagedallidsthreshold_get(void *arg) return (void *) ((uintptr_t)(li->li_pagedallidsthreshold)); } -static int ldbm_config_pagedallidsthreshold_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int ldbm_config_pagedallidsthreshold_set(void *arg, void *value, char *errorbuf __attribute__((unused)), int phase __attribute__((unused)), int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; @@ -460,7 +460,7 @@ static void *ldbm_config_maxpassbeforemerge_get(void *arg) return (void *) ((uintptr_t)(li->li_maxpassbeforemerge)); } -static int ldbm_config_maxpassbeforemerge_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int ldbm_config_maxpassbeforemerge_set(void *arg, void *value, char *errorbuf __attribute__((unused)), int phase __attribute__((unused)), int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; @@ -487,7 +487,7 @@ static void *ldbm_config_dbncache_get(void *arg) return (void *) ((uintptr_t)(li->li_new_dbncache)); } -static int ldbm_config_dbncache_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int ldbm_config_dbncache_set(void *arg, void *value, char *errorbuf __attribute__((unused)), int phase, int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; @@ -536,7 +536,7 @@ void *ldbm_config_db_logdirectory_get_ext(void *arg) return (void *)li->li_new_directory; } -static int ldbm_config_db_logdirectory_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int ldbm_config_db_logdirectory_set(void *arg, void *value, char *errorbuf __attribute__((unused)), int phase __attribute__((unused)), int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; @@ -557,7 +557,7 @@ static void *ldbm_config_db_durable_transactions_get(void *arg) return (void *) ((uintptr_t)li->li_dblayer_private->dblayer_durable_transactions); } -static int ldbm_config_db_durable_transactions_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int ldbm_config_db_durable_transactions_set(void *arg, void *value, char *errorbuf __attribute__((unused)), int phase __attribute__((unused)), int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; @@ -580,8 +580,8 @@ static void *ldbm_config_db_lockdown_get(void *arg) static int ldbm_config_db_lockdown_set( void *arg, void *value, - char *errorbuf, - int phase, + char *errorbuf __attribute__((unused)), + int phase __attribute__((unused)), int apply ) { @@ -603,7 +603,11 @@ static void *ldbm_config_db_circular_logging_get(void *arg) return (void *) ((uintptr_t)li->li_dblayer_private->dblayer_circular_logging); } -static int ldbm_config_db_circular_logging_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int ldbm_config_db_circular_logging_set(void *arg, + void *value, + char *errorbuf __attribute__((unused)), + int phase __attribute__((unused)), + int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; @@ -623,7 +627,11 @@ static void *ldbm_config_db_transaction_logging_get(void *arg) return (void *) ((uintptr_t)li->li_dblayer_private->dblayer_enable_transactions); } -static int ldbm_config_db_transaction_logging_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int ldbm_config_db_transaction_logging_set(void *arg, + void *value, + char *errorbuf __attribute__((unused)), + int phase __attribute__((unused)), + int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; @@ -644,7 +652,11 @@ static void *ldbm_config_db_transaction_wait_get(void *arg) return (void *) ((uintptr_t)li->li_dblayer_private->dblayer_txn_wait); } -static int ldbm_config_db_transaction_wait_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int ldbm_config_db_transaction_wait_set(void *arg, + void *value, + char *errorbuf __attribute__((unused)), + int phase __attribute__((unused)), + int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; @@ -664,7 +676,11 @@ static void *ldbm_config_db_logbuf_size_get(void *arg) return (void *) li->li_dblayer_private->dblayer_logbuf_size; } -static int ldbm_config_db_logbuf_size_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int ldbm_config_db_logbuf_size_set(void *arg, + void *value, + char *errorbuf __attribute__((unused)), + int phase __attribute__((unused)), + int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; @@ -684,7 +700,11 @@ static void *ldbm_config_db_checkpoint_interval_get(void *arg) return (void *) ((uintptr_t)li->li_dblayer_private->dblayer_checkpoint_interval); } -static int ldbm_config_db_checkpoint_interval_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int ldbm_config_db_checkpoint_interval_set(void *arg, + void *value, + char *errorbuf __attribute__((unused)), + int phase __attribute__((unused)), + int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; @@ -704,7 +724,11 @@ static void *ldbm_config_db_compactdb_interval_get(void *arg) return (void *) ((uintptr_t)li->li_dblayer_private->dblayer_compactdb_interval); } -static int ldbm_config_db_compactdb_interval_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int ldbm_config_db_compactdb_interval_set(void *arg, + void *value, + char *errorbuf __attribute__((unused)), + int phase __attribute__((unused)), + int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; @@ -724,7 +748,11 @@ static void *ldbm_config_db_page_size_get(void *arg) return (void *) li->li_dblayer_private->dblayer_page_size; } -static int ldbm_config_db_page_size_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int ldbm_config_db_page_size_set(void *arg, + void *value, + char *errorbuf __attribute__((unused)), + int phase __attribute__((unused)), + int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; @@ -744,7 +772,11 @@ static void *ldbm_config_db_index_page_size_get(void *arg) return (void *) li->li_dblayer_private->dblayer_index_page_size; } -static int ldbm_config_db_index_page_size_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int ldbm_config_db_index_page_size_set(void *arg, + void *value, + char *errorbuf __attribute__((unused)), + int phase __attribute__((unused)), + int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; @@ -764,7 +796,11 @@ static void *ldbm_config_db_idl_divisor_get(void *arg) return (void *) ((uintptr_t)li->li_dblayer_private->dblayer_idl_divisor); } -static int ldbm_config_db_idl_divisor_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int ldbm_config_db_idl_divisor_set(void *arg, + void *value, + char *errorbuf __attribute__((unused)), + int phase __attribute__((unused)), + int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; @@ -784,7 +820,11 @@ static void *ldbm_config_db_old_idl_maxids_get(void *arg) return (void *) ((uintptr_t)li->li_old_idl_maxids); } -static int ldbm_config_db_old_idl_maxids_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int ldbm_config_db_old_idl_maxids_set(void *arg, + void *value, + char *errorbuf, + int phase __attribute__((unused)), + int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; @@ -811,7 +851,11 @@ static void *ldbm_config_db_logfile_size_get(void *arg) return (void *) li->li_dblayer_private->dblayer_logfile_size; } -static int ldbm_config_db_logfile_size_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int ldbm_config_db_logfile_size_set(void *arg, + void *value, + char *errorbuf __attribute__((unused)), + int phase __attribute__((unused)), + int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; @@ -831,7 +875,11 @@ static void *ldbm_config_db_spin_count_get(void *arg) return (void *) ((uintptr_t)li->li_dblayer_private->dblayer_spin_count); } -static int ldbm_config_db_spin_count_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int ldbm_config_db_spin_count_set(void *arg, + void *value, + char *errorbuf __attribute__((unused)), + int phase __attribute__((unused)), + int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; @@ -851,7 +899,11 @@ static void *ldbm_config_db_trickle_percentage_get(void *arg) return (void *) ((uintptr_t)li->li_dblayer_private->dblayer_trickle_percentage); } -static int ldbm_config_db_trickle_percentage_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int ldbm_config_db_trickle_percentage_set(void *arg, + void *value, + char *errorbuf, + int phase __attribute__((unused)), + int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; @@ -880,7 +932,11 @@ static void *ldbm_config_db_verbose_get(void *arg) return (void *) ((uintptr_t)li->li_dblayer_private->dblayer_verbose); } -static int ldbm_config_db_verbose_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int ldbm_config_db_verbose_set(void *arg, + void *value, + char *errorbuf __attribute__((unused)), + int phase __attribute__((unused)), + int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; @@ -900,7 +956,11 @@ static void *ldbm_config_db_debug_get(void *arg) return (void *) ((uintptr_t)li->li_dblayer_private->dblayer_debug); } -static int ldbm_config_db_debug_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int ldbm_config_db_debug_set(void *arg, + void *value, + char *errorbuf __attribute__((unused)), + int phase __attribute__((unused)), + int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; @@ -920,7 +980,11 @@ static void *ldbm_config_db_named_regions_get(void *arg) return (void *) ((uintptr_t)li->li_dblayer_private->dblayer_named_regions); } -static int ldbm_config_db_named_regions_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int ldbm_config_db_named_regions_set(void *arg, + void *value, + char *errorbuf __attribute__((unused)), + int phase __attribute__((unused)), + int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; @@ -940,7 +1004,11 @@ static void *ldbm_config_db_private_mem_get(void *arg) return (void *) ((uintptr_t)li->li_dblayer_private->dblayer_private_mem); } -static int ldbm_config_db_private_mem_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int ldbm_config_db_private_mem_set(void *arg, + void *value, + char *errorbuf __attribute__((unused)), + int phase __attribute__((unused)), + int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; @@ -960,7 +1028,11 @@ static void *ldbm_config_db_online_import_encrypt_get(void *arg) return (void *) ((uintptr_t)li->li_online_import_encrypt); } -static int ldbm_config_db_online_import_encrypt_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int ldbm_config_db_online_import_encrypt_set(void *arg, + void *value, + char *errorbuf __attribute__((unused)), + int phase __attribute__((unused)), + int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; @@ -987,7 +1059,11 @@ static void *ldbm_config_idl_get_update(void *arg) return (void *) ((uintptr_t)li->li_idl_update); } -static int ldbm_config_idl_set_update(void *arg, void *value, char *errorbuf, int phase, int apply) +static int ldbm_config_idl_set_update(void *arg, + void *value, + char *errorbuf __attribute__((unused)), + int phase __attribute__((unused)), + int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; @@ -1000,7 +1076,11 @@ static int ldbm_config_idl_set_update(void *arg, void *value, char *errorbuf, in return retval; } -static int ldbm_config_db_private_import_mem_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int ldbm_config_db_private_import_mem_set(void *arg, + void *value, + char *errorbuf __attribute__((unused)), + int phase __attribute__((unused)), + int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; @@ -1021,12 +1101,12 @@ static void *ldbm_config_db_shm_key_get(void *arg) } static int ldbm_config_db_shm_key_set( - void *arg, - void *value, - char *errorbuf, - int phase, + void *arg, + void *value, + char *errorbuf __attribute__((unused)), + int phase __attribute__((unused)), int apply -) +) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; @@ -1081,7 +1161,11 @@ static void *ldbm_config_db_cache_get(void *arg) return (void *) ((uintptr_t)li->li_dblayer_private->dblayer_cache_config); } -static int ldbm_config_db_cache_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int ldbm_config_db_cache_set(void *arg, + void *value, + char *errorbuf, + int phase __attribute__((unused)), + int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; @@ -1120,7 +1204,11 @@ static void *ldbm_config_db_debug_checkpointing_get(void *arg) return (void *) ((uintptr_t)li->li_dblayer_private->db_debug_checkpointing); } -static int ldbm_config_db_debug_checkpointing_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int ldbm_config_db_debug_checkpointing_set(void *arg, + void *value, + char *errorbuf __attribute__((unused)), + int phase __attribute__((unused)), + int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; @@ -1142,7 +1230,11 @@ static void *ldbm_config_db_home_directory_get(void *arg) return (void *) slapi_ch_strdup(li->li_dblayer_private->dblayer_dbhome_directory); } -static int ldbm_config_db_home_directory_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int ldbm_config_db_home_directory_set(void *arg, + void *value, + char *errorbuf __attribute__((unused)), + int phase __attribute__((unused)), + int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; @@ -1163,8 +1255,11 @@ static void *ldbm_config_import_cache_autosize_get(void *arg) return (void *)((uintptr_t)(li->li_import_cache_autosize)); } -static int ldbm_config_import_cache_autosize_set(void *arg, void *value, char *errorbuf, - int phase, int apply) +static int ldbm_config_import_cache_autosize_set(void *arg, + void *value, + char *errorbuf __attribute__((unused)), + int phase __attribute__((unused)), + int apply) { struct ldbminfo *li = (struct ldbminfo *)arg; @@ -1180,8 +1275,11 @@ static void *ldbm_config_cache_autosize_get(void *arg) return (void *)((uintptr_t)(li->li_cache_autosize)); } -static int ldbm_config_cache_autosize_set(void *arg, void *value, char *errorbuf, - int phase, int apply) +static int ldbm_config_cache_autosize_set(void *arg, + void *value, + char *errorbuf __attribute__((unused)), + int phase __attribute__((unused)), + int apply) { struct ldbminfo *li = (struct ldbminfo *)arg; @@ -1197,8 +1295,11 @@ static void *ldbm_config_cache_autosize_split_get(void *arg) return (void *)((uintptr_t)(li->li_cache_autosize_split)); } -static int ldbm_config_cache_autosize_split_set(void *arg, void *value, char *errorbuf, - int phase, int apply) +static int ldbm_config_cache_autosize_split_set(void *arg, + void *value, + char *errorbuf __attribute__((unused)), + int phase __attribute__((unused)), + int apply) { struct ldbminfo *li = (struct ldbminfo *)arg; @@ -1214,8 +1315,11 @@ static void *ldbm_config_import_cachesize_get(void *arg) return (void *)(li->li_import_cachesize); } -static int ldbm_config_import_cachesize_set(void *arg, void *value, char *errorbuf, - int phase, int apply) +static int ldbm_config_import_cachesize_set(void *arg, + void *value, + char *errorbuf, + int phase __attribute__((unused)), + int apply) { struct ldbminfo *li = (struct ldbminfo *)arg; size_t val = (size_t)value; @@ -1244,34 +1348,42 @@ static int ldbm_config_import_cachesize_set(void *arg, void *value, char *errorb return LDAP_SUCCESS; } -static void *ldbm_config_index_buffer_size_get(void *arg) +static void *ldbm_config_index_buffer_size_get(void *arg __attribute__((unused))) { return (void *)import_get_index_buffer_size(); } -static int ldbm_config_index_buffer_size_set(void *arg, void *value, char *errorbuf, - int phase, int apply) +static int ldbm_config_index_buffer_size_set(void *arg __attribute__((unused)), + void *value, + char *errorbuf __attribute__((unused)), + int phase __attribute__((unused)), + int apply) { - if (apply) + if (apply) { import_configure_index_buffer_size((size_t)value); + } return LDAP_SUCCESS; } -static void *ldbm_config_idl_get_idl_new(void *arg) +static void *ldbm_config_idl_get_idl_new(void *arg __attribute__((unused))) { - if (idl_get_idl_new()) + if (idl_get_idl_new()) { return slapi_ch_strdup("new"); - else - return slapi_ch_strdup("old"); + } + return slapi_ch_strdup("old"); } -static int ldbm_config_idl_set_tune(void *arg, void *value, char *errorbuf, - int phase, int apply) +static int ldbm_config_idl_set_tune(void *arg __attribute__((unused)), + void *value, + char *errorbuf __attribute__((unused)), + int phase __attribute__((unused)), + int apply __attribute__((unused))) { - if (!strcasecmp("new", value)) + if (!strcasecmp("new", value)) { idl_set_tune(4096); - else + } else { idl_set_tune(0); + } return LDAP_SUCCESS; } @@ -1282,8 +1394,11 @@ static void *ldbm_config_serial_lock_get(void *arg) return (void *) ((uintptr_t)li->li_fat_lock); } -static int ldbm_config_serial_lock_set(void *arg, void *value, char *errorbuf, - int phase, int apply) +static int ldbm_config_serial_lock_set(void *arg, + void *value, + char *errorbuf __attribute__((unused)), + int phase __attribute__((unused)), + int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; @@ -1294,13 +1409,16 @@ static int ldbm_config_serial_lock_set(void *arg, void *value, char *errorbuf, return LDAP_SUCCESS; } -static void *ldbm_config_entryrdn_switch_get(void *arg) +static void *ldbm_config_entryrdn_switch_get(void *arg __attribute__((unused))) { return (void *)((uintptr_t)entryrdn_get_switch()); } -static int ldbm_config_entryrdn_switch_set(void *arg, void *value, - char *errorbuf, int phase, int apply) +static int ldbm_config_entryrdn_switch_set(void *arg __attribute__((unused)), + void *value, + char *errorbuf __attribute__((unused)), + int phase __attribute__((unused)), + int apply) { if (apply) { entryrdn_set_switch((int)((uintptr_t)value)); @@ -1308,13 +1426,16 @@ static int ldbm_config_entryrdn_switch_set(void *arg, void *value, return LDAP_SUCCESS; } -static void *ldbm_config_entryrdn_noancestorid_get(void *arg) +static void *ldbm_config_entryrdn_noancestorid_get(void *arg __attribute__((unused))) { return (void *)((uintptr_t)entryrdn_get_noancestorid()); } -static int ldbm_config_entryrdn_noancestorid_set(void *arg, void *value, - char *errorbuf, int phase, int apply) +static int ldbm_config_entryrdn_noancestorid_set(void *arg __attribute__((unused)), + void *value, + char *errorbuf __attribute__((unused)), + int phase __attribute__((unused)), + int apply) { if (apply) { entryrdn_set_noancestorid((int)((uintptr_t)value)); @@ -1329,8 +1450,11 @@ static void *ldbm_config_legacy_errcode_get(void *arg) return (void *) ((uintptr_t)li->li_legacy_errcode); } -static int ldbm_config_legacy_errcode_set(void *arg, void *value, char *errorbuf, - int phase, int apply) +static int ldbm_config_legacy_errcode_set(void *arg, + void *value, + char *errorbuf __attribute__((unused)), + int phase __attribute__((unused)), + int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; @@ -1342,8 +1466,11 @@ static int ldbm_config_legacy_errcode_set(void *arg, void *value, char *errorbuf } static int -ldbm_config_set_bypass_filter_test(void *arg, void *value, char *errorbuf, - int phase, int apply) +ldbm_config_set_bypass_filter_test(void *arg, + void *value, + char *errorbuf __attribute__((unused)), + int phase __attribute__((unused)), + int apply) { struct ldbminfo *li = (struct ldbminfo *)arg; @@ -1382,7 +1509,11 @@ static void *ldbm_config_get_bypass_filter_test(void *arg) return (void *)retstr; } -static int ldbm_config_set_use_vlv_index(void *arg, void *value, char *errorbuf, int phase, int apply) +static int ldbm_config_set_use_vlv_index(void *arg, + void *value, + char *errorbuf __attribute__((unused)), + int phase __attribute__((unused)), + int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int val = (int) ((uintptr_t)value); @@ -1405,8 +1536,11 @@ static void *ldbm_config_get_use_vlv_index(void *arg) } static int -ldbm_config_exclude_from_export_set( void *arg, void *value, char *errorbuf, - int phase, int apply) +ldbm_config_exclude_from_export_set(void *arg, + void *value, + char *errorbuf __attribute__((unused)), + int phase __attribute__((unused)), + int apply) { struct ldbminfo *li = (struct ldbminfo *)arg; @@ -1464,10 +1598,10 @@ static void *ldbm_config_db_tx_max_get(void *arg) } static int ldbm_config_db_tx_max_set( - void *arg, - void *value, - char *errorbuf, - int phase, + void *arg, + void *value, + char *errorbuf __attribute__((unused)), + int phase __attribute__((unused)), int apply ) { @@ -1489,7 +1623,11 @@ static void *ldbm_config_db_deadlock_policy_get(void *arg) return (void *) ((uintptr_t)li->li_dblayer_private->dblayer_deadlock_policy); } -static int ldbm_config_db_deadlock_policy_set(void *arg, void *value, char *errorbuf, int phase, int apply) +static int ldbm_config_db_deadlock_policy_set(void *arg, + void *value, + char *errorbuf, + int phase __attribute__((unused)), + int apply) { struct ldbminfo *li = (struct ldbminfo *) arg; int retval = LDAP_SUCCESS; @@ -1850,7 +1988,12 @@ void ldbm_config_get(void *arg, config_info *config, char *buf) * SLAPI_DSE_CALLBACK_ERROR on failure * SLAPI_DSE_CALLBACK_OK on success */ -int ldbm_config_search_entry_callback(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *entryAfter, int *returncode, char *returntext, void *arg) +int ldbm_config_search_entry_callback(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry *e, + Slapi_Entry *entryAfter __attribute__((unused)), + int *returncode, + char *returntext, + void *arg) { char buf[BUFSIZ]; struct berval *vals[2]; diff --git a/ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c b/ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c index e6e0af3..15bb0a0 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c +++ b/ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c @@ -160,7 +160,7 @@ entryrdn_get_noancestorid() * returned. */ int -entryrdn_compare_dups(DB *db, const DBT *a, const DBT *b) +entryrdn_compare_dups(DB *db __attribute__((unused)), const DBT *a, const DBT *b) { rdn_elem *elem_a = NULL; rdn_elem *elem_b = NULL; @@ -3417,7 +3417,7 @@ bail: static int _entryrdn_append_childidl(DBC *cursor, - const char *nrdn, + const char *nrdn __attribute__((unused)), ID id, IDList **affectedidl, DB_TXN *db_txn) diff --git a/ldap/servers/slapd/back-ldbm/ldbm_index_config.c b/ldap/servers/slapd/back-ldbm/ldbm_index_config.c index de77e33..21e235b 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_index_config.c +++ b/ldap/servers/slapd/back-ldbm/ldbm_index_config.c @@ -81,7 +81,12 @@ static int ldbm_index_parse_entry(ldbm_instance *inst, Slapi_Entry *e, * instance is starting up. */ int -ldbm_index_init_entry_callback(Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAfter, int *returncode, char *returntext, void *arg) +ldbm_index_init_entry_callback(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* e, + Slapi_Entry* entryAfter __attribute__((unused)), + int *returncode, + char *returntext, + void *arg) { ldbm_instance *inst = (ldbm_instance *) arg; @@ -100,7 +105,12 @@ ldbm_index_init_entry_callback(Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* en * Config DSE callback for index additions. */ int -ldbm_instance_index_config_add_callback(Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* eAfter, int *returncode, char *returntext, void *arg) +ldbm_instance_index_config_add_callback(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* e, + Slapi_Entry* eAfter __attribute__((unused)), + int *returncode, + char *returntext, + void *arg) { ldbm_instance *inst = (ldbm_instance *) arg; char *index_name; @@ -130,7 +140,12 @@ ldbm_instance_index_config_add_callback(Slapi_PBlock *pb, Slapi_Entry* e, Slapi_ * Config DSE callback for index deletes. */ int -ldbm_instance_index_config_delete_callback(Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAfter, int *returncode, char *returntext, void *arg) +ldbm_instance_index_config_delete_callback(Slapi_PBlock *pb, + Slapi_Entry* e, + Slapi_Entry* entryAfter __attribute__((unused)), + int *returncode, + char *returntext, + void *arg) { ldbm_instance *inst = (ldbm_instance *) arg; Slapi_Attr *attr; @@ -185,8 +200,12 @@ bail: * this function is huge! */ int -ldbm_instance_index_config_modify_callback(Slapi_PBlock *pb, Slapi_Entry *e, - Slapi_Entry *entryAfter, int *returncode, char *returntext, void *arg) +ldbm_instance_index_config_modify_callback(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry *e, + Slapi_Entry *entryAfter, + int *returncode, + char *returntext, + void *arg) { ldbm_instance *inst = (ldbm_instance *)arg; Slapi_Attr *attr; diff --git a/ldap/servers/slapd/back-ldbm/ldbm_instance_config.c b/ldap/servers/slapd/back-ldbm/ldbm_instance_config.c index e03954d..42ff3e7 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_instance_config.c +++ b/ldap/servers/slapd/back-ldbm/ldbm_instance_config.c @@ -63,7 +63,11 @@ ldbm_instance_config_cachesize_get(void *arg) } static int -ldbm_instance_config_cachesize_set(void *arg, void *value, char *errorbuf, int phase, int apply) +ldbm_instance_config_cachesize_set(void *arg, + void *value, + char *errorbuf __attribute__((unused)), + int phase __attribute__((unused)), + int apply) { ldbm_instance *inst = (ldbm_instance *) arg; int retval = LDAP_SUCCESS; @@ -87,7 +91,11 @@ ldbm_instance_config_cachememsize_get(void *arg) } static int -ldbm_instance_config_cachememsize_set(void *arg, void *value, char *errorbuf, int phase, int apply) +ldbm_instance_config_cachememsize_set(void *arg, + void *value, + char *errorbuf, + int phase __attribute__((unused)), + int apply) { ldbm_instance *inst = (ldbm_instance *) arg; int retval = LDAP_SUCCESS; @@ -129,7 +137,11 @@ ldbm_instance_config_dncachememsize_get(void *arg) } static int -ldbm_instance_config_dncachememsize_set(void *arg, void *value, char *errorbuf, int phase, int apply) +ldbm_instance_config_dncachememsize_set(void *arg, + void *value, + char *errorbuf, + int phase __attribute__((unused)), + int apply) { ldbm_instance *inst = (ldbm_instance *) arg; int retval = LDAP_SUCCESS; @@ -202,7 +214,11 @@ ldbm_instance_config_require_index_get(void *arg) } static int -ldbm_instance_config_instance_dir_set(void *arg, void *value, char *errorbuf, int phase, int apply) +ldbm_instance_config_instance_dir_set(void *arg, + void *value, + char *errorbuf __attribute__((unused)), + int phase __attribute__((unused)), + int apply) { ldbm_instance *inst = (ldbm_instance *)arg; @@ -249,7 +265,11 @@ ldbm_instance_config_instance_dir_set(void *arg, void *value, char *errorbuf, in } static int -ldbm_instance_config_readonly_set(void *arg, void *value, char *errorbuf, int phase, int apply) +ldbm_instance_config_readonly_set(void *arg, + void *value, + char *errorbuf __attribute__((unused)), + int phase, + int apply) { ldbm_instance *inst = (ldbm_instance *)arg; uintptr_t pval = (uintptr_t)value; @@ -278,7 +298,11 @@ ldbm_instance_config_readonly_set(void *arg, void *value, char *errorbuf, int ph } static int -ldbm_instance_config_require_index_set(void *arg, void *value, char *errorbuf, int phase, int apply) +ldbm_instance_config_require_index_set(void *arg, + void *value, + char *errorbuf __attribute__((unused)), + int phase __attribute__((unused)), + int apply) { ldbm_instance *inst = (ldbm_instance *)arg; @@ -487,8 +511,12 @@ parse_ldbm_instance_config_entry(ldbm_instance *inst, Slapi_Entry *e, config_inf } /* general-purpose callback to deny an operation */ -static int ldbm_instance_deny_config(Slapi_PBlock *pb, Slapi_Entry *e, - Slapi_Entry *entryAfter, int *returncode, char *returntext, void *arg) +static int ldbm_instance_deny_config(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry *e __attribute__((unused)), + Slapi_Entry *entryAfter __attribute__((unused)), + int *returncode, + char *returntext __attribute__((unused)), + void *arg __attribute__((unused))) { *returncode = LDAP_UNWILLING_TO_PERFORM; return SLAPI_DSE_CALLBACK_ERROR; @@ -668,7 +696,12 @@ bail: * Config. DSE callback for instance entry searches. */ int -ldbm_instance_search_config_entry_callback(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *entryAfter, int *returncode, char *returntext, void *arg) +ldbm_instance_search_config_entry_callback(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry *e, + Slapi_Entry *entryAfter __attribute__((unused)), + int *returncode, + char *returntext, + void *arg) { char buf[BUFSIZ]; struct berval *vals[2]; @@ -744,7 +777,12 @@ add_suffix(ldbm_instance *inst, struct berval **bvals, int apply_mod, char *retu * Config. DSE callback for instance entry modifies. */ int -ldbm_instance_modify_config_entry_callback(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* e, int *returncode, char *returntext, void *arg) +ldbm_instance_modify_config_entry_callback(Slapi_PBlock *pb, + Slapi_Entry* entryBefore __attribute__((unused)), + Slapi_Entry* e __attribute__((unused)), + int *returncode, + char *returntext, + void *arg) { int i; char *attr_name; @@ -891,7 +929,12 @@ bail: } int -ldbm_instance_postadd_instance_entry_callback(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* entryAfter, int *returncode, char *returntext, void *arg) +ldbm_instance_postadd_instance_entry_callback(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* entryBefore, + Slapi_Entry* entryAfter __attribute__((unused)), + int *returncode __attribute__((unused)), + char *returntext __attribute__((unused)), + void *arg) { backend *be = NULL; struct ldbm_instance *inst; @@ -937,7 +980,12 @@ ldbm_instance_postadd_instance_entry_callback(Slapi_PBlock *pb, Slapi_Entry* ent } int -ldbm_instance_add_instance_entry_callback(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* entryAfter, int *returncode, char *returntext, void *arg) +ldbm_instance_add_instance_entry_callback(Slapi_PBlock *pb, + Slapi_Entry* entryBefore, + Slapi_Entry* entryAfter __attribute__((unused)), + int *returncode, + char *returntext, + void *arg) { char *instance_name; struct ldbm_instance *inst= NULL; @@ -1082,7 +1130,12 @@ bail: int -ldbm_instance_post_delete_instance_entry_callback(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* entryAfter, int *returncode, char *returntext, void *arg) +ldbm_instance_post_delete_instance_entry_callback(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* entryBefore, + Slapi_Entry* entryAfter __attribute__((unused)), + int *returncode, + char *returntext, + void *arg) { char *instance_name; struct ldbminfo *li = (struct ldbminfo *)arg; @@ -1193,7 +1246,12 @@ ldbm_instance_post_delete_instance_entry_callback(Slapi_PBlock *pb, Slapi_Entry* } int -ldbm_instance_delete_instance_entry_callback(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* entryAfter, int *returncode, char *returntext, void *arg) +ldbm_instance_delete_instance_entry_callback(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* entryBefore, + Slapi_Entry* entryAfter __attribute__((unused)), + int *returncode, + char *returntext, + void *arg) { char *instance_name; struct ldbminfo *li = (struct ldbminfo *)arg; diff --git a/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c b/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c index a78d850..00998d5 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c +++ b/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c @@ -1799,7 +1799,7 @@ mods_remove_nsuniqueid(Slapi_Mods *smods) * mods contains the list of attribute change made. */ static int -modrdn_rename_entry_update_indexes(back_txn *ptxn, Slapi_PBlock *pb, struct ldbminfo *li, +modrdn_rename_entry_update_indexes(back_txn *ptxn, Slapi_PBlock *pb, struct ldbminfo *li __attribute__((unused)), struct backentry *e, struct backentry **ec, Slapi_Mods *smods1, Slapi_Mods *smods2, Slapi_Mods *smods3) { diff --git a/ldap/servers/slapd/back-ldbm/ldbm_search.c b/ldap/servers/slapd/back-ldbm/ldbm_search.c index a6c3b74..72aef98 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_search.c +++ b/ldap/servers/slapd/back-ldbm/ldbm_search.c @@ -137,7 +137,7 @@ berval_done(struct berval *val) */ static int ldbm_back_search_cleanup(Slapi_PBlock *pb, - struct ldbminfo *li, + struct ldbminfo *li __attribute__((unused)), sort_spec_thing *sort_control, int ldap_result, char* ldap_result_description, @@ -197,7 +197,7 @@ ldbm_back_search_cleanup(Slapi_PBlock *pb, } static int -ldbm_search_compile_filter(Slapi_Filter *f, void *arg) +ldbm_search_compile_filter(Slapi_Filter *f, void *arg __attribute__((unused))) { int rc = SLAPI_FILTER_SCAN_CONTINUE; if (f->f_choice == LDAP_FILTER_SUBSTRINGS) { @@ -275,7 +275,7 @@ ldbm_search_compile_filter(Slapi_Filter *f, void *arg) } static int -ldbm_search_free_compiled_filter(Slapi_Filter *f, void *arg) +ldbm_search_free_compiled_filter(Slapi_Filter *f, void *arg __attribute__((unused))) { int rc = SLAPI_FILTER_SCAN_CONTINUE; if ((f->f_choice == LDAP_FILTER_SUBSTRINGS) && @@ -1054,7 +1054,7 @@ bail: * Build a candidate list for a BASE scope search. */ static IDList * -base_candidates(Slapi_PBlock *pb, struct backentry *e) +base_candidates(Slapi_PBlock *pb __attribute__((unused)), struct backentry *e) { IDList *idl= idl_alloc( 1 ); idl_append( idl, NULL == e ? 0 : e->ep_id ); @@ -1360,7 +1360,7 @@ static int grok_filter(struct slapi_filter *f) /* Routine which says whether or not the indices produced a "correct" answer */ static int can_skip_filter_test( - Slapi_PBlock *pb, + Slapi_PBlock *pb __attribute__((unused)), struct slapi_filter *f, int scope, IDList *idl diff --git a/ldap/servers/slapd/back-ldbm/ldbm_unbind.c b/ldap/servers/slapd/back-ldbm/ldbm_unbind.c index d35bc5e..4ad740f 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_unbind.c +++ b/ldap/servers/slapd/back-ldbm/ldbm_unbind.c @@ -16,7 +16,7 @@ #include "back-ldbm.h" int -ldbm_back_unbind( Slapi_PBlock *pb ) +ldbm_back_unbind( Slapi_PBlock *pb __attribute__((unused))) { return( 0 ); } diff --git a/ldap/servers/slapd/back-ldbm/ldif2ldbm.c b/ldap/servers/slapd/back-ldbm/ldif2ldbm.c index f8fed7c..b2e0305 100644 --- a/ldap/servers/slapd/back-ldbm/ldif2ldbm.c +++ b/ldap/servers/slapd/back-ldbm/ldif2ldbm.c @@ -179,7 +179,7 @@ int ldbm_back_ok_to_dump(const char *dn, char **include, char **exclude) * Currenty the list of these is: numSubordinates, hasSubordinates */ int -add_op_attrs(Slapi_PBlock *pb, struct ldbminfo *li, struct backentry *ep, +add_op_attrs(Slapi_PBlock *pb, struct ldbminfo *li __attribute__((unused)), struct backentry *ep, int *status) { backend *be; @@ -357,7 +357,7 @@ static int import_update_entry_subcount(backend *be, ID parentid, ldbm_instance *inst = (ldbm_instance *) be->be_instance_info; int ret = 0; modify_context mc = {0}; - char value_buffer[20]; /* enough digits for 2^64 children */ + char value_buffer[22] = {0}; /* enough digits for 2^64 children */ struct backentry *e = NULL; int isreplace = 0; char *numsub_str = numsubordinates; @@ -3154,7 +3154,7 @@ int upgradedb_copy_logfiles(struct ldbminfo *li, char *destination_dir, return rval; } -int upgradedb_delete_indices_4cmd(ldbm_instance *inst, int flags) +int upgradedb_delete_indices_4cmd(ldbm_instance *inst, int flags __attribute__((unused))) { PRDir *dirhandle = NULL; PRDirEntry *direntry = NULL; diff --git a/ldap/servers/slapd/back-ldbm/monitor.c b/ldap/servers/slapd/back-ldbm/monitor.c index 757792b..a11596b 100644 --- a/ldap/servers/slapd/back-ldbm/monitor.c +++ b/ldap/servers/slapd/back-ldbm/monitor.c @@ -32,8 +32,12 @@ /* DSE callback to monitor stats for a particular instance */ -int ldbm_back_monitor_instance_search(Slapi_PBlock *pb, Slapi_Entry *e, - Slapi_Entry *entryAfter, int *returncode, char *returntext, void *arg) +int ldbm_back_monitor_instance_search(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry *e, + Slapi_Entry *entryAfter __attribute__((unused)), + int *returncode, + char *returntext __attribute__((unused)), + void *arg) { ldbm_instance *inst = (ldbm_instance *)arg; struct ldbminfo *li = NULL; @@ -269,8 +273,9 @@ int ldbm_back_monitor_search(Slapi_PBlock *pb, Slapi_Entry *e, #if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR + DB_VERSION_PATCH <= 3204 /* In DB 3.2.4 and earlier, we need to free each element */ int i; - for (i = 0; mpfstat[i]; i++) + for (i = 0; mpfstat[i]; i++) { slapi_ch_free((void **)&mpfstat[i]); + } #endif slapi_ch_free((void **)&mpfstat); } @@ -282,8 +287,12 @@ int ldbm_back_monitor_search(Slapi_PBlock *pb, Slapi_Entry *e, /* monitor global ldbm database stats */ int -ldbm_back_dbmonitor_search(Slapi_PBlock *pb, Slapi_Entry *e, - Slapi_Entry *entryAfter, int *returncode, char *returntext, void *arg) +ldbm_back_dbmonitor_search(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry *e, + Slapi_Entry *entryAfter __attribute__((unused)), + int *returncode, + char *returntext __attribute__((unused)), + void *arg) { dblayer_private *dbpriv = NULL; struct ldbminfo *li = NULL; diff --git a/ldap/servers/slapd/back-ldbm/parents.c b/ldap/servers/slapd/back-ldbm/parents.c index f667a9f..6eb255c 100644 --- a/ldap/servers/slapd/back-ldbm/parents.c +++ b/ldap/servers/slapd/back-ldbm/parents.c @@ -52,7 +52,7 @@ parent_update_on_childchange(modify_context *mc,int op, size_t *new_sub_count ) int already_present = 0; int repl_op = 0; Slapi_Mods *smods = NULL; - char value_buffer[20]; /* enough digits for 2^64 children */ + char value_buffer[22] = {0}; /* enough digits for 2^64 children */ if (new_sub_count) *new_sub_count = 0; diff --git a/ldap/servers/slapd/back-ldbm/perfctrs.c b/ldap/servers/slapd/back-ldbm/perfctrs.c index 5929dea..8ac0c9b 100644 --- a/ldap/servers/slapd/back-ldbm/perfctrs.c +++ b/ldap/servers/slapd/back-ldbm/perfctrs.c @@ -52,7 +52,7 @@ static void perfctr_add_to_entry( Slapi_Entry *e, char *type, uint64_t countervalue ); /* Init perf ctrs */ -void perfctrs_init(struct ldbminfo *li, perfctrs_private **ret_priv) +void perfctrs_init(struct ldbminfo *li __attribute__((unused)), perfctrs_private **ret_priv) { perfctrs_private *priv = NULL; @@ -92,7 +92,7 @@ void perfctrs_terminate(perfctrs_private **priv, DB_ENV *db_env) } /* Wait while checking for perfctr update requests */ -void perfctrs_wait(size_t milliseconds,perfctrs_private *priv,DB_ENV *db_env) +void perfctrs_wait(size_t milliseconds, perfctrs_private *priv __attribute__((unused)), DB_ENV *db_env __attribute__((unused))) { /* Just sleep */ PRIntervalTime interval; /*NSPR timeout stuffy*/ diff --git a/ldap/servers/slapd/back-ldbm/vlv.c b/ldap/servers/slapd/back-ldbm/vlv.c index 235ed44..00ec40f 100644 --- a/ldap/servers/slapd/back-ldbm/vlv.c +++ b/ldap/servers/slapd/back-ldbm/vlv.c @@ -41,7 +41,12 @@ static struct vlvSearch *vlvSearchList= NULL; /* Callback to add a new VLV Search specification. Added write lock.*/ -int vlv_AddSearchEntry(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* entryAfter, int *returncode, char *returntext, void *arg) +int vlv_AddSearchEntry(Slapi_PBlock *pb, + Slapi_Entry* entryBefore, + Slapi_Entry* entryAfter __attribute__((unused)), + int *returncode __attribute__((unused)), + char *returntext __attribute__((unused)), + void *arg) { ldbm_instance *inst = (ldbm_instance *)arg; struct vlvSearch* newVlvSearch= vlvSearch_new(); @@ -64,7 +69,12 @@ int vlv_AddSearchEntry(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* /* Callback to add a new VLV Index specification. Added write lock.*/ -int vlv_AddIndexEntry(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* entryAfter, int *returncode, char *returntext, void *arg) +int vlv_AddIndexEntry(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* entryBefore, + Slapi_Entry* entryAfter __attribute__((unused)), + int *returncode __attribute__((unused)), + char *returntext __attribute__((unused)), + void *arg) { struct vlvSearch *parent; backend *be= ((ldbm_instance*)arg)->inst_be; @@ -99,7 +109,12 @@ int vlv_AddIndexEntry(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* e /* Callback to delete a VLV Index specification. Added write lock.*/ -int vlv_DeleteSearchEntry(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* entryAfter, int *returncode, char *returntext, void *arg) +int vlv_DeleteSearchEntry(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* entryBefore, + Slapi_Entry* entryAfter __attribute__((unused)), + int *returncode __attribute__((unused)), + char *returntext __attribute__((unused)), + void *arg) { struct vlvSearch* p=NULL; ldbm_instance *inst = (ldbm_instance*)arg; @@ -130,7 +145,12 @@ int vlv_DeleteSearchEntry(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entr /* Stub Callback to delete a VLV Index specification.*/ -int vlv_DeleteIndexEntry(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* entryAfter, int *returncode, char *returntext, void *arg) +int vlv_DeleteIndexEntry(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* entryBefore __attribute__((unused)), + Slapi_Entry* entryAfter __attribute__((unused)), + int *returncode __attribute__((unused)), + char *returntext __attribute__((unused)), + void *arg) { ldbm_instance *inst = (ldbm_instance*)arg; if (inst && is_instance_busy(inst)) { @@ -149,7 +169,12 @@ int vlv_DeleteIndexEntry(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry /* Callback to modify a VLV Search specification. Added read lock.*/ -int vlv_ModifySearchEntry(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* entryAfter, int *returncode, char *returntext, void *arg) +int vlv_ModifySearchEntry(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* entryBefore, + Slapi_Entry* entryAfter __attribute__((unused)), + int *returncode __attribute__((unused)), + char *returntext __attribute__((unused)), + void *arg) { struct vlvSearch* p=NULL; backend *be= ((ldbm_instance*)arg)->inst_be; @@ -168,16 +193,26 @@ int vlv_ModifySearchEntry(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entr /* Stub callback to modify a VLV Index specification. */ -int vlv_ModifyIndexEntry(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* entryAfter, int *returncode, char *returntext, void *arg) +int vlv_ModifyIndexEntry(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* entryBefore __attribute__((unused)), + Slapi_Entry* entryAfter __attribute__((unused)), + int *returncode __attribute__((unused)), + char *returntext __attribute__((unused)), + void *arg __attribute__((unused))) { - slapi_log_err(SLAPI_LOG_INFO, "vlv_ModifyIndexEntry", "Modified Virtual List View Index.\n"); + slapi_log_err(SLAPI_LOG_INFO, "vlv_ModifyIndexEntry", "Modified Virtual List View Index.\n"); return SLAPI_DSE_CALLBACK_DO_NOT_APPLY; } /* Callback to rename a VLV Search specification. Added read lock.*/ -int vlv_ModifyRDNSearchEntry(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* entryAfter, int *returncode, char *returntext, void *arg) +int vlv_ModifyRDNSearchEntry(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* entryBefore, + Slapi_Entry* entryAfter __attribute__((unused)), + int *returncode __attribute__((unused)), + char *returntext __attribute__((unused)), + void *arg) { struct vlvSearch* p=NULL; backend *be= ((ldbm_instance*)arg)->inst_be; @@ -196,18 +231,28 @@ int vlv_ModifyRDNSearchEntry(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_E /* Stub callback to modify a VLV Index specification. */ -int vlv_ModifyRDNIndexEntry(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* entryAfter, int *returncode, char *returntext, void *arg) +int vlv_ModifyRDNIndexEntry(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* entryBefore __attribute__((unused)), + Slapi_Entry* entryAfter __attribute__((unused)), + int *returncode __attribute__((unused)), + char *returntext __attribute__((unused)), + void *arg __attribute__((unused))) { - slapi_log_err(SLAPI_LOG_INFO, "vlv_ModifyRDNIndexEntry", "Modified Virtual List View Index.\n"); + slapi_log_err(SLAPI_LOG_INFO, "vlv_ModifyRDNIndexEntry", "Modified Virtual List View Index.\n"); return SLAPI_DSE_CALLBACK_DO_NOT_APPLY; } /* Something may have just read a VLV Entry. */ -int vlv_SearchIndexEntry(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* entryAfter, int *returncode, char *returntext, void *arg) +int vlv_SearchIndexEntry(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* entryBefore, + Slapi_Entry* entryAfter __attribute__((unused)), + int *returncode __attribute__((unused)), + char *returntext __attribute__((unused)), + void *arg) { char *name= slapi_entry_attr_get_charptr(entryBefore,type_vlvName); - backend *be= ((ldbm_instance*)arg)->inst_be; + backend *be= ((ldbm_instance*)arg)->inst_be; if (name!=NULL) { struct vlvIndex* p= vlv_find_searchname(name, be); /* lock list */ @@ -231,7 +276,12 @@ int vlv_SearchIndexEntry(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry /* Handle results of a search for objectclass "vlvIndex". Called by vlv_init at inittime -- no need to lock*/ static int -vlv_init_index_entry(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* entryAfter, int *returncode, char *returntext, void *arg) +vlv_init_index_entry(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* entryBefore, + Slapi_Entry* entryAfter __attribute__((unused)), + int *returncode __attribute__((unused)), + char *returntext __attribute__((unused)), + void *arg) { struct vlvIndex* newVlvIndex; struct vlvSearch* pSearch; @@ -262,7 +312,12 @@ vlv_init_index_entry(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* en /* Handle results of a search for objectclass "vlvSearch". Called by vlv_init at inittime -- no need to lock*/ static int -vlv_init_search_entry(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* entryAfter, int *returncode, char *returntext, void *arg) +vlv_init_search_entry(Slapi_PBlock *pb, + Slapi_Entry* entryBefore, + Slapi_Entry* entryAfter __attribute__((unused)), + int *returncode __attribute__((unused)), + char *returntext __attribute__((unused)), + void *arg) { struct vlvSearch* newVlvSearch= vlvSearch_new(); ldbm_instance *inst = (ldbm_instance*)arg; @@ -727,7 +782,7 @@ error: */ static int -do_vlv_update_index(back_txn *txn, struct ldbminfo *li, Slapi_PBlock *pb, struct vlvIndex* pIndex, struct backentry* entry, int insert) +do_vlv_update_index(back_txn *txn, struct ldbminfo *li __attribute__((unused)), Slapi_PBlock *pb, struct vlvIndex* pIndex, struct backentry* entry, int insert) { backend *be; int rc= 0; @@ -1053,8 +1108,7 @@ vlv_build_candidate_list_byvalue( struct vlvIndex* p, DBC *dbc, PRUint32 length, * and the ending index (as an inclusive list). * returns 0 on success, or an LDAP error code. */ -int vlv_build_idl(PRUint32 start, PRUint32 stop, DB *db, DBC *dbc, - IDList **candidates, int dosort) +int vlv_build_idl(PRUint32 start, PRUint32 stop, DB *db __attribute__((unused)), DBC *dbc, IDList **candidates, int dosort) { IDList *idl = NULL; int err; @@ -2068,7 +2122,7 @@ char *create_vlv_search_tag(const char* dn) { /* Builds strings from Slapi_DN similar console GUI. Uses those dns to delete vlvsearch's if they match. New write lock. */ -int vlv_delete_search_entry(Slapi_PBlock *pb, Slapi_Entry* e, ldbm_instance *inst) +int vlv_delete_search_entry(Slapi_PBlock *pb __attribute__((unused)), Slapi_Entry* e, ldbm_instance *inst) { int rc=0; Slapi_PBlock *tmppb; diff --git a/ldap/servers/slapd/configdse.c b/ldap/servers/slapd/configdse.c index 78162c9..220085d 100644 --- a/ldap/servers/slapd/configdse.c +++ b/ldap/servers/slapd/configdse.c @@ -121,7 +121,12 @@ reject_attr_type(const char *attr_type) } int -read_config_dse (Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAfter, int *returncode, char *returntext, void *arg) +read_config_dse (Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* e, + Slapi_Entry* entryAfter __attribute__((unused)), + int *returncode, + char *returntext __attribute__((unused)), + void *arg __attribute__((unused))) { struct berval *vals[2]; struct berval val; @@ -253,7 +258,12 @@ read_config_dse (Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAfter, int } int -load_config_dse(Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* ignored, int *returncode, char *returntext, void *arg) +load_config_dse(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* e, + Slapi_Entry* ignored __attribute__((unused)), + int *returncode, + char *returntext, + void *arg __attribute__((unused))) { int retval = LDAP_SUCCESS; Slapi_Attr *attr = 0; @@ -329,7 +339,12 @@ load_config_dse(Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* ignored, int *ret } int -load_plugin_entry(Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* ignored, int *returncode, char *returntext, void *arg) +load_plugin_entry(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* e, + Slapi_Entry* ignored __attribute__((unused)), + int *returncode, + char *returntext, + void *arg __attribute__((unused))) { int retval = LDAP_SUCCESS; @@ -368,7 +383,12 @@ load_plugin_entry(Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* ignored, int *r } int -modify_config_dse(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* e, int *returncode, char *returntext, void *arg) +modify_config_dse(Slapi_PBlock *pb, + Slapi_Entry* entryBefore __attribute__((unused)), + Slapi_Entry* e, + int *returncode, + char *returntext, + void *arg __attribute__((unused))) { char *config_attr; LDAPMod **mods; @@ -498,7 +518,12 @@ finish_and_return: } int -postop_modify_config_dse(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* e, int *returncode, char *returntext, void *arg) +postop_modify_config_dse(Slapi_PBlock *pb, + Slapi_Entry* entryBefore __attribute__((unused)), + Slapi_Entry* e __attribute__((unused)), + int *returncode, + char *returntext, + void *arg __attribute__((unused))) { static int num_requires_restart = sizeof(requires_restart)/sizeof(char*); LDAPMod **mods; @@ -537,7 +562,9 @@ postop_modify_config_dse(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry } static int -check_all_maxdiskspace_and_mlogsize(Slapi_PBlock *pb, LDAPMod **mods, char *returntext) +check_all_maxdiskspace_and_mlogsize(Slapi_PBlock *pb __attribute__((unused)), + LDAPMod **mods, + char *returntext) { int i = 0; int rc = LDAP_SUCCESS; diff --git a/ldap/servers/slapd/connection.c b/ldap/servers/slapd/connection.c index 7c83c66..578b3cd 100644 --- a/ldap/servers/slapd/connection.c +++ b/ldap/servers/slapd/connection.c @@ -251,7 +251,7 @@ connection_cleanup(Connection *conn) * Callers of connection_reset() must hold the conn->c_mutex lock. */ void -connection_reset(Connection* conn, int ns, PRNetAddr * from, int fromLen, int is_SSL) +connection_reset(Connection* conn, int ns, PRNetAddr * from, int fromLen __attribute__((unused)), int is_SSL) { char *pTmp = is_SSL ? "SSL " : ""; char *str_ip = NULL, *str_destip; @@ -1032,7 +1032,7 @@ _ber_get_len(BerElement *ber, ber_len_t *lenp) * case 2) *tagp == LBER_DEFAULT: memory error or tag mismatch */ static int -get_next_from_buffer( void *buffer, size_t buffer_size, ber_len_t *lenp, +get_next_from_buffer( void *buffer __attribute__((unused)), size_t buffer_size __attribute__((unused)), ber_len_t *lenp, ber_tag_t *tagp, BerElement *ber, Connection *conn ) { PRErrorCode err = 0; @@ -1462,31 +1462,20 @@ void connection_enter_leave_turbo(Connection *conn, int current_turbo_flag, int threshold_rank -= (connection_count - threshold_rank) / 5; } - if (current_mode) { - /* We're currently in turbo mode */ - /* Policy says that we stay in turbo mode provided - connection activity is still high. - */ - if (our_rank - CONN_TURBO_HYSTERESIS < threshold_rank) { - /* Stay in turbo mode */ + if (current_mode && (our_rank - CONN_TURBO_HYSTERESIS) < threshold_rank) { + /* We're currently in turbo mode */ + /* Policy says that we stay in turbo mode provided + connection activity is still high. + */ new_mode = 1; - } else { - /* Exit turbo mode */ - new_mode = 0; - } - } else { - /* We're currently not in turbo mode */ - /* Policy says that we go into turbo mode if - recent connection activity is high. - */ - if (our_rank + CONN_TURBO_HYSTERESIS < threshold_rank) { - /* Enter turbo mode */ + } else if (!current_mode && (our_rank + CONN_TURBO_HYSTERESIS) < threshold_rank) { + /* We're currently not in turbo mode */ + /* Policy says that we go into turbo mode if + recent connection activity is high. + */ new_mode = 1; - } else { - /* Stay out of turbo mode */ - new_mode = 0; } - } + } PR_ExitMonitor(conn->c_mutex); if (current_mode != new_mode) { diff --git a/ldap/servers/slapd/conntable.c b/ldap/servers/slapd/conntable.c index bcafa4e..7a1f572 100644 --- a/ldap/servers/slapd/conntable.c +++ b/ldap/servers/slapd/conntable.c @@ -178,7 +178,7 @@ connection_table_get_first_active_connection (Connection_Table *ct) } Connection* -connection_table_get_next_active_connection (Connection_Table *ct, Connection *c) +connection_table_get_next_active_connection (Connection_Table *ct __attribute__((unused)), Connection *c) { return c->c_next; } diff --git a/ldap/servers/slapd/control.c b/ldap/servers/slapd/control.c index 8f9e74e..df47f86 100644 --- a/ldap/servers/slapd/control.c +++ b/ldap/servers/slapd/control.c @@ -136,7 +136,7 @@ slapi_get_supported_controls( char ***ctrloidsp, unsigned long **ctrlopsp ) static -unsigned long *supported_controls_ops_dup(unsigned long *ctrlops) +unsigned long *supported_controls_ops_dup(unsigned long *ctrlops __attribute__((unused))) { int i; unsigned long *dup_ops = (unsigned long *)slapi_ch_calloc( diff --git a/ldap/servers/slapd/csn.c b/ldap/servers/slapd/csn.c index 5b420bf..5024dd3 100644 --- a/ldap/servers/slapd/csn.c +++ b/ldap/servers/slapd/csn.c @@ -123,8 +123,9 @@ CSN *csn_dup(const CSN *csn) return newcsn; } -void csn_done(CSN *csn) +void csn_done(CSN *csn __attribute__((unused))) { + return; } void csn_free(CSN **csn) @@ -193,7 +194,7 @@ time_t csn_get_time(const CSN *csn) * WARNING: memory, which must be free'd by the caller. */ char * -csn_as_string(const CSN *csn, PRBool replicaIdOrder, char *ss) +csn_as_string(const CSN *csn, PRBool replicaIdOrder __attribute__((unused)), char *ss) { char *s= ss; if(s==NULL) diff --git a/ldap/servers/slapd/daemon.c b/ldap/servers/slapd/daemon.c index a4ea4c0..da9a973 100644 --- a/ldap/servers/slapd/daemon.c +++ b/ldap/servers/slapd/daemon.c @@ -100,7 +100,7 @@ typedef struct listener_info { #endif } listener_info; -static int listeners = 0; /* number of listener sockets */ +static size_t listeners = 0; /* number of listener sockets */ static listener_info *listener_idxs = NULL; /* array of indexes of listener sockets in the ct->fd array */ static int enable_nunc_stans = 0; /* if nunc-stans is set to enabled, set to 1 in slapd_daemon */ @@ -137,8 +137,8 @@ get_pid_file(void) } static int -accept_and_configure(int s, PRFileDesc *pr_acceptfd, PRNetAddr *pr_netaddr, - int addrlen, int secure, int local, PRFileDesc **pr_clonefd) +accept_and_configure(int s __attribute__((unused)), PRFileDesc *pr_acceptfd, PRNetAddr *pr_netaddr, + int addrlen __attribute__((unused)), int secure, int local, PRFileDesc **pr_clonefd) { int ns = 0; PRIntervalTime pr_timeout = PR_MillisecondsToInterval(slapd_wakeup_timer); @@ -271,7 +271,7 @@ int daemon_pre_setuid_init(daemon_ports_t *ports) static int time_shutdown = 0; void * -time_thread(void *nothing) +time_thread(void *nothing __attribute__((unused))) { PRIntervalTime interval; @@ -417,7 +417,7 @@ disk_mon_add_dir(char ***list, char *directory) * We gather all the log, txn log, config, and db directories */ void -disk_mon_get_dirs(char ***list, int logs_critical){ +disk_mon_get_dirs(char ***list, int logs_critical __attribute__((unused))){ slapdFrontendConfig_t *config = getFrontendConfig(); Slapi_Backend *be = NULL; char *cookie = NULL; @@ -519,7 +519,7 @@ disk_mon_check_diskspace(char **dirs, PRUint64 threshold, PRUint64 *disk_space) * Future - it would be nice to be able to email an alert. */ void -disk_monitoring_thread(void *nothing) +disk_monitoring_thread(void *nothing __attribute__((unused))) { char **dirs = NULL; char *dirstr = NULL; @@ -750,7 +750,7 @@ disk_monitoring_thread(void *nothing) static void handle_listeners(Connection_Table *ct) { - int idx; + size_t idx; for (idx = 0; idx < listeners; ++idx) { int fdidx = listener_idxs[idx].idx; PRFileDesc *listenfd = listener_idxs[idx].listenfd; @@ -980,7 +980,7 @@ void slapd_daemon( daemon_ports_t *ports ) PRFileDesc **n_tcps = NULL; PRFileDesc **s_tcps = NULL; PRFileDesc **i_unix = NULL; - PRFileDesc **fdesp = NULL; + PRFileDesc **fdesp = NULL; PRIntn num_poll = 0; PRIntervalTime pr_timeout = PR_MillisecondsToInterval(slapd_wakeup_timer); PRThread *time_thread_p; @@ -1121,7 +1121,6 @@ void slapd_daemon( daemon_ports_t *ports ) /* We are now ready to accept incoming connections */ if ( n_tcps != NULL ) { - PRFileDesc **fdesp; PRNetAddr **nap = ports->n_listenaddr; for (fdesp = n_tcps; fdesp && *fdesp; fdesp++, nap++) { if ( PR_Listen( *fdesp, config_get_listen_backlog_size() ) == PR_FAILURE ) { @@ -1140,7 +1139,6 @@ void slapd_daemon( daemon_ports_t *ports ) } if ( s_tcps != NULL ) { - PRFileDesc **fdesp; PRNetAddr **sap = ports->s_listenaddr; for (fdesp = s_tcps; fdesp && *fdesp; fdesp++, sap++) { if ( PR_Listen( *fdesp, config_get_listen_backlog_size() ) == PR_FAILURE ) { @@ -1160,7 +1158,6 @@ void slapd_daemon( daemon_ports_t *ports ) #if defined(ENABLE_LDAPI) if( i_unix != NULL ) { - PRFileDesc **fdesp; PRNetAddr **iap = ports->i_listenaddr; for (fdesp = i_unix; fdesp && *fdesp; fdesp++, iap++) { if ( PR_Listen(*fdesp, config_get_listen_backlog_size()) == PR_FAILURE) { @@ -1472,7 +1469,7 @@ setup_pr_read_pds(Connection_Table *ct, PRFileDesc **n_tcps, PRFileDesc **s_tcps PRIntn count = 0; slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig(); int max_threads_per_conn = config_get_maxthreadsperconn(); - int n_listeners = 0; + size_t n_listeners = 0; accept_new_connections = ((ct->size - g_get_current_conn_count()) > slapdFrontendConfig->reservedescriptors); @@ -1719,7 +1716,7 @@ daemon_register_reslimits( void ) } static void -handle_pr_read_ready(Connection_Table *ct, PRIntn num_poll) +handle_pr_read_ready(Connection_Table *ct, PRIntn num_poll __attribute__((unused))) { Connection *c; time_t curtime = current_time(); @@ -2084,7 +2081,7 @@ slapd_poll( void *handle, int output ) */ #if defined(USE_OPENLDAP) static int -write_function( int ignore, void *buffer, int count, void *handle ) +write_function( int ignore __attribute__((unused)), void *buffer, int count, void *handle ) #else static int write_function( int ignore, const void *buffer, int count, struct lextiof_socket_private *handle ) @@ -2181,14 +2178,14 @@ openldap_write_function(Sockbuf_IO_Desc *sbiod, void *buf, ber_len_t len) } static int -openldap_io_ctrl(Sockbuf_IO_Desc *sbiod, int opt, void *arg) +openldap_io_ctrl(Sockbuf_IO_Desc *sbiod __attribute__((unused)), int opt __attribute__((unused)), void *arg __attribute__((unused))) { PR_ASSERT(0); /* not sure if this is needed */ return -1; } static int -openldap_io_close(Sockbuf_IO_Desc *sbiod) +openldap_io_close(Sockbuf_IO_Desc *sbiod __attribute__((unused))) { return 0; /* closing done in connection_cleanup() */ } @@ -2840,7 +2837,7 @@ write_pid_file(void) } static void -set_shutdown (int sig) +set_shutdown (int sig __attribute__((unused))) { /* don't log anything from a signal handler: * you could be holding a lock when the signal was trapped. more @@ -2861,7 +2858,7 @@ set_shutdown (int sig) #ifdef ENABLE_NUNC_STANS static void -ns_set_user(struct ns_job_t *job) +ns_set_user(struct ns_job_t *job __attribute__((unused))) { /* This literally does nothing. We intercept user signals (USR1, USR2) */ /* Could be good for a status output, or an easter egg. */ @@ -2921,7 +2918,7 @@ slapd_do_nothing (int sig) #endif /* LINUX */ void -slapd_wait4child(int sig) +slapd_wait4child(int sig __attribute__((unused))) { WAITSTATUSTYPE status; @@ -2945,7 +2942,7 @@ slapd_wait4child(int sig) static PRFileDesc ** createprlistensockets(PRUint16 port, PRNetAddr **listenaddr, - int secure, int local) + int secure __attribute__((unused)), int local) { PRFileDesc **sock; PRNetAddr sa_server; diff --git a/ldap/servers/slapd/defbackend.c b/ldap/servers/slapd/defbackend.c index 6fd74a3..15a005f 100644 --- a/ldap/servers/slapd/defbackend.c +++ b/ldap/servers/slapd/defbackend.c @@ -148,7 +148,7 @@ defbackend_default( Slapi_PBlock *pb ) static int -defbackend_noop( Slapi_PBlock *pb ) +defbackend_noop( Slapi_PBlock *pb __attribute__((unused))) { slapi_log_err(SLAPI_LOG_TRACE, "defbackend_noop", "<==\n"); @@ -157,7 +157,7 @@ defbackend_noop( Slapi_PBlock *pb ) static int -defbackend_abandon( Slapi_PBlock *pb ) +defbackend_abandon( Slapi_PBlock *pb __attribute__((unused))) { slapi_log_err(SLAPI_LOG_TRACE, "defbackend_abandon", "<==\n"); @@ -270,7 +270,7 @@ defbackend_bind( Slapi_PBlock *pb ) static int -defbackend_next_search_entry( Slapi_PBlock *pb ) +defbackend_next_search_entry( Slapi_PBlock *pb __attribute__((unused))) { slapi_log_err(SLAPI_LOG_TRACE, "defbackend_next_search_entry", "<==\n"); diff --git a/ldap/servers/slapd/delete.c b/ldap/servers/slapd/delete.c index a16718a..6a3439b 100644 --- a/ldap/servers/slapd/delete.c +++ b/ldap/servers/slapd/delete.c @@ -105,7 +105,7 @@ free_and_return:; because it does not allow to check whether plugin has right to access part of the tree it is trying to modify. Use slapi_delete_internal_pb instead */ Slapi_PBlock * -slapi_delete_internal(const char *idn, LDAPControl **controls, int dummy) +slapi_delete_internal(const char *idn, LDAPControl **controls, int dummy __attribute__((unused))) { Slapi_PBlock pb = {0}; Slapi_PBlock *result_pb; diff --git a/ldap/servers/slapd/dn.c b/ldap/servers/slapd/dn.c index fa3909f..1422269 100644 --- a/ldap/servers/slapd/dn.c +++ b/ldap/servers/slapd/dn.c @@ -450,7 +450,7 @@ substr_dn_normalize_orig( char *dn, char *end ) } char * -substr_dn_normalize( char *dn, char *end ) +substr_dn_normalize( char *dn __attribute__((unused)), char *end ) { /* no op */ return end; diff --git a/ldap/servers/slapd/dse.c b/ldap/servers/slapd/dse.c index 2837b16..78c3d4b 100644 --- a/ldap/servers/slapd/dse.c +++ b/ldap/servers/slapd/dse.c @@ -416,7 +416,7 @@ dse_new_with_filelist(char *filename, char *tmpfilename, char *backfilename, cha } static int -dse_internal_delete_entry( caddr_t data, caddr_t arg ) +dse_internal_delete_entry( caddr_t data, caddr_t arg __attribute__((unused))) { struct dse_node *n = (struct dse_node *)data; dse_node_delete(&n); @@ -587,7 +587,7 @@ dse_updateNumSubordinates(Slapi_Entry *entry, int op) current_sub_count--; } { - char value_buffer[20]; /* enough digits for 2^64 children */ + char value_buffer[22] = {0}; /* enough digits for 2^64 children */ struct berval *vals[2]; struct berval val; vals[0] = &val; @@ -1260,7 +1260,7 @@ entry_dn_cmp( caddr_t d1, caddr_t d2 ) static int -dupentry_disallow( caddr_t d1, caddr_t d2 ) +dupentry_disallow( caddr_t d1 __attribute__((unused)), caddr_t d2 __attribute__((unused))) { return -1; } @@ -1541,7 +1541,7 @@ dse_bind( Slapi_PBlock *pb ) /* JCM There should only be one exit point from thi } int -dse_unbind( Slapi_PBlock *pb ) +dse_unbind( Slapi_PBlock *pb __attribute__((unused))) { return 0; } diff --git a/ldap/servers/slapd/entry.c b/ldap/servers/slapd/entry.c index abacc57..d8847b0 100644 --- a/ldap/servers/slapd/entry.c +++ b/ldap/servers/slapd/entry.c @@ -3048,7 +3048,7 @@ slapi_entry_attr_set_int( Slapi_Entry* e, const char *type, int l) void slapi_entry_attr_set_uint( Slapi_Entry* e, const char *type, unsigned int l) { - char value[16]; + char value[16] = {0}; struct berval bv; struct berval *bvals[2]; bvals[0] = &bv; @@ -3062,7 +3062,7 @@ slapi_entry_attr_set_uint( Slapi_Entry* e, const char *type, unsigned int l) void slapi_entry_attr_set_long( Slapi_Entry* e, const char *type, long l) { - char value[16]; + char value[22] = {0}; struct berval bv; struct berval *bvals[2]; bvals[0] = &bv; @@ -3076,7 +3076,7 @@ slapi_entry_attr_set_long( Slapi_Entry* e, const char *type, long l) void slapi_entry_attr_set_longlong( Slapi_Entry* e, const char *type, long long l) { - char value[20]; + char value[22] = {0}; struct berval bv; struct berval *bvals[2]; bvals[0] = &bv; @@ -3090,7 +3090,7 @@ slapi_entry_attr_set_longlong( Slapi_Entry* e, const char *type, long long l) void slapi_entry_attr_set_ulong( Slapi_Entry* e, const char *type, uint64_t l) { - char value[16]; + char value[22] = {0}; struct berval bv; struct berval *bvals[2]; bvals[0] = &bv; diff --git a/ldap/servers/slapd/entrywsi.c b/ldap/servers/slapd/entrywsi.c index 94cf4ba..9ab5131 100644 --- a/ldap/servers/slapd/entrywsi.c +++ b/ldap/servers/slapd/entrywsi.c @@ -103,7 +103,7 @@ entry_first_deleted_attribute( const Slapi_Entry *e, Slapi_Attr **a) * Return -1: no deleted attributes. */ int -entry_next_deleted_attribute( const Slapi_Entry *e, Slapi_Attr **a) +entry_next_deleted_attribute( const Slapi_Entry *e __attribute__((unused)), Slapi_Attr **a) { *a= (*a)->a_next; return( *a ? 0 : -1 ); @@ -167,7 +167,7 @@ entry_add_dncsn(Slapi_Entry *entry, const CSN *csn) * a str2entry, the order is not preserved unless we sort it. */ int -entry_add_dncsn_ext(Slapi_Entry *entry, const CSN *csn, PRUint32 flags) +entry_add_dncsn_ext(Slapi_Entry *entry, const CSN *csn, PRUint32 flags __attribute__((unused))) { PR_ASSERT(entry!=NULL); csnset_update_csn(&entry->e_dncsnset, CSN_TYPE_VALUE_DISTINGUISHED, csn); @@ -396,7 +396,7 @@ static int entry_add_present_values_wsi_single_valued(Slapi_Entry *e, const char static int entry_add_present_values_wsi_multi_valued(Slapi_Entry *e, const char *type, struct berval **bervals, const CSN *csn, int urp, long flags); static int -entry_add_present_values_wsi(Slapi_Entry *e, const char *type, struct berval **bervals, const CSN *csn, int urp, long flags) +entry_add_present_values_wsi(Slapi_Entry *e, const char *type, struct berval **bervals, const CSN *csn, int urp, long flags __attribute__((unused))) { int retVal = LDAP_SUCCESS; Slapi_Attr *a= NULL; @@ -686,7 +686,7 @@ entry_delete_present_values_wsi(Slapi_Entry *e, const char *type, struct berval return retVal; } static int -entry_delete_present_values_wsi_single_valued(Slapi_Entry *e, const char *type, struct berval **vals, const CSN *csn, int urp, int mod_op, struct berval **replacevals) +entry_delete_present_values_wsi_single_valued(Slapi_Entry *e, const char *type, struct berval **vals, const CSN *csn, int urp, int mod_op __attribute__((unused)), struct berval **replacevals __attribute__((unused))) { int retVal= LDAP_SUCCESS; Slapi_Attr *a= NULL; @@ -785,7 +785,7 @@ entry_delete_present_values_wsi_single_valued(Slapi_Entry *e, const char *type, return( retVal ); } static int -entry_delete_present_values_wsi_multi_valued(Slapi_Entry *e, const char *type, struct berval **vals, const CSN *csn, int urp, int mod_op, struct berval **replacevals) +entry_delete_present_values_wsi_multi_valued(Slapi_Entry *e, const char *type, struct berval **vals, const CSN *csn, int urp, int mod_op __attribute__((unused)), struct berval **replacevals __attribute__((unused))) { int retVal= LDAP_SUCCESS; Slapi_Attr *a= NULL; @@ -1105,7 +1105,7 @@ entry_computed_attr_init() } static void -purge_attribute_state_multi_valued(const Slapi_Attr *a, Slapi_Value *v) +purge_attribute_state_multi_valued(const Slapi_Attr *a __attribute__((unused)), Slapi_Value *v) { const CSN *vdcsn= value_get_csn(v,CSN_TYPE_VALUE_DELETED); const CSN *vucsn= value_get_csn(v,CSN_TYPE_VALUE_UPDATED); diff --git a/ldap/servers/slapd/eventq.c b/ldap/servers/slapd/eventq.c index 4197d31..8c6fca5 100644 --- a/ldap/servers/slapd/eventq.c +++ b/ldap/servers/slapd/eventq.c @@ -305,7 +305,7 @@ eq_call_all(void) #define WORK_AVAILABLE ((NULL != eq->eq_queue) && (eq->eq_queue->ec_when <= current_time())) static void -eq_loop(void *arg) +eq_loop(void *arg __attribute__((unused))) { while (eq_running) { PRIntervalTime timeout; diff --git a/ldap/servers/slapd/extendop.c b/ldap/servers/slapd/extendop.c index 7e41b8c..e77f4d7 100644 --- a/ldap/servers/slapd/extendop.c +++ b/ldap/servers/slapd/extendop.c @@ -21,7 +21,7 @@ static const char *extended_op_oid2string( const char *oid ); /********** this stuff should probably be moved when it's done **********/ -static void extop_handle_import_start(Slapi_PBlock *pb, char *extoid, +static void extop_handle_import_start(Slapi_PBlock *pb, char *extoid __attribute__((unused)), struct berval *extval) { char *orig = NULL; @@ -150,8 +150,8 @@ out: return; } -static void extop_handle_import_done(Slapi_PBlock *pb, char *extoid, - struct berval *extval) +static void extop_handle_import_done(Slapi_PBlock *pb, char *extoid __attribute__((unused)), + struct berval *extval __attribute__((unused))) { Slapi_Backend *be; struct berval bv; diff --git a/ldap/servers/slapd/factory.c b/ldap/servers/slapd/factory.c index 6c6a7dd..c2429f0 100644 --- a/ldap/servers/slapd/factory.c +++ b/ldap/servers/slapd/factory.c @@ -385,7 +385,7 @@ factory_destroy_extension(int type,void *object,void *parent,void **extension) */ int slapi_unregister_object_extension( - const char* pluginname, + const char* pluginname __attribute__((unused)), const char* objectname, int *objecttype, int *extensionhandle) diff --git a/ldap/servers/slapd/fedse.c b/ldap/servers/slapd/fedse.c index 13a3c74..bd6bc28 100644 --- a/ldap/servers/slapd/fedse.c +++ b/ldap/servers/slapd/fedse.c @@ -1650,7 +1650,12 @@ void add_easter_egg_entry(void) } static int -dont_allow_that(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* e, int *returncode, char *returntext, void *arg) +dont_allow_that(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* entryBefore __attribute__((unused)), + Slapi_Entry* e __attribute__((unused)), + int *returncode, + char *returntext __attribute__((unused)), + void *arg __attribute__((unused))) { *returncode = LDAP_UNWILLING_TO_PERFORM; return SLAPI_DSE_CALLBACK_ERROR; @@ -1679,7 +1684,12 @@ setEntrySSLVersion(Slapi_Entry *entry, char *sslversion, char *newval) /*This function takes care of the search on the attribute nssslsupportedciphers in cn=encryption,cn=config" entry. This would get the list of supported ciphers from the table in ssl.c and always return that value */ int -search_encryption( Slapi_PBlock *pb, Slapi_Entry *entry, Slapi_Entry *entryAfter, int *returncode, char *returntext, void *arg) +search_encryption( Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry *entry, + Slapi_Entry *entryAfter __attribute__((unused)), + int *returncode __attribute__((unused)), + char *returntext __attribute__((unused)), + void *arg __attribute__((unused))) { struct berval *vals[2]; struct berval val; @@ -1732,7 +1742,12 @@ search_encryption( Slapi_PBlock *pb, Slapi_Entry *entry, Slapi_Entry *entryAfter * unless you specifically ask for them. */ int -search_easter_egg( Slapi_PBlock *pb, Slapi_Entry *entryBefore, Slapi_Entry *entryAfter, int *returncode, char *returntext, void *arg) +search_easter_egg( Slapi_PBlock *pb, + Slapi_Entry *entryBefore, + Slapi_Entry *entryAfter __attribute__((unused)), + int *returncode __attribute__((unused)), + char *returntext __attribute__((unused)), + void *arg __attribute__((unused))) { char *fstr= NULL; char eggfilter[64]; @@ -1767,14 +1782,24 @@ search_easter_egg( Slapi_PBlock *pb, Slapi_Entry *entryBefore, Slapi_Entry *entr } int -search_counters(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* e, int *returncode, char *returntext, void *arg) +search_counters(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* entryBefore, + Slapi_Entry* e __attribute__((unused)), + int *returncode __attribute__((unused)), + char *returntext __attribute__((unused)), + void *arg __attribute__((unused))) { counters_as_entry(entryBefore); return SLAPI_DSE_CALLBACK_OK; } int -search_snmp(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* e, int *returncode, char *returntext, void *arg) +search_snmp(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* entryBefore, + Slapi_Entry* e __attribute__((unused)), + int *returncode __attribute__((unused)), + char *returntext __attribute__((unused)), + void *arg __attribute__((unused))) { snmp_as_entry(entryBefore); return SLAPI_DSE_CALLBACK_OK; @@ -1929,12 +1954,12 @@ int fedse_create_startOK(char *filename, char *startokfilename, const char *con } static int -check_plugin_path(Slapi_PBlock *pb, +check_plugin_path(Slapi_PBlock *pb __attribute__((unused)), Slapi_Entry* entryBefore, Slapi_Entry* e, int *returncode, char *returntext, - void *arg) + void *arg __attribute__((unused))) { /* check for invalid nsslapd-pluginPath */ char **vals = slapi_entry_attr_get_charray (e, ATTR_PLUGIN_PATH); diff --git a/ldap/servers/slapd/filter.c b/ldap/servers/slapd/filter.c index 77c369f..0bb10c7 100644 --- a/ldap/servers/slapd/filter.c +++ b/ldap/servers/slapd/filter.c @@ -124,13 +124,13 @@ filter_escape_filter_value_extended(struct slapi_filter *f) /* returns escaped filter string for EQ, LE, GE and APROX filters */ static char * -filter_escape_filter_value(struct slapi_filter *f, const char *fmt, size_t len) +filter_escape_filter_value(struct slapi_filter *f, const char *fmt, size_t len __attribute__((unused))) { char *ptr; filter_compute_hash(f); ptr = slapi_filter_sprintf(fmt, f->f_avtype, ESC_NEXT_VAL, f->f_avvalue.bv_val ); - + return ptr; } @@ -432,7 +432,7 @@ get_filter_list( Connection *conn, BerElement *ber, static int get_substring_filter( - Connection *conn, + Connection *conn __attribute__((unused)), BerElement *ber, struct slapi_filter *f, char **fstr @@ -1011,7 +1011,7 @@ slapi_filter_list_first( struct slapi_filter *f ) } struct slapi_filter * -slapi_filter_list_next( struct slapi_filter *f, struct slapi_filter *fprev ) +slapi_filter_list_next( struct slapi_filter *f __attribute__((unused)), struct slapi_filter *fprev ) { return( fprev->f_next ); } diff --git a/ldap/servers/slapd/filterentry.c b/ldap/servers/slapd/filterentry.c index ec9eee4..0acabf8 100644 --- a/ldap/servers/slapd/filterentry.c +++ b/ldap/servers/slapd/filterentry.c @@ -1024,7 +1024,7 @@ vattr_test_filter_list_and( Slapi_PBlock *pb, Slapi_Entry *e, struct slapi_filter *flist, - int ftype, + int ftype __attribute__((unused)), int verify_access, int only_check_access, int *access_check_done @@ -1066,7 +1066,7 @@ vattr_test_filter_list_or( Slapi_PBlock *pb, Slapi_Entry *e, struct slapi_filter *flist, - int ftype, + int ftype __attribute__((unused)), int verify_access, int only_check_access, int *access_check_done diff --git a/ldap/servers/slapd/getopt_ext.c b/ldap/servers/slapd/getopt_ext.c index 3588114..456529b 100644 --- a/ldap/servers/slapd/getopt_ext.c +++ b/ldap/servers/slapd/getopt_ext.c @@ -46,7 +46,7 @@ int _getopt_ext_done() #endif static -int _getopt_ext_find(int argc, +int _getopt_ext_find(int argc __attribute__((unused)), char **argv, const struct opt_ext *longOpts) { @@ -71,7 +71,7 @@ int _getopt_ext_find(int argc, } static -int _getopt_ext_tailit(int argc, +int _getopt_ext_tailit(int argc __attribute__((unused)), char **argv, int hasArg, int recognized) diff --git a/ldap/servers/slapd/house.c b/ldap/servers/slapd/house.c index f604573..7d52c54 100644 --- a/ldap/servers/slapd/house.c +++ b/ldap/servers/slapd/house.c @@ -28,7 +28,7 @@ static PRCondVar *housekeeping_cvar = NULL; static void -housecleaning(void *cur_time) +housecleaning(void *cur_time __attribute__((unused))) { int interval; @@ -51,7 +51,7 @@ housecleaning(void *cur_time) } PRThread* -housekeeping_start(time_t cur_time, void *arg) +housekeeping_start(time_t cur_time, void *arg __attribute__((unused))) { static time_t thread_start_time; diff --git a/ldap/servers/slapd/ldaputil.c b/ldap/servers/slapd/ldaputil.c index ca16588..34996c8 100644 --- a/ldap/servers/slapd/ldaputil.c +++ b/ldap/servers/slapd/ldaputil.c @@ -488,7 +488,7 @@ slapi_ldap_count_values( char **vals ) int slapi_ldap_create_proxyauth_control ( - LDAP *ld, /* only used to get current ber options */ + LDAP *ld __attribute__((unused)), /* only used to get current ber options */ const char *dn, /* proxy dn */ const char ctl_iscritical, int usev2, /* use the v2 (.18) control instead */ @@ -683,7 +683,7 @@ slapi_ldap_init_ext( int port, /* can also use this to override port in url */ int secure, /* 0 for ldap, 1 for ldaps, 2 for starttls - override proto in url */ - int shared, /* if true, LDAP* will be shared among multiple threads */ + int shared __attribute__((unused)), /* if true, LDAP* will be shared among multiple threads */ const char *ldapi_socket /* for ldapi */ ) { @@ -1525,7 +1525,7 @@ ldap_sasl_free_interact_vals(void *defaults) } static int -ldap_sasl_get_val(ldapSaslInteractVals *vals, sasl_interact_t *interact, unsigned flags) +ldap_sasl_get_val(ldapSaslInteractVals *vals, sasl_interact_t *interact, unsigned flags __attribute__((unused))) { const char *defvalue = interact->defresult; int authtracelevel = SLAPI_LOG_SHELL; /* special auth tracing */ @@ -1569,7 +1569,7 @@ ldap_sasl_get_val(ldapSaslInteractVals *vals, sasl_interact_t *interact, unsigne } static int -ldap_sasl_interact_cb(LDAP *ld, unsigned flags, void *defaults, void *prompts) +ldap_sasl_interact_cb(LDAP *ld __attribute__((unused)), unsigned flags, void *defaults, void *prompts) { sasl_interact_t *interact = NULL; ldapSaslInteractVals *sasldefaults = defaults; @@ -1592,8 +1592,12 @@ ldap_sasl_interact_cb(LDAP *ld, unsigned flags, void *defaults, void *prompts) /* figure out from the context and this error if we should attempt to retry the bind */ static int -can_retry_bind(LDAP *ld, const char *mech, const char *bindid, - const char *creds, int rc, const char *errmsg) +can_retry_bind(LDAP *ld __attribute__((unused)), + const char *mech __attribute__((unused)), + const char *bindid __attribute__((unused)), + const char *creds __attribute__((unused)), + int rc __attribute__((unused)), + const char *errmsg) { int localrc = 0; if (errmsg && strstr(errmsg, "Ticket expired")) { @@ -1610,8 +1614,8 @@ slapd_ldap_sasl_interactive_bind( const char *creds, /* usually a password for simple bind */ const char *mech, /* name of mechanism */ LDAPControl **serverctrls, /* additional controls to send */ - LDAPControl ***returnedctrls, /* returned controls */ - int *msgidp /* pass in non-NULL for async handling */ + LDAPControl ***returnedctrls __attribute__((unused)), /* returned controls */ + int *msgidp __attribute__((unused)) /* pass in non-NULL for async handling */ ) { int rc = LDAP_SUCCESS; @@ -1900,10 +1904,10 @@ internal_krb5_init(void) */ static void set_krb5_creds( - const char *authid, + const char *authid __attribute__((unused)), const char *username, - const char *passwd, - const char *realm, + const char *passwd __attribute__((unused)), + const char *realm __attribute__((unused)), ldapSaslInteractVals *vals ) { diff --git a/ldap/servers/slapd/libglobs.c b/ldap/servers/slapd/libglobs.c index 0e818a9..0a9fb77 100644 --- a/ldap/servers/slapd/libglobs.c +++ b/ldap/servers/slapd/libglobs.c @@ -2164,7 +2164,7 @@ config_set_localhost( const char *attrname, char *value, char *errorbuf, int app } int -config_set_listenhost( const char *attrname, char *value, char *errorbuf, int apply ) { +config_set_listenhost( const char *attrname __attribute__((unused)), char *value, char *errorbuf __attribute__((unused)), int apply ) { int retVal = LDAP_SUCCESS; slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig(); @@ -2409,7 +2409,7 @@ int config_set_slapi_counters( const char *attrname, char *value, char *errorbuf } int -config_set_securelistenhost( const char *attrname, char *value, char *errorbuf, int apply ) { +config_set_securelistenhost( const char *attrname __attribute__((unused)), char *value, char *errorbuf __attribute__((unused)), int apply ) { int retVal = LDAP_SUCCESS; slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig(); @@ -3192,7 +3192,7 @@ config_set_pw_is_legacy_policy( const char *attrname, char *value, char *errorbu } int -config_set_pw_admin_dn( const char *attrname, char *value, char *errorbuf, int apply ) { +config_set_pw_admin_dn( const char *attrname __attribute__((unused)), char *value, char *errorbuf __attribute__((unused)), int apply ) { int retVal = LDAP_SUCCESS; slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig(); @@ -3731,7 +3731,7 @@ config_set_rootpw( const char *attrname, char *value, char *errorbuf, int apply int -config_set_rootpwstoragescheme( const char *attrname, char *value, char *errorbuf, int apply ) { +config_set_rootpwstoragescheme( const char *attrname, char *value, char *errorbuf, int apply __attribute__((unused))) { int retVal = LDAP_SUCCESS; slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig(); struct pw_scheme *new_scheme = NULL; @@ -4517,7 +4517,7 @@ config_set_accesslog_level( const char *attrname, char *value, char *errorbuf, i } /* set the referral-mode url (which puts us into referral mode) */ -int config_set_referral_mode(const char *attrname, char *url, char *errorbuf, int apply) +int config_set_referral_mode(const char *attrname __attribute__((unused)), char *url, char *errorbuf, int apply) { slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig(); @@ -4537,7 +4537,7 @@ int config_set_referral_mode(const char *attrname, char *url, char *errorbuf, in } int -config_set_versionstring( const char *attrname, char *version, char *errorbuf, int apply ) { +config_set_versionstring( const char *attrname __attribute__((unused)), char *version, char *errorbuf, int apply ) { slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig(); if ((!version) || (!version[0])) { @@ -7105,7 +7105,7 @@ config_get_allowed_sasl_mechs() /* separated list of sasl mechs to allow */ int -config_set_allowed_sasl_mechs(const char *attrname, char *value, char *errorbuf, int apply ) +config_set_allowed_sasl_mechs(const char *attrname, char *value, char *errorbuf __attribute__((unused)), int apply ) { slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig(); @@ -7146,7 +7146,7 @@ config_get_default_naming_context(void) } int -config_set_default_naming_context(const char *attrname, +config_set_default_naming_context(const char *attrname __attribute__((unused)), char *value, char *errorbuf, int apply) { slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig(); @@ -7692,7 +7692,7 @@ config_set_value( case CONFIG_SPECIAL_ERRORLOGLEVEL: if (value) { - int ival = *(int *)value; + ival = *(int *)value; ival &= ~LDAP_DEBUG_ANY; if (ival == 0) { /* @@ -7977,7 +7977,7 @@ config_get_extract_pem() #if defined(LINUX) int -config_set_malloc_mxfast(const char *attrname, char *value, char *errorbuf, int apply) +config_set_malloc_mxfast(const char *attrname, char *value, char *errorbuf, int apply __attribute__((unused))) { slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig(); int max = 80 * (sizeof(size_t) / 4); @@ -8019,7 +8019,7 @@ config_get_malloc_mxfast() } int -config_set_malloc_trim_threshold(const char *attrname, char *value, char *errorbuf, int apply) +config_set_malloc_trim_threshold(const char *attrname, char *value, char *errorbuf, int apply __attribute__((unused))) { slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig(); int trim_threshold; @@ -8061,7 +8061,7 @@ config_get_malloc_trim_threshold() } int -config_set_malloc_mmap_threshold(const char *attrname, char *value, char *errorbuf, int apply) +config_set_malloc_mmap_threshold(const char *attrname, char *value, char *errorbuf, int apply __attribute__((unused))) { slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig(); int max; diff --git a/ldap/servers/slapd/log.c b/ldap/servers/slapd/log.c index afedd5b..7d925a0 100644 --- a/ldap/servers/slapd/log.c +++ b/ldap/servers/slapd/log.c @@ -445,9 +445,9 @@ log_set_logging(const char *attrname, char *value, int logtype, char *errorbuf, } int -log_set_backend(const char *attrname, char *value, int logtype, char *errorbuf, int apply) { +log_set_backend(const char *attrname __attribute__((unused)), char *value, int logtype __attribute__((unused)), char *errorbuf __attribute__((unused)), int apply) { - int backend = 0; + int backend_flags = 0; char *backendstr = NULL; /* The backend we are looking at */ char *token = NULL; /* String to tokenise, need to dup value */ char *next = NULL; /* The next value */ @@ -469,21 +469,21 @@ log_set_backend(const char *attrname, char *value, int logtype, char *errorbuf, /* Probably means someone did ",,"*/ continue; } else if (slapi_UTF8NCASECMP(backendstr, "dirsrv-log", 10) == 0 ) { - backend |= LOGGING_BACKEND_INTERNAL; + backend_flags |= LOGGING_BACKEND_INTERNAL; } else if (slapi_UTF8NCASECMP(backendstr, "syslog", 6) == 0) { - backend |= LOGGING_BACKEND_SYSLOG; + backend_flags |= LOGGING_BACKEND_SYSLOG; #ifdef HAVE_JOURNALD } else if (slapi_UTF8NCASECMP(backendstr, "journald", 8) == 0 ) { - backend |= LOGGING_BACKEND_JOURNALD; + backend_flags |= LOGGING_BACKEND_JOURNALD; #endif } } slapi_ch_free_string(&token); - if ( !( backend & LOGGING_BACKEND_INTERNAL) - && ! (backend & LOGGING_BACKEND_SYSLOG) + if ( !( backend_flags & LOGGING_BACKEND_INTERNAL) + && ! (backend_flags & LOGGING_BACKEND_SYSLOG) #ifdef HAVE_JOURNALD - && ! (backend & LOGGING_BACKEND_JOURNALD) + && ! (backend_flags & LOGGING_BACKEND_JOURNALD) #endif ) { /* There is probably a better error here .... */ @@ -495,7 +495,7 @@ log_set_backend(const char *attrname, char *value, int logtype, char *errorbuf, * We just need to use any lock here, doesn't matter which. */ LOG_ACCESS_LOCK_WRITE( ); - loginfo.log_backend = backend; + loginfo.log_backend = backend_flags; slapi_ch_free_string(&(slapdFrontendConfig->logging_backend)); slapdFrontendConfig->logging_backend = slapi_ch_strdup(value); LOG_ACCESS_UNLOCK_WRITE( ); @@ -5105,7 +5105,7 @@ log_reverse_convert_time(char *tbuf) int check_log_max_size( char *maxdiskspace_str, - char *mlogsize_str, + char *mlogsize_str __attribute__((unused)), int maxdiskspace, /* in megabytes */ int mlogsize, /* in megabytes */ char * returntext, diff --git a/ldap/servers/slapd/main.c b/ldap/servers/slapd/main.c index 698946c..05e092e 100644 --- a/ldap/servers/slapd/main.c +++ b/ldap/servers/slapd/main.c @@ -69,7 +69,7 @@ union semun { /* Forward Declarations */ static void register_objects(void); -static void process_command_line(int argc, char **argv, char *myname, char **extraname); +static void process_command_line(int argc, char **argv, char **extraname); static int slapd_exemode_ldif2db(void); static int slapd_exemode_db2ldif(int argc, char **argv); static int slapd_exemode_db2index(void); @@ -143,7 +143,7 @@ static int init_cmd_shutdown_detect(void) } static void -cmd_set_shutdown (int sig) +cmd_set_shutdown (int sig __attribute__((unused))) { /* don't log anything from a signal handler: * you could be holding a lock when the signal was trapped. more @@ -660,7 +660,7 @@ main( int argc, char **argv) myname = slapi_ch_strdup( myname + 1 ); } - process_command_line(argc,argv,myname,&extraname); + process_command_line(argc,argv,&extraname); if (NULL == slapdFrontendConfig->configdir) { usage( myname, extraname ); @@ -681,7 +681,7 @@ main( int argc, char **argv) vattr_init(); if (slapd_exemode == SLAPD_EXEMODE_REFERRAL) { - slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig(); + slapdFrontendConfig = getFrontendConfig(); /* make up the config stuff */ referral_set_defaults(); /* @@ -699,7 +699,7 @@ main( int argc, char **argv) register_objects(); } else { - slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig(); + slapdFrontendConfig = getFrontendConfig(); /* The 2 calls below have been moved to this place to make sure that * they are called before setup_internal_backends to avoid bug 524439 */ /* @@ -1194,8 +1194,7 @@ register_objects(void) } static void -process_command_line(int argc, char **argv, char *myname, - char **extraname) +process_command_line(int argc, char **argv, char **extraname) { int i; char errorbuf[SLAPI_DSE_RETURNTEXT_SIZE]; diff --git a/ldap/servers/slapd/mapping_tree.c b/ldap/servers/slapd/mapping_tree.c index 1b8d2d9..fbf3930 100644 --- a/ldap/servers/slapd/mapping_tree.c +++ b/ldap/servers/slapd/mapping_tree.c @@ -1044,7 +1044,12 @@ mtn_free_referral_in_node (mapping_tree_node *node) node->mtn_referral_entry = NULL; } -int mapping_tree_entry_modify_callback(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* entryAfter, int *returncode, char *returntext, void *arg) +int mapping_tree_entry_modify_callback(Slapi_PBlock *pb, + Slapi_Entry* entryBefore __attribute__((unused)), + Slapi_Entry* entryAfter, + int *returncode, + char *returntext, + void *arg __attribute__((unused))) { LDAPMod **mods; int i; @@ -1431,7 +1436,12 @@ int mapping_tree_entry_modify_callback(Slapi_PBlock *pb, Slapi_Entry* entryBefor return SLAPI_DSE_CALLBACK_OK; } -int mapping_tree_entry_add_callback(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* e, int *returncode, char *returntext, void *arg) +int mapping_tree_entry_add_callback(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* entryBefore, + Slapi_Entry* e __attribute__((unused)), + int *returncode, + char *returntext __attribute__((unused)), + void *arg __attribute__((unused))) { mapping_tree_node *node = NULL; int i; @@ -1521,7 +1531,12 @@ static void mtn_remove_node(mapping_tree_node * node) node->mtn_brother = NULL; } -int mapping_tree_entry_delete_callback(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* e, int *returncode, char *returntext, void *arg) +int mapping_tree_entry_delete_callback(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* entryBefore, + Slapi_Entry* e __attribute__((unused)), + int *returncode, + char *returntext, + void *arg __attribute__((unused))) { int result = SLAPI_DSE_CALLBACK_OK; mapping_tree_node *node = NULL; diff --git a/ldap/servers/slapd/match.c b/ldap/servers/slapd/match.c index d0c1a32..9acf443 100644 --- a/ldap/servers/slapd/match.c +++ b/ldap/servers/slapd/match.c @@ -231,7 +231,7 @@ int slapi_matchingrule_register(Slapi_MatchingRuleEntry *mrule) return(LDAP_SUCCESS); } -int slapi_matchingrule_unregister(char *oid) +int slapi_matchingrule_unregister(char *oid __attribute__((unused))) { /* * Currently, not implemented. diff --git a/ldap/servers/slapd/modify.c b/ldap/servers/slapd/modify.c index 4bef90a..b2e113a 100644 --- a/ldap/servers/slapd/modify.c +++ b/ldap/servers/slapd/modify.c @@ -404,7 +404,7 @@ Slapi_PBlock* slapi_modify_internal(const char *idn, LDAPMod **mods, LDAPControl **controls, - int dummy) + int dummy __attribute__((unused))) { Slapi_PBlock pb = {0}; Slapi_PBlock *result_pb = NULL; diff --git a/ldap/servers/slapd/modrdn.c b/ldap/servers/slapd/modrdn.c index 15f5210..b6488bf 100644 --- a/ldap/servers/slapd/modrdn.c +++ b/ldap/servers/slapd/modrdn.c @@ -243,7 +243,7 @@ slapi_modrdn_internal(const char *iodn, const char *inewrdn, int deloldrdn, LDAP } Slapi_PBlock * -slapi_rename_internal(const char *iodn, const char *inewrdn, const char *inewsuperior, int deloldrdn, LDAPControl **controls, int dummy) +slapi_rename_internal(const char *iodn, const char *inewrdn, const char *inewsuperior, int deloldrdn, LDAPControl **controls, int dummy __attribute__((unused))) { Slapi_PBlock pb = {0}; Slapi_PBlock *result_pb = NULL; diff --git a/ldap/servers/slapd/monitor.c b/ldap/servers/slapd/monitor.c index f1fb38f..539f93b 100644 --- a/ldap/servers/slapd/monitor.c +++ b/ldap/servers/slapd/monitor.c @@ -35,7 +35,12 @@ int -monitor_info(Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAfter, int *returncode, char *returntext, void *arg) +monitor_info(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* e, + Slapi_Entry* entryAfter __attribute__((unused)), + int *returncode, + char *returntext __attribute__((unused)), + void *arg __attribute__((unused))) { char buf[BUFSIZ]; struct berval val; diff --git a/ldap/servers/slapd/operation.c b/ldap/servers/slapd/operation.c index ccbc549..e525d14 100644 --- a/ldap/servers/slapd/operation.c +++ b/ldap/servers/slapd/operation.c @@ -594,7 +594,7 @@ int slapi_connection_acquire(Slapi_Connection *conn) } int -slapi_connection_remove_operation( Slapi_PBlock *pb, Slapi_Connection *conn, Slapi_Operation *op, int release) +slapi_connection_remove_operation( Slapi_PBlock *pb __attribute__((unused)), Slapi_Connection *conn, Slapi_Operation *op, int release) { int rc = 0; Slapi_Operation **olist= &conn->c_ops; diff --git a/ldap/servers/slapd/opshared.c b/ldap/servers/slapd/opshared.c index 3ce7970..2cec292 100644 --- a/ldap/servers/slapd/opshared.c +++ b/ldap/servers/slapd/opshared.c @@ -1695,28 +1695,29 @@ send_results_ext(Slapi_PBlock *pb, int send_result, int *nentries, int pagesize, } /* Iterate through the returned result set */ - if (be->be_next_search_entry_ext != NULL) - { - /* The iterate look ahead is causing a whole mess with the ACL. - ** the entries are now visiting the ACL land in a random way - ** and not the ordered way it was before. Until we figure out - ** let's not change the behavior. - ** - ** Don't use iterate_with_lookahead because it sends the result - * in the same times as the entry and this can cause failure - * of the mapping tree scanning algorithme - * if (getFrontendConfig()->result_tweak) - * { - * rc = iterate_with_lookahead(pb, be, send_result, nentries); - * } - * else - */ - rc = iterate(pb, be, send_result, nentries, pagesize, pr_stat); - } - else + /* if (be->be_next_search_entry_ext != NULL) { + */ + /* The iterate look ahead is causing a whole mess with the ACL. + ** the entries are now visiting the ACL land in a random way + ** and not the ordered way it was before. Until we figure out + ** let's not change the behavior. + ** + ** Don't use iterate_with_lookahead because it sends the result + * in the same times as the entry and this can cause failure + * of the mapping tree scanning algorithme + * if (getFrontendConfig()->result_tweak) + * { + * rc = iterate_with_lookahead(pb, be, send_result, nentries); + * } else { + */ + rc = iterate(pb, be, send_result, nentries, pagesize, pr_stat); + /* + } + } else { // if (be->be_next_search_entry_ext != NULL) rc = iterate(pb, be, send_result, nentries, pagesize, pr_stat); } + */ switch(rc) { @@ -1726,12 +1727,12 @@ send_results_ext(Slapi_PBlock *pb, int send_result, int *nentries, int pagesize, /* If this happens we are dead but hopefully iterate * never sends the result itself */ - break; + break; case 1: /* everything is ok - don't send the result */ rc = 0; } - + return rc; } diff --git a/ldap/servers/slapd/pagedresults.c b/ldap/servers/slapd/pagedresults.c index a30e2fa..0263aee 100644 --- a/ldap/servers/slapd/pagedresults.c +++ b/ldap/servers/slapd/pagedresults.c @@ -705,7 +705,7 @@ pagedresults_set_timelimit(Connection *conn, Operation *op, } int -pagedresults_set_sizelimit(Connection *conn, Operation *op, +pagedresults_set_sizelimit(Connection *conn __attribute__((unused)), Operation *op, int sizelimit, int index) { int rc = -1; @@ -719,7 +719,7 @@ pagedresults_set_sizelimit(Connection *conn, Operation *op, } int -pagedresults_get_sizelimit(Connection *conn, Operation *op, int index) +pagedresults_get_sizelimit(Connection *conn __attribute__((unused)), Operation *op, int index) { int sizelimit = -1; if (!op_is_pagedresults(op)) { diff --git a/ldap/servers/slapd/passwd_extop.c b/ldap/servers/slapd/passwd_extop.c index 0a96c59..d020962 100644 --- a/ldap/servers/slapd/passwd_extop.c +++ b/ldap/servers/slapd/passwd_extop.c @@ -551,7 +551,7 @@ passwd_modify_extop( Slapi_PBlock *pb ) /* identify userID field by tags */ if (tag == LDAP_EXTOP_PASSMOD_TAG_USERID ) { - int rc = 0; + rc = 0; if ( ber_scanf( ber, "a", &rawdn) == LBER_ERROR ) { slapi_ch_free_string(&rawdn); slapi_log_err(SLAPI_LOG_ERR, "passwd_modify_extop", "ber_scanf failed :{\n"); @@ -804,7 +804,7 @@ parse_req_done: goto free_and_return; } - if (gen_passwd && (gen_passwd->bv_val != '\0')) { + if (gen_passwd && (gen_passwd->bv_val[0] != '\0')) { /* Set the reponse to let the user know the generated password */ slapi_pblock_set(pb, SLAPI_EXT_OP_RET_VALUE, gen_passwd); } diff --git a/ldap/servers/slapd/pblock.c b/ldap/servers/slapd/pblock.c index 2e95ecb..a99caac 100644 --- a/ldap/servers/slapd/pblock.c +++ b/ldap/servers/slapd/pblock.c @@ -1534,8 +1534,8 @@ __attribute__((no_sanitize("address"))) if(pblock->pb_op!=NULL) { (*(entry_address **)value) = &(pblock->pb_op->o_params.p.p_modrdn.modrdn_newsuperior_address); - break; } + break; /* search arguments */ case SLAPI_SEARCH_SCOPE: @@ -3218,7 +3218,7 @@ __attribute__((no_sanitize("address"))) break; case SLAPI_MODRDN_NEWSUPERIOR_ADDRESS: PR_ASSERT (PR_FALSE); /* can't do this */ - + break; /* search arguments */ case SLAPI_SEARCH_SCOPE: if(pblock->pb_op!=NULL) diff --git a/ldap/servers/slapd/plugin.c b/ldap/servers/slapd/plugin.c index ac8306f..420c306 100644 --- a/ldap/servers/slapd/plugin.c +++ b/ldap/servers/slapd/plugin.c @@ -719,7 +719,7 @@ slapi_send_ldap_search_entry( Slapi_PBlock *pb, Slapi_Entry *e, LDAPControl **ec void slapi_set_ldap_result( Slapi_PBlock *pb, int err, char *matched, char *text, - int nentries, struct berval **urls ) + int nentries __attribute__((unused)), struct berval **urls __attribute__((unused))) { char * old_matched = NULL; char * old_text = NULL; @@ -1494,7 +1494,7 @@ plugin_get_plugin_dependencies(char *plugin_name, char ***names) */ static int -plugin_dependency_startall(int argc, char** argv, char *errmsg, int operation, char** plugin_list) +plugin_dependency_startall(int argc, char** argv, char *errmsg __attribute__((unused)), int operation, char** plugin_list) { int ret = 0; Slapi_PBlock pb; @@ -2002,7 +2002,7 @@ plugin_startall(int argc, char** argv, char **plugin_list) * */ void -plugin_closeall(int close_backends, int close_globals) +plugin_closeall(int close_backends __attribute__((unused)), int close_globals __attribute__((unused))) { plugin_dependency_closeall(); } @@ -2840,7 +2840,7 @@ add_entry - if true, the entry will be added to the DIT using the given ************************************/ int plugin_setup(Slapi_Entry *plugin_entry, struct slapi_componentid *group, - slapi_plugin_init_fnptr p_initfunc, int add_entry, char *returntext) + slapi_plugin_init_fnptr p_initfunc, int add_entry __attribute__((unused)), char *returntext) { int ii = 0; char attrname[SLAPD_TYPICAL_ATTRIBUTE_NAME_MAX_LENGTH]; @@ -3455,7 +3455,7 @@ plugin_cleanup_list(void) * were marked to be removed. */ static int -plugin_remove_plugins(struct slapdplugin *plugin_entry, char *plugin_type) +plugin_remove_plugins(struct slapdplugin *plugin_entry, char *plugin_type __attribute__((unused))) { struct slapdplugin *plugin = NULL; struct slapdplugin *plugin_next = NULL; @@ -3741,7 +3741,7 @@ plugin_invoke_plugin_pb (struct slapdplugin *plugin, int operation, Slapi_PBlock } PRBool -plugin_invoke_plugin_sdn (struct slapdplugin *plugin, int operation, Slapi_PBlock *pb, Slapi_DN *target_spec) +plugin_invoke_plugin_sdn (struct slapdplugin *plugin, int operation __attribute__((unused)), Slapi_PBlock *pb, Slapi_DN *target_spec) { PluginTargetData *ptd; PluginTargetData *excludedPtd; @@ -3970,7 +3970,7 @@ static PRBool plugin_matches_operation (Slapi_DN *target_spec, PluginTargetData } /* build operation action bitmap based on plugin configuration and actions specified for the operation */ -int plugin_build_operation_action_bitmap (int input_actions, const struct slapdplugin *plugin) +int plugin_build_operation_action_bitmap (int input_actions __attribute__((unused)), const struct slapdplugin *plugin) { int result_actions = 0; diff --git a/ldap/servers/slapd/plugin_internal_op.c b/ldap/servers/slapd/plugin_internal_op.c index 966a71f..22c1807 100644 --- a/ldap/servers/slapd/plugin_internal_op.c +++ b/ldap/servers/slapd/plugin_internal_op.c @@ -59,71 +59,68 @@ static int search_internal_callback_pb (Slapi_PBlock *pb, void *callback_data, p plugin_search_entry_callback psec, plugin_referral_entry_callback prec); void -internal_getresult_callback(struct conn *unused1, +internal_getresult_callback(struct conn *unused1 __attribute__((unused)), struct op *op, int err, - char *unused2, - char *unused3, - int unused4, - struct berval **unused5) + char *unused2 __attribute__((unused)), + char *unused3 __attribute__((unused)), + int unused4 __attribute__((unused)), + struct berval **unused5 __attribute__((unused))) { - if (op != NULL) - { - *((int *)op->o_handler_data) = err; + if (op != NULL) + { + *((int *)op->o_handler_data) = err; } } -void -internal_res_callback(struct conn *unused1, struct op *op, int err, char *unused2, - char *unused3, int unused4, struct berval **unused5) +void +internal_res_callback(struct conn *unused1 __attribute__((unused)), + struct op *op, + int err, + char *unused2 __attribute__((unused)), + char *unused3 __attribute__((unused)), + int unused4 __attribute__((unused)), + struct berval **unused5 __attribute__((unused))) { /* make sure the user has a callback defined, if so do it, otherwise do nothing */ - if( ((callback_fn_ptrs *)op->o_handler_data) != NULL - && ((callback_fn_ptrs *)op->o_handler_data)->p_res_callback != NULL - ) - { - ((callback_fn_ptrs *)op->o_handler_data)->p_res_callback - (err, ((callback_fn_ptrs *)op->o_handler_data)->callback_data); + if(((callback_fn_ptrs *)op->o_handler_data) != NULL && ((callback_fn_ptrs *)op->o_handler_data)->p_res_callback != NULL ) + { + ((callback_fn_ptrs *)op->o_handler_data)->p_res_callback(err, ((callback_fn_ptrs *)op->o_handler_data)->callback_data); } } int -internal_srch_entry_callback(Slapi_Backend* be, Connection* conn, - Operation* op, Slapi_Entry* e) +internal_srch_entry_callback(Slapi_Backend* be __attribute__((unused)), + Connection* conn __attribute__((unused)), + Operation* op, + Slapi_Entry* e) { /* make sure the user has a callback defined, if so do it, otherwise do nothing */ - if( ((callback_fn_ptrs *)op->o_handler_data) != NULL - && ((callback_fn_ptrs *)op->o_handler_data)->p_srch_entry_callback != NULL - ) + if(((callback_fn_ptrs *)op->o_handler_data) != NULL && ((callback_fn_ptrs *)op->o_handler_data)->p_srch_entry_callback != NULL) { - return(((callback_fn_ptrs *)op->o_handler_data)->p_srch_entry_callback - (e, ((callback_fn_ptrs *)op->o_handler_data)->callback_data)); + return(((callback_fn_ptrs *)op->o_handler_data)->p_srch_entry_callback(e, ((callback_fn_ptrs *)op->o_handler_data)->callback_data)); } - - return(0); + return(0); } int -internal_ref_entry_callback(Slapi_Backend * be, Connection *conn, - Operation *op, struct berval **ireferral) +internal_ref_entry_callback(Slapi_Backend * be __attribute__((unused)), + Connection *conn __attribute__((unused)), + Operation *op, + struct berval **ireferral) { - int i; /* make sure the user has a callback defined, if so do it, otherwise do nothing */ - if( ((callback_fn_ptrs *)op->o_handler_data) != NULL - && ((callback_fn_ptrs *)op->o_handler_data)->p_ref_entry_callback != NULL - && ireferral != NULL - ) + if(((callback_fn_ptrs *)op->o_handler_data) != NULL && ((callback_fn_ptrs *)op->o_handler_data)->p_ref_entry_callback != NULL && ireferral != NULL) { /* loop over referrals calling callback for each one */ - for(i=0; ireferral[i] != NULL; i++) + for(size_t i=0; ireferral[i] != NULL; i++) { - ((callback_fn_ptrs *)op->o_handler_data)->p_ref_entry_callback(ireferral[i]->bv_val, - ((callback_fn_ptrs *)op->o_handler_data)->callback_data); + ((callback_fn_ptrs *)op->o_handler_data)->p_ref_entry_callback(ireferral[i]->bv_val, ((callback_fn_ptrs *)op->o_handler_data)->callback_data); } } return(0); @@ -182,10 +179,10 @@ do_disconnect_server(Connection *conn, PRUint64 opconnid, int opid) Slapi_PBlock * -slapi_compare_internal(char * dn, - char *attr, - char *value, - LDAPControl **controls) +slapi_compare_internal(char * dn __attribute__((unused)), + char *attr __attribute__((unused)), + char *value __attribute__((unused)), + LDAPControl **controls __attribute__((unused))) { printf("slapi_compare_internal not yet implemented \n"); return(0); @@ -202,7 +199,7 @@ slapi_seq_callback( const char *ibase, LDAPControl **controls, plugin_result_callback res_callback, plugin_search_entry_callback srch_callback, - plugin_referral_entry_callback ref_callback) + plugin_referral_entry_callback ref_callback) { int r; Slapi_PBlock pb = {0}; diff --git a/ldap/servers/slapd/plugin_syntax.c b/ldap/servers/slapd/plugin_syntax.c index 5db3d21..a045a85 100644 --- a/ldap/servers/slapd/plugin_syntax.c +++ b/ldap/servers/slapd/plugin_syntax.c @@ -58,7 +58,7 @@ slapi_get_global_syntax_plugins() } char * -plugin_syntax2oid( struct slapdplugin *pi ) +plugin_syntax2oid( struct slapdplugin *pi __attribute__((unused))) { slapi_log_err(SLAPI_LOG_NOTICE, "plugin_syntax2oid", "This function is deprecated - please use attr_get_syntax_oid() instead\n"); @@ -68,8 +68,8 @@ plugin_syntax2oid( struct slapdplugin *pi ) int plugin_call_syntax_get_compare_fn( - void *vpi, - value_compare_fn_type *compare_fn + void *vpi __attribute__((unused)), + value_compare_fn_type *compare_fn __attribute__((unused)) ) { slapi_log_err(SLAPI_LOG_NOTICE, "plugin_call_syntax_get_compare_fn", @@ -150,7 +150,7 @@ plugin_call_syntax_filter_ava_sv( slapi_pblock_set( &pipb, SLAPI_PLUGIN, (void *) a->a_plugin ); ava_fn = a->a_plugin->plg_syntax_filter_ava; } - /* FALL */ + /* FALLTHROUGH */ case LDAP_FILTER_EQUALITY: case LDAP_FILTER_APPROX: if (NULL == ava_fn) { diff --git a/ldap/servers/slapd/pw.c b/ldap/servers/slapd/pw.c index 378d148..96e3857 100644 --- a/ldap/servers/slapd/pw.c +++ b/ldap/servers/slapd/pw.c @@ -727,7 +727,7 @@ update_pw_info ( Slapi_PBlock *pb , char *old_pw) } int -check_pw_minage ( Slapi_PBlock *pb, const Slapi_DN *sdn, struct berval **vals) +check_pw_minage ( Slapi_PBlock *pb, const Slapi_DN *sdn, struct berval **vals __attribute__((unused))) { char *dn= (char*)slapi_sdn_get_ndn(sdn); /* jcm - Had to cast away const */ passwdPolicy *pwpolicy=NULL; @@ -1330,7 +1330,7 @@ int pw_in_history( Slapi_Value **history_vals, const Slapi_Value *pw_val) int slapi_add_pwd_control ( Slapi_PBlock *pb, char *arg, long time) { LDAPControl new_ctrl; - char buf[12]; + char buf[22] = {0}; slapi_log_err(SLAPI_LOG_TRACE, "slapi_add_pwd_control", "=>\n"); @@ -1348,7 +1348,7 @@ slapi_add_pwd_control ( Slapi_PBlock *pb, char *arg, long time) { } void -add_password_attrs( Slapi_PBlock *pb, Operation *op, Slapi_Entry *e ) +add_password_attrs( Slapi_PBlock *pb, Operation *op __attribute__((unused)), Slapi_Entry *e ) { struct berval bv; struct berval *bvals[2]; @@ -2196,8 +2196,8 @@ check_pw_duration_value(const char *attr_name, char *value, } int -check_pw_resetfailurecount_value(const char *attr_name, char *value, - long minval, long maxval, char *errorbuf, size_t ebuflen) +check_pw_resetfailurecount_value(const char *attr_name __attribute__((unused)), char *value, + long minval __attribute__((unused)), long maxval __attribute__((unused)), char *errorbuf, size_t ebuflen) { int retVal = LDAP_SUCCESS; long duration = 0; /* in minutes */ @@ -2213,8 +2213,8 @@ check_pw_resetfailurecount_value(const char *attr_name, char *value, } int -check_pw_storagescheme_value(const char *attr_name, char *value, - long minval, long maxval, char *errorbuf, size_t ebuflen) +check_pw_storagescheme_value(const char *attr_name __attribute__((unused)), char *value, + long minval __attribute__((unused)), long maxval __attribute__((unused)), char *errorbuf, size_t ebuflen) { int retVal = LDAP_SUCCESS; struct pw_scheme *new_scheme = NULL; @@ -2558,7 +2558,7 @@ struct slapi_pw_entry_ext { * constructor for the entry object extension. */ static void * -pw_entry_constructor(void *object, void *parent) +pw_entry_constructor(void *object __attribute__((unused)), void *parent __attribute__((unused))) { struct slapi_pw_entry_ext *pw_extp = NULL; Slapi_RWLock *rwlock; @@ -2577,7 +2577,7 @@ pw_entry_constructor(void *object, void *parent) * destructor for the entry object extension. */ static void -pw_entry_destructor(void *extension, void *object, void *parent) +pw_entry_destructor(void *extension, void *object __attribute__((unused)), void *parent __attribute__((unused))) { struct slapi_pw_entry_ext *pw_extp = (struct slapi_pw_entry_ext *)extension; diff --git a/ldap/servers/slapd/pw_mgmt.c b/ldap/servers/slapd/pw_mgmt.c index 7252c08..101f4be 100644 --- a/ldap/servers/slapd/pw_mgmt.c +++ b/ldap/servers/slapd/pw_mgmt.c @@ -36,7 +36,7 @@ need_new_pw( Slapi_PBlock *pb, long *t, Slapi_Entry *e, int pwresponse_req ) const Slapi_DN *sdn; passwdPolicy *pwpolicy = NULL; int pwdGraceUserTime = 0; - char graceUserTime[8]; + char graceUserTime[16] = {0}; if (NULL == e) { return (-1); diff --git a/ldap/servers/slapd/pw_retry.c b/ldap/servers/slapd/pw_retry.c index 33b1713..da08f66 100644 --- a/ldap/servers/slapd/pw_retry.c +++ b/ldap/servers/slapd/pw_retry.c @@ -128,7 +128,7 @@ int set_retry_cnt_mods(Slapi_PBlock *pb, Slapi_Mods *smods, int count) { char *timestr; time_t unlock_time; - char retry_cnt[8]; /* 1-65535 */ + char retry_cnt[16] = {0}; /* 1-65535 */ const char *dn = NULL; Slapi_DN *sdn = NULL; passwdPolicy *pwpolicy = NULL; diff --git a/ldap/servers/slapd/resourcelimit.c b/ldap/servers/slapd/resourcelimit.c index ea22d34..a92e9bd 100644 --- a/ldap/servers/slapd/resourcelimit.c +++ b/ldap/servers/slapd/resourcelimit.c @@ -225,7 +225,7 @@ reslimit_cleanup( void ) * constructor for the connection object extension. */ static void * -reslimit_connext_constructor( void *object, void *parent ) +reslimit_connext_constructor( void *object __attribute__((unused)), void *parent __attribute__((unused))) { SLAPIResLimitConnData *rlcdp; Slapi_RWLock *rwlock; @@ -248,7 +248,7 @@ reslimit_connext_constructor( void *object, void *parent ) * destructor for the connection object extension. */ static void -reslimit_connext_destructor( void *extension, void *object, void *parent ) +reslimit_connext_destructor( void *extension, void *object __attribute__((unused)), void *parent __attribute__((unused))) { SLAPIResLimitConnData *rlcdp = (SLAPIResLimitConnData *)extension; diff --git a/ldap/servers/slapd/result.c b/ldap/servers/slapd/result.c index 5c38bae..07db4d0 100644 --- a/ldap/servers/slapd/result.c +++ b/ldap/servers/slapd/result.c @@ -406,7 +406,7 @@ send_ldap_result_ext( tag = LDAP_TAG_REFERRAL; break; } - /* fallthru */ + /* FALLTHROUGH */ default: tag = operation->o_tag + 1; @@ -1328,7 +1328,7 @@ exit: int send_specific_attrs(Slapi_Entry *e, char **attrs, Slapi_Operation *op, Slapi_PBlock *pb, BerElement *ber, int attrsonly, - int ldapversion, int real_attrs_only) + int ldapversion __attribute__((unused)), int real_attrs_only) { int i = 0; int rc = 0; @@ -1713,7 +1713,7 @@ log_and_return: tag = LDAP_TAG_REFERRAL; break; } - /* fallthru */ + /* FALLTHROUGH */ default: tag = op->o_tag + 1; diff --git a/ldap/servers/slapd/rootdse.c b/ldap/servers/slapd/rootdse.c index d839c92..8acdcf5 100644 --- a/ldap/servers/slapd/rootdse.c +++ b/ldap/servers/slapd/rootdse.c @@ -31,7 +31,7 @@ static char *readonly_attributes[] = { "ref", "vendorName", "vendorVersion", - ATTR_NETSCAPEMDSUFFIX, + ATTR_NETSCAPEMDSUFFIX, NULL }; @@ -93,7 +93,12 @@ rootdse_is_readonly_attr( char *attr ) * before calling slapi_entry_free(). */ int -read_root_dse( Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *entryAfter, int *returncode, char *returntext, void *arg ) +read_root_dse( Slapi_PBlock *pb, + Slapi_Entry *e, + Slapi_Entry *entryAfter __attribute__((unused)), + int *returncode, + char *returntext __attribute__((unused)), + void *arg __attribute__((unused))) { int i; struct berval *vals[2]; @@ -321,7 +326,12 @@ read_root_dse( Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *entryAfter, int *r * case LDAP_INSUFFICIENT_ACCESS is returned. */ int -modify_root_dse( Slapi_PBlock *pb, Slapi_Entry *entryBefore, Slapi_Entry *e, int *returncode, char *returntext, void *arg ) +modify_root_dse( Slapi_PBlock *pb, + Slapi_Entry *entryBefore __attribute__((unused)), + Slapi_Entry *e __attribute__((unused)), + int *returncode, + char *returntext, + void *arg __attribute__((unused))) { LDAPMod **mods; diff --git a/ldap/servers/slapd/sasl_io.c b/ldap/servers/slapd/sasl_io.c index 1337e1c..7c51ebb 100644 --- a/ldap/servers/slapd/sasl_io.c +++ b/ldap/servers/slapd/sasl_io.c @@ -69,7 +69,7 @@ sasl_io_recv(PRFileDesc *fd, void *buf, PRInt32 len, PRIntn flags, PRIntervalTime timeout); static void -debug_print_layers(PRFileDesc *fd) +debug_print_layers(PRFileDesc *fd __attribute__((unused))) { #if 0 PR_ASSERT(fd->higher == NULL); /* this is the topmost layer */ @@ -752,7 +752,7 @@ initialize(void) * no other threads are accessing conn->c_prfd */ int -sasl_io_enable(Connection *c, void *data /* UNUSED */) +sasl_io_enable(Connection *c, void *data __attribute__((unused))) { PRStatus rv = PR_CallOnce(&sasl_callOnce, initialize); if (PR_SUCCESS == rv) { @@ -789,7 +789,7 @@ sasl_io_enable(Connection *c, void *data /* UNUSED */) * called while the connection (c_prfd) is not being referenced by another thread. */ int -sasl_io_cleanup(Connection *c, void *data /* UNUSED */) +sasl_io_cleanup(Connection *c, void *data __attribute__((unused))) { int ret = 0; diff --git a/ldap/servers/slapd/sasl_map.c b/ldap/servers/slapd/sasl_map.c index 84f845d..bc4381e 100644 --- a/ldap/servers/slapd/sasl_map.c +++ b/ldap/servers/slapd/sasl_map.c @@ -434,7 +434,12 @@ sasl_map_read_config_startup(sasl_map_private *priv) } int -sasl_map_config_add(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* e, int *returncode, char *returntext __attribute__((unused)) , void *arg) +sasl_map_config_add(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* entryBefore, + Slapi_Entry* e __attribute__((unused)), + int *returncode, + char *returntext, + void *arg __attribute__((unused))) { int ret = 0; sasl_map_data *dp = NULL; @@ -456,7 +461,12 @@ sasl_map_config_add(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* e, } int -sasl_map_config_modify(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* e, int *returncode, char *returntext, void *arg) +sasl_map_config_modify(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* entryBefore, + Slapi_Entry* e, + int *returncode __attribute__((unused)), + char *returntext __attribute__((unused)), + void *arg __attribute__((unused))) { sasl_map_private *priv = sasl_map_get_global_priv(); sasl_map_data *dp; @@ -485,7 +495,12 @@ sasl_map_config_modify(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* } int -sasl_map_config_delete(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* e, int *returncode, char *returntext __attribute__((unused)), void *arg) +sasl_map_config_delete(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* entryBefore, + Slapi_Entry* e __attribute__((unused)), + int *returncode, + char *returntext, + void *arg __attribute__((unused))) { int ret = 0; sasl_map_private *priv = sasl_map_get_global_priv(); diff --git a/ldap/servers/slapd/saslbind.c b/ldap/servers/slapd/saslbind.c index 9e5d1f0..906535f 100644 --- a/ldap/servers/slapd/saslbind.c +++ b/ldap/servers/slapd/saslbind.c @@ -97,15 +97,15 @@ static Slapi_ComponentId *sasl_get_component_id(void) * properties we need - it's more efficient that way. */ #if SASL_AUXPROP_PLUG_VERSION > 4 -static int ids_auxprop_lookup( +static int ids_auxprop_lookup #else -static void ids_auxprop_lookup( +static void ids_auxprop_lookup #endif - void *glob_context, - sasl_server_params_t *sparams, - unsigned flags, - const char *user, - unsigned ulen) + ( void *glob_context __attribute__((unused)), + sasl_server_params_t *sparams __attribute__((unused)), + unsigned flags __attribute__((unused)), + const char *user __attribute__((unused)), + unsigned ulen __attribute__((unused)) ) { /* do nothing - we don't need auxprops - we just do this to avoid sasldb_auxprop_lookup */ @@ -124,11 +124,11 @@ static sasl_auxprop_plug_t ids_auxprop_plugin = { NULL /* auxprop_store */ }; -int ids_auxprop_plug_init(const sasl_utils_t *utils, +int ids_auxprop_plug_init(const sasl_utils_t *utils __attribute__((unused)), int max_version, int *out_version, sasl_auxprop_plug_t **plug, - const char *plugname) + const char *plugname __attribute__((unused))) { if(!out_version || !plug) return SASL_BADPARAM; @@ -142,7 +142,7 @@ int ids_auxprop_plug_init(const sasl_utils_t *utils, } static int ids_sasl_getopt( - void *context, + void *context __attribute__((unused)), const char *plugin_name, const char *option, const char **result, @@ -179,7 +179,7 @@ static int ids_sasl_getopt( } static int ids_sasl_log( - void *context, + void *context __attribute__((unused)), int level, const char *message ) @@ -275,8 +275,8 @@ static void ids_sasl_user_search( * Search for an entry representing the sasl user. */ static Slapi_Entry *ids_sasl_user_to_entry( - sasl_conn_t *conn, - void *context, + sasl_conn_t *conn __attribute__((unused)), + void *context __attribute__((unused)), const char *user, const char *user_realm ) @@ -364,8 +364,11 @@ static int ids_sasl_canon_user( sasl_conn_t *conn, void *context, const char *userbuf, unsigned ulen, - unsigned flags, const char *user_realm, - char *out_user, unsigned out_umax, unsigned *out_ulen + unsigned flags __attribute__((unused)), + const char *user_realm, + char *out_user, + unsigned out_umax, + unsigned *out_ulen ) { struct propctx *propctx = sasl_auxprop_getctx(conn); @@ -496,7 +499,7 @@ fail: return returnvalue; } -static int ids_sasl_getpluginpath(sasl_conn_t *conn, const char **path) +static int ids_sasl_getpluginpath(sasl_conn_t *conn __attribute__((unused)), const char **path) { /* Try to get path from config, otherwise check for SASL_PATH environment * variable. If neither of these are set, default to /usr/lib64/sasl2 on @@ -511,7 +514,13 @@ static int ids_sasl_getpluginpath(sasl_conn_t *conn, const char **path) return SASL_OK; } -static int ids_sasl_userdb_checkpass(sasl_conn_t *conn, void *context, const char *user, const char *pass, unsigned passlen, struct propctx *propctx) { +static int ids_sasl_userdb_checkpass(sasl_conn_t *conn, + void *context __attribute__((unused)), + const char *user, + const char *pass, + unsigned passlen, + struct propctx *propctx __attribute__((unused))) +{ /* * Based on the mech */ diff --git a/ldap/servers/slapd/schema.c b/ldap/servers/slapd/schema.c index 392c01f..af53fc7 100644 --- a/ldap/servers/slapd/schema.c +++ b/ldap/servers/slapd/schema.c @@ -531,7 +531,12 @@ schema_dse_unlock( void ) static int -dont_allow_that(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* e, int *returncode, char *returntext, void *arg) +dont_allow_that(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry* entryBefore __attribute__((unused)), + Slapi_Entry* e __attribute__((unused)), + int *returncode, + char *returntext __attribute__((unused)), + void *arg __attribute__((unused))) { *returncode = LDAP_UNWILLING_TO_PERFORM; return SLAPI_DSE_CALLBACK_ERROR; @@ -541,8 +546,9 @@ dont_allow_that(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* e, int static const char * skipWS(const char *s) { - while (s && isascii(*s) && isspace(*s) ) + while (s && isascii(*s) && isspace(*s) ) { ++s; + } if ((isascii(*s)) == 0) { return NULL; @@ -1691,7 +1697,7 @@ struct syntax_enum_wrapper { }; static int -schema_syntax_enum_callback(char **names, Slapi_PluginDesc *plugindesc, +schema_syntax_enum_callback(char **names, Slapi_PluginDesc *plugindesc __attribute__((unused)), void *arg) { struct syntax_enum_wrapper *sew = (struct syntax_enum_wrapper *)arg; @@ -1815,14 +1821,14 @@ slapi_schema_list_attribute_names(unsigned long flag) /* * returntext is always at least SLAPI_DSE_RETURNTEXT_SIZE bytes in size. */ -int +int read_schema_dse( Slapi_PBlock *pb, Slapi_Entry *pschema_info_e, - Slapi_Entry *entryAfter, + Slapi_Entry *entryAfter __attribute__((unused)), int *returncode, - char *returntext /* not used */, - void *arg /* not used */ ) + char *returntext __attribute__((unused)), + void *arg __attribute__((unused))) { struct berval val; struct berval *vals[2]; @@ -2045,7 +2051,7 @@ mod_free(LDAPMod *mod) * returntext is always at least SLAPI_DSE_RETURNTEXT_SIZE bytes in size. */ int -modify_schema_dse (Slapi_PBlock *pb, Slapi_Entry *entryBefore, Slapi_Entry *entryAfter, int *returncode, char *returntext, void *arg) +modify_schema_dse (Slapi_PBlock *pb, Slapi_Entry *entryBefore, Slapi_Entry *entryAfter, int *returncode, char *returntext, void *arg __attribute__((unused))) { int i, rc= SLAPI_DSE_CALLBACK_OK; /* default is to apply changes to the DSE */ char *schema_dse_attr_name; @@ -2407,7 +2413,12 @@ dup_global_schema_csn() * returntext is always at least SLAPI_DSE_RETURNTEXT_SIZE bytes in size. */ static int -refresh_user_defined_schema( Slapi_PBlock *pb, Slapi_Entry *pschema_info_e, Slapi_Entry *entryAfter, int *returncode, char *returntext, void *arg /* not used */ ) +refresh_user_defined_schema( Slapi_PBlock *pb, + Slapi_Entry *pschema_info_e, + Slapi_Entry *entryAfter __attribute__((unused)), + int *returncode, + char *returntext, + void *arg __attribute__((unused)) ) { int rc; Slapi_PBlock *mypbptr = pb; @@ -2471,10 +2482,14 @@ oc_add_nolock(struct objclass *newoc) * responsibility. */ static int -schema_delete_objectclasses( Slapi_Entry *entryBefore, LDAPMod *mod, - char *errorbuf, size_t errorbufsize, int schema_ds4x_compat, int is_internal_operation) +schema_delete_objectclasses( Slapi_Entry *entryBefore __attribute__((unused)), + LDAPMod *mod, + char *errorbuf, + size_t errorbufsize, + int schema_ds4x_compat, + int is_internal_operation) { - int i; + size_t i; int rc = LDAP_SUCCESS; /* optimistic */ struct objclass *poc, *poc2, *delete_oc = NULL; @@ -2584,13 +2599,15 @@ schema_return(int rc,struct sizedbuffer * psb1,struct sizedbuffer *psb2,struct s * responsibility. */ static int -schema_delete_attributes ( Slapi_Entry *entryBefore, LDAPMod *mod, +schema_delete_attributes ( Slapi_Entry *entryBefore __attribute__((unused)), LDAPMod *mod, char *errorbuf, size_t errorbufsize, int is_internal_operation) { char *attr_ldif, *oc_list_type = ""; asyntaxinfo *a; struct objclass *oc = NULL; - int i, k, attr_in_use_by_an_oc = 0; + size_t i = 0; + size_t k = 0; + int attr_in_use_by_an_oc = 0; struct sizedbuffer *psbAttrName= sizedbuffer_construct(BUFSIZ); struct sizedbuffer *psbAttrOid= sizedbuffer_construct(BUFSIZ); struct sizedbuffer *psbAttrSyntax= sizedbuffer_construct(BUFSIZ); @@ -4112,7 +4129,7 @@ read_at_ldif(const char *input, struct asyntaxinfo **asipp, char *errorbuf, static int parse_attr_str(const char *input, struct asyntaxinfo **asipp, char *errorbuf, size_t errorbufsize, PRUint32 schema_flags, int is_user_defined, - int schema_ds4x_compat, int is_remote) + int schema_ds4x_compat, int is_remote __attribute__((unused))) { struct asyntaxinfo *tmpasip; struct asyntaxinfo *tmpasi; @@ -4855,10 +4872,9 @@ schema_check_oc_attrs ( struct objclass *poc, */ static int -schema_check_name(char *name, PRBool isAttribute, char *errorbuf, - size_t errorbufsize ) +schema_check_name(char *name, PRBool isAttribute __attribute__((unused)), char *errorbuf, size_t errorbufsize ) { - int i; + size_t i = 0; /* allowed characters */ static char allowed[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-"; @@ -5121,7 +5137,7 @@ stripOption(char *attr) { * returntext is always at least SLAPI_DSE_RETURNTEXT_SIZE bytes in size. */ int -load_schema_dse(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *ignored, +load_schema_dse(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *ignored __attribute__((unused)), int *returncode, char *returntext, void *arg) { Slapi_Attr *attr = 0; @@ -6885,11 +6901,12 @@ schema_at_superset_check(struct asyntaxinfo *at_list1, struct asyntaxinfo *at_li * the matching rules should not be overwritten, even if one should, we can not allow it. */ static int -schema_at_superset_check_mr(struct asyntaxinfo *a1, struct asyntaxinfo *a2, char *info) +schema_at_superset_check_mr(struct asyntaxinfo *a1, struct asyntaxinfo *a2, char *info __attribute__((unused))) { char *a1_mrtype[3] = { a1->asi_mr_equality, a1->asi_mr_substring, a1->asi_mr_ordering }; char *a2_mrtype[3] = { a2->asi_mr_equality, a2->asi_mr_substring, a2->asi_mr_ordering }; - int rc = 0, i; + int rc = 0; + size_t i = 0; /* * Loop over the three matching rule types diff --git a/ldap/servers/slapd/snmp_collator.c b/ldap/servers/slapd/snmp_collator.c index b0c873d..ab30a8f 100644 --- a/ldap/servers/slapd/snmp_collator.c +++ b/ldap/servers/slapd/snmp_collator.c @@ -535,7 +535,7 @@ snmp_collator_sem_wait(void) ************************************************************************************/ void -snmp_collator_update(time_t start_time, void *arg) +snmp_collator_update(time_t start_time __attribute__((unused)), void *arg __attribute__((unused))) { if (snmp_collator_stopped) { return; diff --git a/ldap/servers/slapd/ssl.c b/ldap/servers/slapd/ssl.c index 050e7b5..f3d8f96 100644 --- a/ldap/servers/slapd/ssl.c +++ b/ldap/servers/slapd/ssl.c @@ -1187,7 +1187,7 @@ restrict_SSLVersionRange(void) * we do not need a prefix any more. */ int -slapd_nss_init(int init_ssl, int config_available) +slapd_nss_init(int init_ssl __attribute__((unused)), int config_available __attribute__((unused))) { SECStatus secStatus; PRErrorCode errorCode; @@ -2663,8 +2663,8 @@ typedef struct { } secuPWData; static SECStatus -listCerts(CERTCertDBHandle *handle, CERTCertificate *cert, PK11SlotInfo *slot, - PRFileDesc *outfile, void *pwarg) +listCerts(CERTCertDBHandle *handle, CERTCertificate *cert, PK11SlotInfo *slot __attribute__((unused)), + PRFileDesc *outfile, void *pwarg __attribute__((unused))) { SECItem data; SECStatus rv = SECFailure; @@ -2950,7 +2950,7 @@ bail: */ SECStatus DecryptKey( SECKEYEncryptedPrivateKeyInfo *epki, - SECOidTag algTag, + SECOidTag algTag __attribute__((unused)), SECItem *pwitem, secuPWData *pwdata, SECItem *derPKI) @@ -3023,7 +3023,7 @@ SECStatus DecryptKey( /* #define ENCRYPTEDKEY 1 */ #define RAND_PASS_LEN 32 static int -slapd_extract_key(Slapi_Entry *entry, char *token, PK11SlotInfo *slot) +slapd_extract_key(Slapi_Entry *entry, char *token __attribute__((unused)), PK11SlotInfo *slot) { char *KeyExtractFile = NULL; char *personality = NULL; diff --git a/ldap/servers/slapd/start_tls_extop.c b/ldap/servers/slapd/start_tls_extop.c index 413aa24..a80cd6f 100644 --- a/ldap/servers/slapd/start_tls_extop.c +++ b/ldap/servers/slapd/start_tls_extop.c @@ -40,7 +40,7 @@ Slapi_PluginDesc exopdesc = { "start_tls_plugin", VENDOR, DS_PACKAGE_VERSION, "Start TLS extended operation plugin" }; static int -start_tls_io_enable(Connection *c, void *data /* UNUSED */) +start_tls_io_enable(Connection *c, void *data __attribute__((unused))) { int secure = 1; PRFileDesc *newsocket; diff --git a/ldap/servers/slapd/str2filter.c b/ldap/servers/slapd/str2filter.c index 744c93f..5edbf0e 100644 --- a/ldap/servers/slapd/str2filter.c +++ b/ldap/servers/slapd/str2filter.c @@ -311,6 +311,7 @@ str2simple( char *str , int unescape_filter) struct slapi_filter *f; char *s; char *value, savechar; + char *extp = NULL; slapi_log_err(SLAPI_LOG_FILTER, "str2simple", "\"%s\"\n", str); @@ -326,7 +327,6 @@ str2simple( char *str , int unescape_filter) f = (struct slapi_filter *) slapi_ch_calloc( 1, sizeof(struct slapi_filter) ); switch ( *s ) { - char *extp = NULL; case '<': f->f_choice = LDAP_FILTER_LE; break; diff --git a/ldap/servers/slapd/stubs.c b/ldap/servers/slapd/stubs.c index c527911..a0e86ac 100644 --- a/ldap/servers/slapd/stubs.c +++ b/ldap/servers/slapd/stubs.c @@ -17,17 +17,17 @@ #include "slap.h" -int type_to_ACCESS_bit( char *p ) +int type_to_ACCESS_bit( char *p __attribute__((unused))) { return 0; } -void *PT_Lock( PRLock *x_mutex ) +void *PT_Lock( PRLock *x_mutex __attribute__((unused))) { return NULL; } -int lcache_init(LDAP *ld, void *arg) +int lcache_init(LDAP *ld __attribute__((unused)), void *arg __attribute__((unused))) { slapi_log_err(SLAPI_LOG_ERR, "lcache_init", "Shouldn't have been called\n"); diff --git a/ldap/servers/slapd/task.c b/ldap/servers/slapd/task.c index eabd517..b5a4c95 100644 --- a/ldap/servers/slapd/task.c +++ b/ldap/servers/slapd/task.c @@ -762,8 +762,12 @@ static void task_generic_destructor(Slapi_Task *task) /********** actual task callbacks **********/ -static int task_deny(Slapi_PBlock *pb, Slapi_Entry *e, - Slapi_Entry *eAfter, int *returncode, char *returntext, void *arg) +static int task_deny(Slapi_PBlock *pb, + Slapi_Entry *e __attribute__((unused)), + Slapi_Entry *eAfter __attribute__((unused)), + int *returncode, + char *returntext __attribute__((unused)), + void *arg __attribute__((unused))) { /* internal operations (conn=NULL) are allowed to do whatever they want */ if (pb->pb_conn == NULL) { @@ -775,8 +779,12 @@ static int task_deny(Slapi_PBlock *pb, Slapi_Entry *e, return SLAPI_DSE_CALLBACK_ERROR; } -static int task_modify(Slapi_PBlock *pb, Slapi_Entry *e, - Slapi_Entry *eAfter, int *returncode, char *returntext, void *arg) +static int task_modify(Slapi_PBlock *pb, + Slapi_Entry *e __attribute__((unused)), + Slapi_Entry *eAfter, + int *returncode, + char *returntext __attribute__((unused)), + void *arg) { Slapi_Task *task = (Slapi_Task *)arg; LDAPMod **mods; @@ -823,8 +831,12 @@ static int task_modify(Slapi_PBlock *pb, Slapi_Entry *e, return SLAPI_DSE_CALLBACK_OK; } -static int task_import_add(Slapi_PBlock *pb, Slapi_Entry *e, - Slapi_Entry *eAfter, int *returncode, char *returntext, void *arg) +static int task_import_add(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry *e, + Slapi_Entry *eAfter __attribute__((unused)), + int *returncode, + char *returntext __attribute__((unused)), + void *arg __attribute__((unused))) { Slapi_Attr *attr; Slapi_Value *val = NULL; @@ -1121,8 +1133,12 @@ static void task_export_thread(void *arg) g_decr_active_threadcnt(); } -static int task_export_add(Slapi_PBlock *pb, Slapi_Entry *e, - Slapi_Entry *eAfter, int *returncode, char *returntext, void *arg) +static int task_export_add(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry *e, + Slapi_Entry *eAfter __attribute__((unused)), + int *returncode, + char *returntext __attribute__((unused)), + void *arg __attribute__((unused))) { Slapi_Attr *attr; Slapi_Value *val = NULL; @@ -1394,8 +1410,12 @@ static void task_backup_thread(void *arg) g_decr_active_threadcnt(); } -static int task_backup_add(Slapi_PBlock *pb, Slapi_Entry *e, - Slapi_Entry *eAfter, int *returncode, char *returntext, void *arg) +static int task_backup_add(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry *e, + Slapi_Entry *eAfter __attribute__((unused)), + int *returncode, + char *returntext __attribute__((unused)), + void *arg __attribute__((unused))) { Slapi_Backend *be = NULL; PRThread *thread = NULL; @@ -1530,8 +1550,12 @@ static void task_restore_thread(void *arg) g_decr_active_threadcnt(); } -static int task_restore_add(Slapi_PBlock *pb, Slapi_Entry *e, - Slapi_Entry *eAfter, int *returncode, char *returntext, void *arg) +static int task_restore_add(Slapi_PBlock *pb, + Slapi_Entry *e, + Slapi_Entry *eAfter __attribute__((unused)), + int *returncode, + char *returntext __attribute__((unused)), + void *arg __attribute__((unused))) { Slapi_Backend *be = NULL; const char *instance_name = NULL; @@ -1665,8 +1689,12 @@ static void task_index_thread(void *arg) g_decr_active_threadcnt(); } -static int task_index_add(Slapi_PBlock *pb, Slapi_Entry *e, - Slapi_Entry *eAfter, int *returncode, char *returntext, void *arg) +static int task_index_add(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry *e, + Slapi_Entry *eAfter __attribute__((unused)), + int *returncode, + char *returntext __attribute__((unused)), + void *arg __attribute__((unused))) { const char *instance_name; int rv = SLAPI_DSE_CALLBACK_OK; @@ -1788,8 +1816,12 @@ out: } static int -task_upgradedb_add(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter, - int *returncode, char *returntext, void *arg) +task_upgradedb_add(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry *e, + Slapi_Entry *eAfter __attribute__((unused)), + int *returncode, + char *returntext __attribute__((unused)), + void *arg __attribute__((unused))) { int rv = SLAPI_DSE_CALLBACK_OK; Slapi_Backend *be = NULL; @@ -1912,8 +1944,12 @@ out: * unsetenv VARIABLE */ static int -task_sysconfig_reload_add(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter, int *returncode, - char *returntext, void *arg) +task_sysconfig_reload_add(Slapi_PBlock *pb __attribute__((unused)), + Slapi_Entry *e, + Slapi_Entry *eAfter __attribute__((unused)), + int *returncode, + char *returntext, + void *arg __attribute__((unused))) { FILE *file = NULL; char *filename = NULL; @@ -2083,7 +2119,7 @@ done: * Add the nsTombstoneCSN attribute/value to the entry. */ static int -fixup_tombstone(Slapi_PBlock *pb, char *suffix, Slapi_Entry *e, int *fixup_count) +fixup_tombstone(Slapi_PBlock *pb, char *suffix __attribute__((unused)), Slapi_Entry *e, int *fixup_count) { LDAPMod mod; LDAPMod *mods[2]; @@ -2129,7 +2165,7 @@ fixup_tombstone(Slapi_PBlock *pb, char *suffix, Slapi_Entry *e, int *fixup_count * solely for testing the fixup task. */ static void -strip_tombstone(Slapi_PBlock *pb, char *suffix, Slapi_Entry *e, int *strip_count) +strip_tombstone(Slapi_PBlock *pb, char *suffix __attribute__((unused)), Slapi_Entry *e, int *strip_count) { LDAPMod mod; LDAPMod *mods[2]; @@ -2287,8 +2323,12 @@ bail: * then run task, without the strip option, to add "nsTombstoneCSN" back. */ static int -task_fixup_tombstones_add(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter, - int *returncode, char *returntext, void *arg) +task_fixup_tombstones_add(Slapi_PBlock *pb, + Slapi_Entry *e, + Slapi_Entry *eAfter __attribute__((unused)), + int *returncode, + char *returntext, + void *arg __attribute__((unused))) { Slapi_Backend *be = NULL; Slapi_Task *task = NULL; @@ -2440,8 +2480,12 @@ struct task_des2aes_data }; static int -task_des2aes(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter, - int *returncode, char *returntext, void *arg) +task_des2aes(Slapi_PBlock *pb, + Slapi_Entry *e, + Slapi_Entry *eAfter __attribute__((unused)), + int *returncode, + char *returntext, + void *arg __attribute__((unused))) { struct task_des2aes_data *task_data = NULL; PRThread *thread = NULL; diff --git a/ldap/servers/slapd/time.c b/ldap/servers/slapd/time.c index db17bab..16467af 100644 --- a/ldap/servers/slapd/time.c +++ b/ldap/servers/slapd/time.c @@ -179,7 +179,7 @@ time_plus_sec (time_t l, long r) * \return int success - 0 on correct format, >= 1 on error. */ int -format_localTime_log(time_t t, int initsize, char *buf, int *bufsize) +format_localTime_log(time_t t, int initsize __attribute__((unused)), char *buf, int *bufsize) { long tz; @@ -231,7 +231,7 @@ format_localTime_log(time_t t, int initsize, char *buf, int *bufsize) * \return int success - 0 on correct format, >= 1 on error. */ int -format_localTime_hr_log(time_t t, long nsec, int initsize, char *buf, int *bufsize) +format_localTime_hr_log(time_t t, long nsec, int initsize __attribute__((unused)), char *buf, int *bufsize) { long tz; diff --git a/ldap/servers/slapd/tools/dbscan.c b/ldap/servers/slapd/tools/dbscan.c index 33252b8..35c5f34 100644 --- a/ldap/servers/slapd/tools/dbscan.c +++ b/ldap/servers/slapd/tools/dbscan.c @@ -492,7 +492,7 @@ width of long (32-bit or 64-bit), it's stored using 4bytes by the server [153306 <0 byte modop><4 byte value count> <4 byte value size><4 byte value size> */ -void print_changelog(unsigned char *data, int len) +void print_changelog(unsigned char *data, int len __attribute__((unused))) { uint8_t version; unsigned long operation_type; @@ -766,7 +766,7 @@ _entryrdn_dump_rdn_elem(char *key, rdn_elem *elem, int indent) } static void -display_entryrdn_self(DB *db, ID id, const char *nrdn, int indent) +display_entryrdn_self(DB *db, ID id, const char *nrdn __attribute__((unused)), int indent) { DBC *cursor = NULL; DBT key, data; @@ -810,7 +810,7 @@ bail: } static void -display_entryrdn_parent(DB *db, ID id, const char *nrdn, int indent) +display_entryrdn_parent(DB *db, ID id, const char *nrdn __attribute__((unused)), int indent) { DBC *cursor = NULL; DBT key, data; @@ -850,7 +850,7 @@ bail: } static void -display_entryrdn_children(DB *db, ID id, const char *nrdn, int indent) +display_entryrdn_children(DB *db, ID id, const char *nrdn __attribute__((unused)), int indent) { DBC *cursor = NULL; DBT key, data; diff --git a/ldap/servers/slapd/tools/ldaptool-sasl.c b/ldap/servers/slapd/tools/ldaptool-sasl.c index 444a23a..7c0dbb9 100755 --- a/ldap/servers/slapd/tools/ldaptool-sasl.c +++ b/ldap/servers/slapd/tools/ldaptool-sasl.c @@ -149,7 +149,7 @@ ldaptool_free_defaults( void *defaults ) { } int -ldaptool_sasl_interact( LDAP *ld, unsigned flags, void *defaults, void *prompts ) { +ldaptool_sasl_interact( LDAP *ld __attribute__((unused)), unsigned flags, void *defaults, void *prompts ) { sasl_interact_t *interact = NULL; ldaptoolSASLdefaults *sasldefaults = defaults; int rc; @@ -176,7 +176,7 @@ ldaptool_sasl_interact( LDAP *ld, unsigned flags, void *defaults, void *prompts } static int -get_default(ldaptoolSASLdefaults *defaults, sasl_interact_t *interact, unsigned flags) { +get_default(ldaptoolSASLdefaults *defaults, sasl_interact_t *interact, unsigned flags __attribute__((unused))) { const char *defvalue = interact->defresult; if (defaults != NULL) { @@ -215,7 +215,7 @@ get_default(ldaptoolSASLdefaults *defaults, sasl_interact_t *interact, unsigned * value. */ static int -get_new_value(sasl_interact_t *interact, unsigned flags) { +get_new_value(sasl_interact_t *interact, unsigned flags __attribute__((unused))) { char *newvalue = NULL, str[1024]; int len = 0; diff --git a/ldap/servers/slapd/tools/ldclt/ldapfct.c b/ldap/servers/slapd/tools/ldclt/ldapfct.c index c1de555..bf9ce1b 100644 --- a/ldap/servers/slapd/tools/ldclt/ldapfct.c +++ b/ldap/servers/slapd/tools/ldclt/ldapfct.c @@ -244,9 +244,9 @@ buildNewBindDN ( int refRebindProc( LDAP *ldapCtx, - const char *url, - ber_tag_t request, - ber_int_t msgid, + const char *url __attribute__((unused)), + ber_tag_t request __attribute__((unused)), + ber_int_t msgid __attribute__((unused)), void *arg ) { @@ -377,14 +377,14 @@ ldclt_dirname(const char *path) { } static char * -ldclt_get_sec_pwd(PK11SlotInfo *slot, PRBool retry, void *arg) +ldclt_get_sec_pwd(PK11SlotInfo *slot __attribute__((unused)), PRBool retry __attribute__((unused)), void *arg) { char *pwd = (char *)arg; return PL_strdup(pwd); } static int -ldclt_clientauth(thread_context *tttctx, LDAP *ld, const char *path, const char *certname, const char *pwd) +ldclt_clientauth(thread_context *tttctx, LDAP *ld, const char *path __attribute__((unused)), const char *certname, const char *pwd) { const char *colon = NULL; char *token_name = NULL; @@ -4044,7 +4044,7 @@ ldclt_build_control( char *oid, BerElement *ber, int freeber, char iscritical, * returns an LDAP error code and also sets error inside LDAP */ int -ldclt_alloc_ber( LDAP *ld, BerElement **berp ) +ldclt_alloc_ber( LDAP *ld __attribute__((unused)), BerElement **berp ) { int err; int beropt; diff --git a/ldap/servers/slapd/tools/ldclt/ldclt.c b/ldap/servers/slapd/tools/ldclt/ldclt.c index 126108c..a1fa0be 100644 --- a/ldap/servers/slapd/tools/ldclt/ldclt.c +++ b/ldap/servers/slapd/tools/ldclt/ldclt.c @@ -834,8 +834,8 @@ printGlobalStatistics (void) void trapVector ( int sig, - siginfo_t *siginfo, - void *truc) + siginfo_t *siginfo __attribute__((unused)), + void *truc __attribute__((unused))) { printf ("\n"); /* Jump over the ^C or ^\ */ (void) printGlobalStatistics(); diff --git a/ldap/servers/slapd/tools/ldclt/scalab01.c b/ldap/servers/slapd/tools/ldclt/scalab01.c index bfa4ccf..e5dce4f 100644 --- a/ldap/servers/slapd/tools/ldclt/scalab01.c +++ b/ldap/servers/slapd/tools/ldclt/scalab01.c @@ -744,7 +744,7 @@ scalab01_unlock ( *****************************************************************************/ void * scalab01_control ( - void *arg) + void *arg __attribute__((unused))) { isp_user *cur; /* Current entry */ isp_user *head; /* Head of entries to process */ diff --git a/ldap/servers/slapd/tools/ldclt/workarounds.c b/ldap/servers/slapd/tools/ldclt/workarounds.c index 5b36078..1890875 100644 --- a/ldap/servers/slapd/tools/ldclt/workarounds.c +++ b/ldap/servers/slapd/tools/ldclt/workarounds.c @@ -66,8 +66,14 @@ dd/mm/yy | Author | Comments DESCRIPTION : *****************************************************************************/ int getFdFromLdapSession ( +#ifdef SOLARIS_LIBLDAP LDAP *ld, - int *fd) + int *fd +#else + LDAP *ld __attribute__((unused)), + int *fd __attribute__((unused)) +#endif +) { #ifdef SOLARIS_LIBLDAP /*JLS 19-09-00*/ *fd = ld->ld_sb.sb_sd; diff --git a/ldap/servers/slapd/tools/mmldif.c b/ldap/servers/slapd/tools/mmldif.c index ea4ab91..03278f3 100644 --- a/ldap/servers/slapd/tools/mmldif.c +++ b/ldap/servers/slapd/tools/mmldif.c @@ -884,7 +884,7 @@ freefreelist(attrib1_t * freelist) } static void -hashname(char seed, attrib1_t * attrib, char * hashkey) +hashname(char _seed, attrib1_t * attrib, char * hashkey) { MM_VSTRING upper; PK11Context *context; @@ -897,7 +897,7 @@ hashname(char seed, attrib1_t * attrib, char * hashkey) context = PK11_CreateDigestContext(SEC_OID_MD5); if (context != NULL) { PK11_DigestBegin(context); - PK11_DigestOp(context, (unsigned char *)&seed, 1); + PK11_DigestOp(context, (unsigned char *)&_seed, 1); PK11_DigestOp(context, (unsigned char *)upper.body, upper.length); PK11_DigestOp(context, (unsigned char *)"=", 1); if (!memcmp(upper.body, "DN", 2)) { @@ -915,7 +915,7 @@ hashname(char seed, attrib1_t * attrib, char * hashkey) /* this creates a hash key base on all but the first line in attrib */ static void -hashvalue(char seed, attrib1_t * attrib, char * fingerprint) +hashvalue(char _seed, attrib1_t * attrib, char * fingerprint) { MM_VSTRING upper; attrib1_t * a; @@ -925,7 +925,7 @@ hashvalue(char seed, attrib1_t * attrib, char * fingerprint) context = PK11_CreateDigestContext(SEC_OID_MD5); if (context != NULL) { PK11_DigestBegin(context); - PK11_DigestOp(context, (unsigned char *)&seed, 1); + PK11_DigestOp(context, (unsigned char *)&_seed, 1); for (a = attrib->next; a; a = a->next) { if (!stricmp(a->name, "authoritative")) continue; @@ -1204,13 +1204,13 @@ putvalue( { Enc64_t * b64 = NULL; char * lptr; - char line[255]; + char _line[255]; int return_code; int len; char * sptr; int rc; - lptr = line; + lptr = _line; if (tag != NULL) { sprintf(lptr, "%s: ", tag); lptr += strlen(lptr); @@ -1226,41 +1226,41 @@ putvalue( if (!valuelen) { *lptr = '\n'; *(lptr+1) = 0; - return_code = fputs(line, fh); + return_code = fputs(_line, fh); goto return_bit; } if (simpletext((unsigned char *)value, valuelen)) { *lptr = ' '; - if (valuelen + (lptr+1 - line) < 80) { + if (valuelen + (lptr+1 - _line) < 80) { strcpy(lptr+1, value); strcpy(lptr+1 + valuelen, "\n"); - return_code = fputs(line, fh); + return_code = fputs(_line, fh); goto return_bit; } - len = 80 - (lptr+1 - line); + len = 80 - (lptr+1 - _line); memcpy(lptr+1, value, len); - line[80] = '\n'; - line[81] = 0; - return_code = fputs(line, fh); + _line[80] = '\n'; + _line[81] = 0; + return_code = fputs(_line, fh); if (return_code < 0) goto return_bit; sptr = value + len; len = valuelen - len; - line[0] = ' '; + _line[0] = ' '; while (len > 79) { - memcpy(line+1, sptr, 79); - return_code = fputs(line, fh); + memcpy(_line+1, sptr, 79); + return_code = fputs(_line, fh); if (return_code < 0) goto return_bit; sptr += 79; len -= 79; } if (len) { - memcpy(line+1, sptr, len); - line[len+1] = '\n'; - line[len+2] = 0; - return_code = fputs(line, fh); + memcpy(_line+1, sptr, len); + _line[len+1] = '\n'; + _line[len+2] = 0; + return_code = fputs(_line, fh); } goto return_bit; } @@ -1268,20 +1268,20 @@ putvalue( b64 = initEnc64((unsigned char *)value, valuelen); *lptr = ':'; *(lptr+1) = ' '; - Enc64(b64, (unsigned char *)(lptr+2), 80-(lptr-line), &len); + Enc64(b64, (unsigned char *)(lptr+2), 80-(lptr-_line), &len); *(lptr+len+2) = '\n'; *(lptr+len+3) = 0; - return_code = fputs(line, fh); + return_code = fputs(_line, fh); if (return_code < 0) goto return_bit; while (TRUE) { - line[0] = ' '; - rc = Enc64(b64, (unsigned char *)line+1, 79, &len); + _line[0] = ' '; + rc = Enc64(b64, (unsigned char *)_line+1, 79, &len); if (rc) break; - line[len+1] = '\n'; - line[len+2] = 0; - return_code = fputs(line, fh); + _line[len+1] = '\n'; + _line[len+2] = 0; + return_code = fputs(_line, fh); if (return_code < 0) goto return_bit; } diff --git a/ldap/servers/slapd/tools/rsearch/addthread.c b/ldap/servers/slapd/tools/rsearch/addthread.c index 4f3a6e2..76a6cc0 100644 --- a/ldap/servers/slapd/tools/rsearch/addthread.c +++ b/ldap/servers/slapd/tools/rsearch/addthread.c @@ -239,7 +239,7 @@ static int at_add(AddThread *at) attr_audio, attr_password; struct berval audio_berval; struct berval *audio_values[2]; - char dn[100], uid[10], telno[20], *sn, *givenname, cn[50], mail[50]; + char dn[100], uid[22], telno[20], *sn, *givenname, cn[50], mail[50]; char *cn_values[2], *sn_values[2], *givenname_values[2]; char *uid_values[2], *mail_values[2], *telno_values[2]; #if 1 diff --git a/ldap/servers/slapd/uuid.c b/ldap/servers/slapd/uuid.c index 96b4c26..effd864 100644 --- a/ldap/servers/slapd/uuid.c +++ b/ldap/servers/slapd/uuid.c @@ -351,7 +351,7 @@ static int uuid_create_mt(guid_t *uuid) /* uuid_update_state -- called periodically to update generator's state (multithreaded case only) */ -static void uuid_update_state (time_t when, void *arg) +static void uuid_update_state (time_t when __attribute__((unused)), void *arg __attribute__((unused))) { uuid_time_t timestamp; diff --git a/ldap/servers/slapd/vattr.c b/ldap/servers/slapd/vattr.c index ef4d7f2..9109433 100644 --- a/ldap/servers/slapd/vattr.c +++ b/ldap/servers/slapd/vattr.c @@ -1555,7 +1555,7 @@ int slapi_vattrspi_register_ex(vattr_sp_handle **h, vattr_get_ex_fn_type get_fn, } /* options not used yet - for future expansion */ -int slapi_vattrspi_register_internal(vattr_sp_handle **h, vattr_get_fn_type get_fn, vattr_get_ex_fn_type get_ex_fn, vattr_compare_fn_type compare_fn, vattr_types_fn_type types_fn, void *options) +int slapi_vattrspi_register_internal(vattr_sp_handle **h, vattr_get_fn_type get_fn, vattr_get_ex_fn_type get_ex_fn, vattr_compare_fn_type compare_fn, vattr_types_fn_type types_fn, void *options __attribute__((unused))) { vattr_sp_handle *return_to_caller = NULL; vattr_sp_handle *list_handle = NULL; @@ -1659,16 +1659,17 @@ int slapi_vattrspi_regattr(vattr_sp_handle *h,char *type_name_to_register, char* /* Functions to handle the context stucture */ -int slapi_vattr_context_create(vattr_context **c) +int slapi_vattr_context_create(vattr_context **c __attribute__((unused))) { return 0; } -void slapi_vattr_context_destroy(vattr_context *c) +void slapi_vattr_context_destroy(vattr_context *c __attribute__((unused))) { + return; } -int vattr_call_sp_get_value(vattr_sp_handle *handle, vattr_context *c, Slapi_Entry *e, vattr_get_thang *my_get, char *type, Slapi_ValueSet** results,int *type_name_disposition, char** actual_type_name, int flags, int *buffer_flags, void* hint) +int vattr_call_sp_get_value(vattr_sp_handle *handle, vattr_context *c, Slapi_Entry *e, vattr_get_thang *my_get __attribute__((unused)), char *type, Slapi_ValueSet** results,int *type_name_disposition, char** actual_type_name, int flags, int *buffer_flags, void* hint) { int ret = -1; @@ -1680,7 +1681,7 @@ int vattr_call_sp_get_value(vattr_sp_handle *handle, vattr_context *c, Slapi_Ent return ret; } -int vattr_call_sp_get_batch_values(vattr_sp_handle *handle, vattr_context *c, Slapi_Entry *e, vattr_get_thang *my_get, char **type, Slapi_ValueSet*** results,int **type_name_disposition, char*** actual_type_name, int flags, int *buffer_flags, void** hint) +int vattr_call_sp_get_batch_values(vattr_sp_handle *handle, vattr_context *c, Slapi_Entry *e, vattr_get_thang *my_get __attribute__((unused)), char **type, Slapi_ValueSet*** results,int **type_name_disposition, char*** actual_type_name, int flags, int *buffer_flags, void** hint) { int ret = 0; @@ -1707,7 +1708,7 @@ int vattr_call_sp_get_batch_values(vattr_sp_handle *handle, vattr_context *c, Sl return ret; } -int vattr_call_sp_compare_value(vattr_sp_handle *handle, vattr_context *c, Slapi_Entry *e, vattr_get_thang *my_get, const char *type, Slapi_Value* test_this,int *result, int flags, void* hint) +int vattr_call_sp_compare_value(vattr_sp_handle *handle, vattr_context *c, Slapi_Entry *e, vattr_get_thang *my_get __attribute__((unused)), const char *type, Slapi_Value* test_this,int *result, int flags, void* hint) { return ((handle->sp->sp_compare_fn)(handle,c,e,(char*)type,test_this,result,flags, hint)); } @@ -1850,7 +1851,7 @@ void vattr_map_entry_free(vattr_map_entry *vae) { } static PRIntn -vattr_he_cleanup_fn(PLHashEntry *he, PRIntn index, void *arg) { +vattr_he_cleanup_fn(PLHashEntry *he, PRIntn index __attribute__((unused)), void *arg __attribute__((unused))) { vattr_map_entry_free((vattr_map_entry *)he->value); he->value = NULL; return HT_ENUMERATE_NEXT; @@ -2055,7 +2056,7 @@ objAttrValue *vattr_map_entry_build_schema(char *type_name) return ret; } -static PRIntn vattr_map_entry_rebuild_schema(PLHashEntry *he, PRIntn i, void *arg) +static PRIntn vattr_map_entry_rebuild_schema(PLHashEntry *he, PRIntn i __attribute__((unused)), void *arg __attribute__((unused))) { vattr_map_entry *entry = (vattr_map_entry *)(he->value); @@ -2067,7 +2068,11 @@ static PRIntn vattr_map_entry_rebuild_schema(PLHashEntry *he, PRIntn i, void *ar return HT_ENUMERATE_NEXT; } -void schema_changed_callback(Slapi_Entry *e, char *dn, int modtype, Slapi_PBlock *pb, void *caller_data) +void schema_changed_callback(Slapi_Entry *e __attribute__((unused)), + char *dn __attribute__((unused)), + int modtype __attribute__((unused)), + Slapi_PBlock *pb __attribute__((unused)), + void *caller_data __attribute__((unused))) { /* Get the writer lock */ slapi_rwlock_wrlock(the_map->lock); diff --git a/ldap/servers/snmp/ldap-agent.c b/ldap/servers/snmp/ldap-agent.c index c77b4bd..9868782 100644 --- a/ldap/servers/snmp/ldap-agent.c +++ b/ldap/servers/snmp/ldap-agent.c @@ -249,7 +249,7 @@ stats_table_find_row(unsigned long portnum) * be sent here. */ int -load_stats_table(netsnmp_cache *cache, void *foo) +load_stats_table(netsnmp_cache *cache __attribute__((unused)), void *foo __attribute__((unused))) { server_instance *serv_p = NULL; stats_table_context *ctx = NULL; @@ -379,7 +379,7 @@ load_stats_table(netsnmp_cache *cache, void *foo) * function for freeing the cache, so here it is. */ void -free_stats_table(netsnmp_cache *cache, void *foo) +free_stats_table(netsnmp_cache *cache __attribute__((unused)), void *foo __attribute__((unused))) { return; } diff --git a/ldap/systools/idsktune.c b/ldap/systools/idsktune.c index c171c95..1c87967 100644 --- a/ldap/systools/idsktune.c +++ b/ldap/systools/idsktune.c @@ -615,7 +615,7 @@ void sun_check_mu(void) #endif -int check_memsize(char *a,char *b) +int check_memsize(char *a __attribute__((unused)),char *b) { char *rp; int mult = 1; @@ -645,7 +645,7 @@ int check_memsize(char *a,char *b) return 0; } -int check_swapsize(char *a,char *b) +int check_swapsize(char *a __attribute__((unused)),char *b) { char *rp,*kp; int used, avail; @@ -2376,7 +2376,7 @@ static int check_fs_options(char *reqdir,char mntbuf[MAXPATHLEN]) #endif } -static void check_disk_quota(char mntbuf[MAXPATHLEN]) +static void check_disk_quota(char mntbuf[MAXPATHLEN] __attribute__((unused))) { #if defined(__sun) char qfname[MAXPATHLEN]; diff --git a/lib/ldaputil/cert.c b/lib/ldaputil/cert.c index aca4f98..c4cf1ce 100644 --- a/lib/ldaputil/cert.c +++ b/lib/ldaputil/cert.c @@ -31,7 +31,7 @@ #include "slapi-plugin.h" -NSAPI_PUBLIC int ldapu_get_cert (void *SSLendpoint, void **cert) +NSAPI_PUBLIC int ldapu_get_cert (void *SSLendpoint __attribute__((unused)), void **cert __attribute__((unused))) { /* TEMPORARY -- not implemented yet*/ return LDAPU_FAILED; diff --git a/lib/ldaputil/certmap.c b/lib/ldaputil/certmap.c index 5f28b8c..c633031 100644 --- a/lib/ldaputil/certmap.c +++ b/lib/ldaputil/certmap.c @@ -369,7 +369,8 @@ static int ldapu_binary_cmp_certs (void *subject_cert, static int ldapu_cert_verifyfn_default (void *subject_cert, LDAP *ld, - void *certmap_info, LDAPMessage *res, + void *certmap_info __attribute__((unused)), + LDAPMessage *res, LDAPMessage **entry_out) { LDAPMessage *entry; @@ -956,7 +957,7 @@ NSAPI_PUBLIC int ldapu_free_cert_ava_val (char **val) return LDAPU_SUCCESS; } -static int ldapu_cert_mapfn_default (void *cert_in, LDAP *ld, +static int ldapu_cert_mapfn_default (void *cert_in, LDAP *ld __attribute__((unused)), void *certmap_info_in, char **ldapDN_out, char **filter_out) { @@ -1402,7 +1403,7 @@ done: return rv; } -static void * ldapu_propval_free (void *propval_in, void *arg) +static void * ldapu_propval_free (void *propval_in, void *arg __attribute__((unused))) { LDAPUPropVal_t *propval = (LDAPUPropVal_t *)propval_in; @@ -1426,7 +1427,7 @@ void ldapu_certinfo_free (void *info_in) free(certmap_info); } -static void * ldapu_certinfo_free_helper (void *info, void *arg) +static void * ldapu_certinfo_free_helper (void *info, void *arg __attribute__((unused))) { ldapu_certinfo_free(info); return (void *)LDAPU_SUCCESS; diff --git a/lib/ldaputil/ldapauth.c b/lib/ldaputil/ldapauth.c index e61dceb..855c575 100644 --- a/lib/ldaputil/ldapauth.c +++ b/lib/ldaputil/ldapauth.c @@ -194,6 +194,7 @@ int ldapu_find_entire_tree (LDAP *ld, int scope, (*res)[i++] = result; break; } + /* FALLTHROUGH */ case LDAPU_ERR_MULTIPLE_MATCHES: retval = rv; (*res)[i++] = result; diff --git a/lib/libsi18n/getstrprop.c b/lib/libsi18n/getstrprop.c index a9a017d..d0381f8 100644 --- a/lib/libsi18n/getstrprop.c +++ b/lib/libsi18n/getstrprop.c @@ -75,7 +75,7 @@ XP_GetStringFromMemory(const char* strLibraryName,int iToken) const char* XP_GetStringFromDatabase(const char* strLibraryName, - const char* strLanguage, + const char* strLanguage __attribute__((unused)), int key) { const char *result = NULL; diff --git a/src/libsds/sds/bpt/bpt.c b/src/libsds/sds/bpt/bpt.c index 6756ef0..b6b283e 100644 --- a/src/libsds/sds/bpt/bpt.c +++ b/src/libsds/sds/bpt/bpt.c @@ -294,8 +294,8 @@ sds_bptree_delete(sds_bptree_instance *binst, void *key) { /* Is the node less than half? */ if (target_node != NULL && next_node->item_count < SDS_BPTREE_HALF_CAPACITY) { /* Get our siblings. */ - sds_bptree_node *left = NULL; - sds_bptree_node *right = NULL; + left = NULL; + right = NULL; sds_bptree_node_siblings(next_node, &left, &right); /* Note the conditions for HALF_CAPACITY change here due to * space requirements. we only merge if < half. IE for 7 keys diff --git a/src/libsds/sds/bpt_cow/bpt_cow.c b/src/libsds/sds/bpt_cow/bpt_cow.c index 7bcf030..41e5bf6 100644 --- a/src/libsds/sds/bpt_cow/bpt_cow.c +++ b/src/libsds/sds/bpt_cow/bpt_cow.c @@ -266,8 +266,8 @@ sds_result sds_bptree_cow_delete(sds_bptree_transaction *btxn, void *key) { /* Now we do borrow and merge for branches. */ /* Get siblings */ - sds_bptree_node *left = NULL; - sds_bptree_node *right = NULL; + left = NULL; + right = NULL; /* This updates the left and right parent paths, but does NOT cow!!! */ sds_bptree_cow_node_siblings(next_node, &left, &right); /* Note the conditions for HALF_CAPACITY change here due to diff --git a/src/libsds/test/test_sds_bpt.c b/src/libsds/test/test_sds_bpt.c index 13f8177..f53c618 100644 --- a/src/libsds/test/test_sds_bpt.c +++ b/src/libsds/test/test_sds_bpt.c @@ -408,7 +408,7 @@ test_20_delete_non_branch_key(void **state) // Add many nodes. uint64_t i = 0; - for (uint64_t i = 2; i <= (SDS_BPTREE_DEFAULT_CAPACITY * 3); i++) { + for (i = 2; i <= (SDS_BPTREE_DEFAULT_CAPACITY * 3); i++) { // Add two to guarantee we don't conflict result = sds_bptree_insert(binst, (void *)&i , NULL); assert_int_equal(result, SDS_SUCCESS); diff --git a/src/libsds/test/test_sds_set.c b/src/libsds/test/test_sds_set.c index 159b69c..4d0185b 100644 --- a/src/libsds/test/test_sds_set.c +++ b/src/libsds/test/test_sds_set.c @@ -16,7 +16,7 @@ static int32_t cb_count = 0; static void -test_31_map_cb(void *k, void *v) { +test_31_map_cb(void *k __attribute__((unused)), void *v __attribute__((unused))) { cb_count++; } @@ -270,7 +270,7 @@ test_38_set_compliment_2(void **state) { } static int64_t -test_39_filter_cb(void *k, void *v) { +test_39_filter_cb(void *k, void *v __attribute__((unused))) { if (*(uint64_t *)k % 2 == 0) { return 1; } diff --git a/src/nunc-stans/ns/ns_thrpool.c b/src/nunc-stans/ns/ns_thrpool.c index f53e74e..2bbac43 100644 --- a/src/nunc-stans/ns/ns_thrpool.c +++ b/src/nunc-stans/ns/ns_thrpool.c @@ -1553,14 +1553,15 @@ ns_thrpool_wait(ns_thrpool_t *tp) pthread_cond_broadcast(&(tp->work_q_cv)); pthread_mutex_unlock(&(tp->work_q_lock)); - void *retval = NULL; - int32_t rc = pthread_join(thr->thr, &retval); + /* void *thread_retval = NULL; */ + int32_t rc = pthread_join(thr->thr, NULL); #ifdef DEBUG ns_log(LOG_DEBUG, "ns_thrpool_wait joined thread, result %d\n", rc); #endif if (rc != 0) { /* NGK TODO - this is unused right now. */ ns_log(LOG_ERR, "ns_thrpool_wait, failed to join thread %d", rc); + retval == PR_FAILURE; } ns_free(thr); } -- 1.8.3.1