diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2008-12-23 22:57:11 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2008-12-23 22:57:11 +0100 |
commit | bd64688c6aca6512efd0bd7d95000579beea3119 (patch) | |
tree | c05cf6c484f03b967c95508c13cce8179e08d3bc /source4/dsdb | |
parent | 32e03f9fa55a4c897ade55b9b2e3740facfdcfd1 (diff) | |
download | samba-bd64688c6aca6512efd0bd7d95000579beea3119.tar.gz samba-bd64688c6aca6512efd0bd7d95000579beea3119.tar.bz2 samba-bd64688c6aca6512efd0bd7d95000579beea3119.zip |
Fix more compiler warnings in various places.
Diffstat (limited to 'source4/dsdb')
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/kludge_acl.c | 8 | ||||
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/partition.c | 8 | ||||
-rw-r--r-- | source4/dsdb/schema/schema_description.c | 12 | ||||
-rw-r--r-- | source4/dsdb/schema/schema_query.c | 38 |
4 files changed, 33 insertions, 33 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/kludge_acl.c b/source4/dsdb/samdb/ldb_modules/kludge_acl.c index 275e9b5299..bb95c7ee5a 100644 --- a/source4/dsdb/samdb/ldb_modules/kludge_acl.c +++ b/source4/dsdb/samdb/ldb_modules/kludge_acl.c @@ -93,7 +93,7 @@ static int kludge_acl_allowedAttributes(struct ldb_context *ldb, struct ldb_mess struct ldb_message_element *allowedAttributes; const struct dsdb_schema *schema = dsdb_get_schema(ldb); TALLOC_CTX *mem_ctx; - char **objectclass_list, **attr_list; + const char **objectclass_list, **attr_list; int i, ret; /* If we don't have a schema yet, we can't do anything... */ @@ -118,7 +118,7 @@ static int kludge_acl_allowedAttributes(struct ldb_context *ldb, struct ldb_mess we alter the element array in ldb_msg_add_empty() */ oc_el = ldb_msg_find_element(msg, "objectClass"); - objectclass_list = talloc_array(mem_ctx, char *, oc_el->num_values + 1); + objectclass_list = talloc_array(mem_ctx, const char *, oc_el->num_values + 1); if (!objectclass_list) { ldb_oom(ldb); talloc_free(mem_ctx); @@ -126,11 +126,11 @@ static int kludge_acl_allowedAttributes(struct ldb_context *ldb, struct ldb_mess } for (i=0; oc_el && i < oc_el->num_values; i++) { - objectclass_list[i] = (char *)oc_el->values[i].data; + objectclass_list[i] = (const char *)oc_el->values[i].data; } objectclass_list[i] = NULL; - attr_list = dsdb_full_attribute_list(mem_ctx, schema, (const char **)objectclass_list, DSDB_SCHEMA_ALL); + attr_list = dsdb_full_attribute_list(mem_ctx, schema, objectclass_list, DSDB_SCHEMA_ALL); if (!attr_list) { ldb_asprintf_errstring(ldb, "kludge_acl: Failed to get list of attributes create %s attribute", attrName); talloc_free(mem_ctx); diff --git a/source4/dsdb/samdb/ldb_modules/partition.c b/source4/dsdb/samdb/ldb_modules/partition.c index 0d2ce64604..0000c87f72 100644 --- a/source4/dsdb/samdb/ldb_modules/partition.c +++ b/source4/dsdb/samdb/ldb_modules/partition.c @@ -1065,11 +1065,11 @@ static int partition_extended(struct ldb_module *module, struct ldb_request *req static int partition_sort_compare(const void *v1, const void *v2) { - struct dsdb_control_current_partition *p1; - struct dsdb_control_current_partition *p2; + const struct dsdb_control_current_partition *p1; + const struct dsdb_control_current_partition *p2; - p1 = *((struct dsdb_control_current_partition **)v1); - p2 = *((struct dsdb_control_current_partition **)v2); + p1 = *((struct dsdb_control_current_partition * const*)v1); + p2 = *((struct dsdb_control_current_partition * const*)v2); return ldb_dn_compare(p1->dn, p2->dn); } diff --git a/source4/dsdb/schema/schema_description.c b/source4/dsdb/schema/schema_description.c index 5474eb5074..d616f3bb9b 100644 --- a/source4/dsdb/schema/schema_description.c +++ b/source4/dsdb/schema/schema_description.c @@ -215,8 +215,8 @@ char *schema_class_description(TALLOC_CTX *mem_ctx, const char **auxillary_classes, const char *subClassOf, int objectClassCategory, - char **must, - char **may, + const char **must, + const char **may, const char *schemaHexGUID) { char *schema_entry = talloc_asprintf(mem_ctx, @@ -343,10 +343,10 @@ char *schema_class_to_dITContentRule(TALLOC_CTX *mem_ctx, const struct dsdb_clas { int i; char *schema_description; - char **aux_class_list = NULL; - char **attrs; - char **must_attr_list = NULL; - char **may_attr_list = NULL; + const char **aux_class_list = NULL; + const char **attrs; + const char **must_attr_list = NULL; + const char **may_attr_list = NULL; TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx); const struct dsdb_class *aux_class; if (!tmp_ctx) { diff --git a/source4/dsdb/schema/schema_query.c b/source4/dsdb/schema/schema_query.c index ca26ffd206..f848fee365 100644 --- a/source4/dsdb/schema/schema_query.c +++ b/source4/dsdb/schema/schema_query.c @@ -212,18 +212,18 @@ WERROR dsdb_linked_attribute_lDAPDisplayName_list(const struct dsdb_schema *sche return WERR_OK; } -char **merge_attr_list(TALLOC_CTX *mem_ctx, - char **attrs, const char **new_attrs) +const char **merge_attr_list(TALLOC_CTX *mem_ctx, + const char **attrs, const char * const*new_attrs) { - char **ret_attrs; + const char **ret_attrs; int i; - size_t new_len, orig_len = str_list_length((const char **)attrs); + size_t new_len, orig_len = str_list_length(attrs); if (!new_attrs) { return attrs; } ret_attrs = talloc_realloc(mem_ctx, - attrs, char *, orig_len + str_list_length(new_attrs) + 1); + attrs, const char *, orig_len + str_list_length(new_attrs) + 1); if (ret_attrs) { for (i=0; i < str_list_length(new_attrs); i++) { ret_attrs[orig_len + i] = new_attrs[i]; @@ -241,9 +241,9 @@ char **merge_attr_list(TALLOC_CTX *mem_ctx, considering subclasses, auxillary classes etc) */ -char **dsdb_attribute_list(TALLOC_CTX *mem_ctx, const struct dsdb_class *class, enum dsdb_attr_list_query query) +const char **dsdb_attribute_list(TALLOC_CTX *mem_ctx, const struct dsdb_class *class, enum dsdb_attr_list_query query) { - char **attr_list = NULL; + const char **attr_list = NULL; switch (query) { case DSDB_SCHEMA_ALL_MAY: attr_list = merge_attr_list(mem_ctx, attr_list, class->mayContain); @@ -281,7 +281,7 @@ char **dsdb_attribute_list(TALLOC_CTX *mem_ctx, const struct dsdb_class *class, return attr_list; } -static char **dsdb_full_attribute_list_internal(TALLOC_CTX *mem_ctx, +static const char **dsdb_full_attribute_list_internal(TALLOC_CTX *mem_ctx, const struct dsdb_schema *schema, const char **class_list, enum dsdb_attr_list_query query) @@ -289,39 +289,39 @@ static char **dsdb_full_attribute_list_internal(TALLOC_CTX *mem_ctx, int i; const struct dsdb_class *class; - char **attr_list = NULL; - char **this_class_list; - char **recursive_list; + const char **attr_list = NULL; + const char **this_class_list; + const char **recursive_list; for (i=0; class_list && class_list[i]; i++) { class = dsdb_class_by_lDAPDisplayName(schema, class_list[i]); this_class_list = dsdb_attribute_list(mem_ctx, class, query); - attr_list = merge_attr_list(mem_ctx, attr_list, (const char **)this_class_list); + attr_list = merge_attr_list(mem_ctx, attr_list, this_class_list); recursive_list = dsdb_full_attribute_list_internal(mem_ctx, schema, class->systemAuxiliaryClass, query); - attr_list = merge_attr_list(mem_ctx, attr_list, (const char **)recursive_list); + attr_list = merge_attr_list(mem_ctx, attr_list, recursive_list); recursive_list = dsdb_full_attribute_list_internal(mem_ctx, schema, class->auxiliaryClass, query); - attr_list = merge_attr_list(mem_ctx, attr_list, (const char **)recursive_list); + attr_list = merge_attr_list(mem_ctx, attr_list, recursive_list); } return attr_list; } -char **dsdb_full_attribute_list(TALLOC_CTX *mem_ctx, +const char **dsdb_full_attribute_list(TALLOC_CTX *mem_ctx, const struct dsdb_schema *schema, const char **class_list, enum dsdb_attr_list_query query) { - char **attr_list = dsdb_full_attribute_list_internal(mem_ctx, schema, class_list, query); - size_t new_len = str_list_length((const char **)attr_list); + const char **attr_list = dsdb_full_attribute_list_internal(mem_ctx, schema, class_list, query); + size_t new_len = str_list_length(attr_list); /* Remove duplicates */ if (new_len > 1) { @@ -331,8 +331,8 @@ char **dsdb_full_attribute_list(TALLOC_CTX *mem_ctx, (comparison_fn_t)strcasecmp); for (i=1 ; i < new_len; i++) { - char **val1 = &attr_list[i-1]; - char **val2 = &attr_list[i]; + const char **val1 = &attr_list[i-1]; + const char **val2 = &attr_list[i]; if (ldb_attr_cmp(*val1, *val2) == 0) { memmove(val1, val2, (new_len - i) * sizeof( *attr_list)); new_len--; |