diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2007-09-07 15:08:14 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 15:05:27 -0500 |
commit | cd962355abad90a2161765a7be7d26e63572cab7 (patch) | |
tree | 21a1e180cfa6396c491301e3e171d8105208bb44 /source4/lib | |
parent | 6c79213eb80283bb211d2e2161c25337c0a549b7 (diff) | |
download | samba-cd962355abad90a2161765a7be7d26e63572cab7.tar.gz samba-cd962355abad90a2161765a7be7d26e63572cab7.tar.bz2 samba-cd962355abad90a2161765a7be7d26e63572cab7.zip |
r25000: Fix some more C++ compatibility warnings.
(This used to be commit 08bb1ef643ab906f1645cf6f32763dc73b1884e4)
Diffstat (limited to 'source4/lib')
-rw-r--r-- | source4/lib/ldb/ldb_tdb/ldb_cache.c | 16 | ||||
-rw-r--r-- | source4/lib/ldb/ldb_tdb/ldb_index.c | 12 | ||||
-rw-r--r-- | source4/lib/ldb/ldb_tdb/ldb_search.c | 6 | ||||
-rw-r--r-- | source4/lib/messaging/messaging.c | 2 | ||||
-rw-r--r-- | source4/lib/registry/local.c | 5 | ||||
-rw-r--r-- | source4/lib/registry/patchfile_preg.c | 1 | ||||
-rw-r--r-- | source4/lib/registry/regf.c | 2 | ||||
-rw-r--r-- | source4/lib/registry/tools/regshell.c | 6 | ||||
-rw-r--r-- | source4/lib/util/fault.c | 4 | ||||
-rw-r--r-- | source4/lib/util/time.c | 2 |
10 files changed, 27 insertions, 29 deletions
diff --git a/source4/lib/ldb/ldb_tdb/ldb_cache.c b/source4/lib/ldb/ldb_tdb/ldb_cache.c index 6bbf31dee7..a7f72dd6d0 100644 --- a/source4/lib/ldb/ldb_tdb/ldb_cache.c +++ b/source4/lib/ldb/ldb_tdb/ldb_cache.c @@ -58,7 +58,7 @@ static const struct { */ static void ltdb_attributes_unload(struct ldb_module *module) { - struct ltdb_private *ltdb = module->private_data; + struct ltdb_private *ltdb = (struct ltdb_private *)module->private_data; struct ldb_message *msg; int i; @@ -105,7 +105,7 @@ static int ltdb_attributes_flags(struct ldb_message_element *el, unsigned *v) */ static int ltdb_attributes_load(struct ldb_module *module) { - struct ltdb_private *ltdb = module->private_data; + struct ltdb_private *ltdb = (struct ltdb_private *)module->private_data; struct ldb_message *msg = ltdb->cache->attributes; struct ldb_dn *dn; int i, r; @@ -172,7 +172,7 @@ failed: */ static int ltdb_subclasses_load(struct ldb_module *module) { - struct ltdb_private *ltdb = module->private_data; + struct ltdb_private *ltdb = (struct ltdb_private *)module->private_data; struct ldb_message *msg = ltdb->cache->subclasses; struct ldb_dn *dn; int i, j, r; @@ -208,7 +208,7 @@ failed: */ static void ltdb_subclasses_unload(struct ldb_module *module) { - struct ltdb_private *ltdb = module->private_data; + struct ltdb_private *ltdb = (struct ltdb_private *)module->private_data; struct ldb_message *msg; int i; @@ -232,7 +232,7 @@ static void ltdb_subclasses_unload(struct ldb_module *module) */ static int ltdb_baseinfo_init(struct ldb_module *module) { - struct ltdb_private *ltdb = module->private_data; + struct ltdb_private *ltdb = (struct ltdb_private *)module->private_data; struct ldb_message *msg; struct ldb_message_element el; struct ldb_val val; @@ -285,7 +285,7 @@ failed: */ static void ltdb_cache_free(struct ldb_module *module) { - struct ltdb_private *ltdb = module->private_data; + struct ltdb_private *ltdb = (struct ltdb_private *)module->private_data; ltdb->sequence_number = 0; talloc_free(ltdb->cache); @@ -308,7 +308,7 @@ int ltdb_cache_reload(struct ldb_module *module) */ int ltdb_cache_load(struct ldb_module *module) { - struct ltdb_private *ltdb = module->private_data; + struct ltdb_private *ltdb = (struct ltdb_private *)module->private_data; struct ldb_dn *baseinfo_dn = NULL; struct ldb_dn *indexlist_dn = NULL; uint64_t seq; @@ -417,7 +417,7 @@ failed: */ int ltdb_increase_sequence_number(struct ldb_module *module) { - struct ltdb_private *ltdb = module->private_data; + struct ltdb_private *ltdb = (struct ltdb_private *)module->private_data; struct ldb_message *msg; struct ldb_message_element el[2]; struct ldb_val val; diff --git a/source4/lib/ldb/ldb_tdb/ldb_index.c b/source4/lib/ldb/ldb_tdb/ldb_index.c index 1fe697f277..bcab3acafe 100644 --- a/source4/lib/ldb/ldb_tdb/ldb_index.c +++ b/source4/lib/ldb/ldb_tdb/ldb_index.c @@ -45,7 +45,7 @@ static int ldb_list_find(const void *needle, const void *base, size_t nmemb, size_t size, comparison_fn_t comp_fn) { - const char *base_p = base; + const char *base_p = (const char *)base; size_t min_i, max_i, test_i; if (nmemb == 0) { @@ -1014,7 +1014,7 @@ static int ltdb_index_add1(struct ldb_module *module, const char *dn, static int ltdb_index_add0(struct ldb_module *module, const char *dn, struct ldb_message_element *elements, int num_el) { - struct ltdb_private *ltdb = module->private_data; + struct ltdb_private *ltdb = (struct ltdb_private *)module->private_data; int ret; unsigned int i, j; @@ -1138,7 +1138,7 @@ int ltdb_index_del_value(struct ldb_module *module, const char *dn, */ int ltdb_index_del(struct ldb_module *module, const struct ldb_message *msg) { - struct ltdb_private *ltdb = module->private_data; + struct ltdb_private *ltdb = (struct ltdb_private *)module->private_data; int ret; const char *dn; unsigned int i, j; @@ -1180,7 +1180,7 @@ int ltdb_index_del(struct ldb_module *module, const struct ldb_message *msg) */ int ltdb_index_one(struct ldb_module *module, const struct ldb_message *msg, int add) { - struct ltdb_private *ltdb = module->private_data; + struct ltdb_private *ltdb = (struct ltdb_private *)module->private_data; struct ldb_message_element el; struct ldb_val val; struct ldb_dn *pdn; @@ -1244,7 +1244,7 @@ static int delete_index(struct tdb_context *tdb, TDB_DATA key, TDB_DATA data, vo */ static int re_index(struct tdb_context *tdb, TDB_DATA key, TDB_DATA data, void *state) { - struct ldb_module *module = state; + struct ldb_module *module = (struct ldb_module *)state; struct ldb_message *msg; const char *dn = NULL; int ret; @@ -1309,7 +1309,7 @@ static int re_index(struct tdb_context *tdb, TDB_DATA key, TDB_DATA data, void * */ int ltdb_reindex(struct ldb_module *module) { - struct ltdb_private *ltdb = module->private_data; + struct ltdb_private *ltdb = (struct ltdb_private *)module->private_data; int ret; if (ltdb_cache_reload(module) != 0) { diff --git a/source4/lib/ldb/ldb_tdb/ldb_search.c b/source4/lib/ldb/ldb_tdb/ldb_search.c index 013b341d42..a195a39391 100644 --- a/source4/lib/ldb/ldb_tdb/ldb_search.c +++ b/source4/lib/ldb/ldb_tdb/ldb_search.c @@ -210,7 +210,7 @@ static struct ldb_message *ltdb_pull_attrs(struct ldb_module *module, */ int ltdb_search_dn1(struct ldb_module *module, struct ldb_dn *dn, struct ldb_message *msg) { - struct ltdb_private *ltdb = module->private_data; + struct ltdb_private *ltdb = (struct ltdb_private *)module->private_data; int ret; TDB_DATA tdb_key, tdb_data; @@ -252,7 +252,7 @@ int ltdb_search_dn1(struct ldb_module *module, struct ldb_dn *dn, struct ldb_mes */ static int ltdb_lock_read(struct ldb_module *module) { - struct ltdb_private *ltdb = module->private_data; + struct ltdb_private *ltdb = (struct ltdb_private *)module->private_data; return tdb_lockall_read(ltdb->tdb); } @@ -261,7 +261,7 @@ static int ltdb_lock_read(struct ldb_module *module) */ static int ltdb_unlock_read(struct ldb_module *module) { - struct ltdb_private *ltdb = module->private_data; + struct ltdb_private *ltdb = (struct ltdb_private *)module->private_data; return tdb_unlockall_read(ltdb->tdb); } diff --git a/source4/lib/messaging/messaging.c b/source4/lib/messaging/messaging.c index c4c0d0e059..4b609b09e9 100644 --- a/source4/lib/messaging/messaging.c +++ b/source4/lib/messaging/messaging.c @@ -504,7 +504,7 @@ NTSTATUS messaging_send_ptr(struct messaging_context *msg, struct server_id serv { DATA_BLOB blob; - blob.data = (void *)&ptr; + blob.data = (uint8_t *)&ptr; blob.length = sizeof(void *); return messaging_send(msg, server, msg_type, &blob); diff --git a/source4/lib/registry/local.c b/source4/lib/registry/local.c index 8ccb96cbdc..035d556abf 100644 --- a/source4/lib/registry/local.c +++ b/source4/lib/registry/local.c @@ -139,9 +139,8 @@ WERROR local_get_predefined_key (const struct registry_context *ctx, return WERR_NOT_FOUND; *key = reg_import_hive_key(ctx, mp->key, - mp->path.predefined_key, - mp->path.elements - ); + mp->path.predefined_key, + mp->path.elements); return WERR_OK; } diff --git a/source4/lib/registry/patchfile_preg.c b/source4/lib/registry/patchfile_preg.c index 993de19f98..ccabf4ca07 100644 --- a/source4/lib/registry/patchfile_preg.c +++ b/source4/lib/registry/patchfile_preg.c @@ -21,6 +21,7 @@ #include "includes.h" #include "lib/registry/registry.h" +#include "lib/registry/patchfile.h" #include "system/filesys.h" #include "pstring.h" diff --git a/source4/lib/registry/regf.c b/source4/lib/registry/regf.c index d74ffd2b4b..0c40773daa 100644 --- a/source4/lib/registry/regf.c +++ b/source4/lib/registry/regf.c @@ -1664,7 +1664,7 @@ static WERROR regf_set_value(struct hive_key *key, const char *name, DATA_BLOB value_list; value_list.length = (nk->num_values+1)*4; - value_list.data = (void *)talloc_array(private_data, uint32_t, nk->num_values+1); + value_list.data = talloc_array(private_data, uint32_t, nk->num_values+1); W_ERROR_HAVE_NO_MEMORY(value_list.data); memcpy(value_list.data, values.data, nk->num_values * 4); diff --git a/source4/lib/registry/tools/regshell.c b/source4/lib/registry/tools/regshell.c index 131d76fff5..cdf688b39e 100644 --- a/source4/lib/registry/tools/regshell.c +++ b/source4/lib/registry/tools/regshell.c @@ -262,8 +262,7 @@ static WERROR cmd_rmval(struct regshell_context *ctx, int argc, char **argv) return WERR_OK; } -static WERROR cmd_exit(struct regshell_context *ctx, - int argc, char **argv) +_NORETURN_ static WERROR cmd_exit(struct regshell_context *ctx, int argc, char **argv) { exit(0); return WERR_OK; @@ -275,8 +274,7 @@ static struct { const char *name; const char *alias; const char *help; - WERROR (*handle)(struct regshell_context *ctx, - int argc, char **argv); + WERROR (*handle)(struct regshell_context *ctx, int argc, char **argv); } regshell_cmds[] = { {"ck", "cd", "Change current key", cmd_ck }, {"info", "i", "Show detailed information of a key", cmd_info }, diff --git a/source4/lib/util/fault.c b/source4/lib/util/fault.c index 5cc9445407..e9cd040ee6 100644 --- a/source4/lib/util/fault.c +++ b/source4/lib/util/fault.c @@ -153,7 +153,7 @@ _PUBLIC_ _NORETURN_ void smb_panic(const char *why) /** report a fault **/ -static void fault_report(int sig) +_NORETURN_ static void fault_report(int sig) { static int counter; @@ -172,7 +172,7 @@ static void fault_report(int sig) /** catch serious errors **/ -static void sig_fault(int sig) +_NORETURN_ static void sig_fault(int sig) { if (fault_handlers.fault_handler) { /* we have a fault handler, call it. It may not return. */ diff --git a/source4/lib/util/time.c b/source4/lib/util/time.c index 4601833a3d..fc51498009 100644 --- a/source4/lib/util/time.c +++ b/source4/lib/util/time.c @@ -269,7 +269,7 @@ _PUBLIC_ time_t pull_dos_date2(const uint8_t *date_ptr, int zone_offset) x2 = ((x&0xFFFF)<<16) | ((x&0xFFFF0000)>>16); SIVAL(&x,0,x2); - return pull_dos_date((void *)&x, zone_offset); + return pull_dos_date((const uint8_t *)&x, zone_offset); } /** |