From 98b57d5eb61094a9c88e2f7d90d3e21b7e74e9d8 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 8 Sep 2007 16:46:30 +0000 Subject: r25035: Fix some more warnings, use service pointer rather than service number in more places. (This used to be commit df9cebcb97e20564359097148665bd519f31bc6f) --- source4/lib/appweb/ejs/ejsLib.c | 2 +- source4/lib/charset/iconv.c | 4 +-- source4/lib/db_wrap.c | 2 +- source4/lib/dbwrap/dbwrap.c | 4 +-- source4/lib/events/events.c | 2 +- source4/lib/ldb/tools/ad2oLschema.c | 2 +- source4/lib/registry/tests/hive.c | 24 ++++++++--------- source4/lib/registry/tests/registry.c | 51 +++++++++++++++++++++++------------ source4/lib/socket/socket.c | 2 +- source4/lib/tls/tlscert.c | 2 +- source4/lib/util/tests/strlist.c | 2 +- 11 files changed, 57 insertions(+), 40 deletions(-) (limited to 'source4/lib') diff --git a/source4/lib/appweb/ejs/ejsLib.c b/source4/lib/appweb/ejs/ejsLib.c index 0dfc2e0ed2..67d0a4e760 100644 --- a/source4/lib/appweb/ejs/ejsLib.c +++ b/source4/lib/appweb/ejs/ejsLib.c @@ -154,7 +154,7 @@ EjsId ejsOpenEngine(EjsHandle primaryHandle, EjsHandle altHandle) MprVar *np; Ejs *ep; - ep = mprMalloc(sizeof(Ejs)); + ep = (Ejs *)mprMalloc(sizeof(Ejs)); if (ep == 0) { return (EjsId) -1; } diff --git a/source4/lib/charset/iconv.c b/source4/lib/charset/iconv.c index 8510f70d96..1c571f8961 100644 --- a/source4/lib/charset/iconv.c +++ b/source4/lib/charset/iconv.c @@ -75,7 +75,7 @@ static struct charset_functions *charsets = NULL; bool charset_register_backend(const void *_funcs) { - struct charset_functions *funcs = memdup(_funcs,sizeof(struct charset_functions)); + struct charset_functions *funcs = (struct charset_functions *)memdup(_funcs,sizeof(struct charset_functions)); struct charset_functions *c; /* Check whether we already have this charset... */ @@ -199,7 +199,7 @@ smb_iconv_t smb_iconv_open(const char *tocode, const char *fromcode) } #ifdef HAVE_NATIVE_ICONV - if ((!from || !to) && !lp_parm_bool(-1, "iconv", "native", true)) { + if ((!from || !to) && !lp_parm_bool(NULL, "iconv", "native", true)) { goto failed; } if (!from) { diff --git a/source4/lib/db_wrap.c b/source4/lib/db_wrap.c index f91006b46c..3a8d048221 100644 --- a/source4/lib/db_wrap.c +++ b/source4/lib/db_wrap.c @@ -161,7 +161,7 @@ struct ldb_context *ldb_wrap_connect(TALLOC_CTX *mem_ctx, } /* allow admins to force non-sync ldb for all databases */ - if (lp_parm_bool(-1, "ldb", "nosync", False)) { + if (lp_parm_bool(NULL, "ldb", "nosync", false)) { flags |= LDB_FLG_NOSYNC; } diff --git a/source4/lib/dbwrap/dbwrap.c b/source4/lib/dbwrap/dbwrap.c index 02e82c77a7..057a6f0057 100644 --- a/source4/lib/dbwrap/dbwrap.c +++ b/source4/lib/dbwrap/dbwrap.c @@ -30,8 +30,8 @@ */ struct db_context *db_tmp_open(TALLOC_CTX *mem_ctx, const char *name, int tdb_flags) { - if (lp_parm_bool(-1, "ctdb", "enable", False) && - lp_parm_bool(-1, "ctdb", name, True)) { + if (lp_parm_bool(NULL, "ctdb", "enable", false) && + lp_parm_bool(NULL, "ctdb", name, true)) { return db_tmp_open_ctdb(mem_ctx, name, tdb_flags); } diff --git a/source4/lib/events/events.c b/source4/lib/events/events.c index 77225b9ddf..da3cc3bfe0 100644 --- a/source4/lib/events/events.c +++ b/source4/lib/events/events.c @@ -185,7 +185,7 @@ struct event_context *event_context_init_byname(TALLOC_CTX *mem_ctx, const char #if _SAMBA_BUILD_ if (name == NULL) { - name = lp_parm_string(-1, "event", "backend"); + name = lp_parm_string(NULL, "event", "backend"); } #endif if (name == NULL) { diff --git a/source4/lib/ldb/tools/ad2oLschema.c b/source4/lib/ldb/tools/ad2oLschema.c index ec72d01121..64df4cfecb 100644 --- a/source4/lib/ldb/tools/ad2oLschema.c +++ b/source4/lib/ldb/tools/ad2oLschema.c @@ -677,7 +677,7 @@ static struct schema_conv process_convert(struct ldb_context *ldb, enum convert_ } } - target_str = lp_parm_string(-1, "convert", "target"); + target_str = lp_parm_string(NULL, "convert", "target"); if (!target_str || strcasecmp(target_str, "openldap") == 0) { target = TARGET_OPENLDAP; diff --git a/source4/lib/registry/tests/hive.c b/source4/lib/registry/tests/hive.c index a04bc1168e..a71e31474c 100644 --- a/source4/lib/registry/tests/hive.c +++ b/source4/lib/registry/tests/hive.c @@ -31,9 +31,9 @@ NTSTATUS torture_temp_dir(struct torture_context *tctx, const char *prefix, const char **tempdir); static bool test_del_nonexistant_key(struct torture_context *tctx, - const void *test_data) + const void *test_data) { - const struct hive_key *root = test_data; + const struct hive_key *root = (const struct hive_key *)test_data; WERROR error = hive_key_del(root, "bla"); torture_assert_werr_equal(tctx, error, WERR_NOT_FOUND, "invalid return code"); @@ -45,7 +45,7 @@ static bool test_keyinfo_root(struct torture_context *tctx, const void *test_data) { uint32_t num_subkeys, num_values; - const struct hive_key *root = test_data; + const struct hive_key *root = (const struct hive_key *)test_data; WERROR error; /* This is a new backend. There should be no subkeys and no @@ -67,7 +67,7 @@ static bool test_keyinfo_nums(struct torture_context *tctx, const void *test_data) { uint32_t num_subkeys, num_values; - const struct hive_key *root = test_data; + const struct hive_key *root = (const struct hive_key *)test_data; WERROR error; struct hive_key *subkey; uint32_t data = 42; @@ -100,7 +100,7 @@ static bool test_add_subkey(struct torture_context *tctx, { WERROR error; struct hive_key *subkey; - const struct hive_key *root = test_data; + const struct hive_key *root = (const struct hive_key *)test_data; TALLOC_CTX *mem_ctx = tctx; error = hive_key_add_name(mem_ctx, root, "Nested Key", NULL, @@ -114,9 +114,9 @@ static bool test_add_subkey(struct torture_context *tctx, } static bool test_flush_key(struct torture_context *tctx, - const void *test_data) + const void *test_data) { - const struct hive_key *root = test_data; + const struct hive_key *root = (const struct hive_key *)test_data; torture_assert_werr_ok(tctx, hive_key_flush(root), "flush key"); @@ -127,7 +127,7 @@ static bool test_del_key(struct torture_context *tctx, const void *test_data) { WERROR error; struct hive_key *subkey; - const struct hive_key *root = test_data; + const struct hive_key *root = (const struct hive_key *)test_data; TALLOC_CTX *mem_ctx = tctx; error = hive_key_add_name(mem_ctx, root, "Nested Key", NULL, @@ -148,7 +148,7 @@ static bool test_set_value(struct torture_context *tctx, { WERROR error; struct hive_key *subkey; - const struct hive_key *root = test_data; + const struct hive_key *root = (const struct hive_key *)test_data; TALLOC_CTX *mem_ctx = tctx; uint32_t data = 42; @@ -167,7 +167,7 @@ static bool test_get_value(struct torture_context *tctx, const void *test_data) { WERROR error; struct hive_key *subkey; - const struct hive_key *root = test_data; + const struct hive_key *root = (const struct hive_key *)test_data; TALLOC_CTX *mem_ctx = tctx; uint32_t data = 42; uint32_t type; @@ -200,7 +200,7 @@ static bool test_del_value(struct torture_context *tctx, const void *test_data) { WERROR error; struct hive_key *subkey; - const struct hive_key *root = test_data; + const struct hive_key *root = (const struct hive_key *)test_data; TALLOC_CTX *mem_ctx = tctx; uint32_t data = 42; uint32_t type; @@ -231,7 +231,7 @@ static bool test_list_values(struct torture_context *tctx, { WERROR error; struct hive_key *subkey; - const struct hive_key *root = test_data; + const struct hive_key *root = (const struct hive_key *)test_data; TALLOC_CTX *mem_ctx = tctx; uint32_t data = 42; uint32_t type; diff --git a/source4/lib/registry/tests/registry.c b/source4/lib/registry/tests/registry.c index 9ac61b1bc0..9809a6d4c8 100644 --- a/source4/lib/registry/tests/registry.c +++ b/source4/lib/registry/tests/registry.c @@ -37,7 +37,8 @@ NTSTATUS torture_temp_dir(struct torture_context *tctx, const char *prefix, static bool test_get_predefined(struct torture_context *tctx, const void *_data) { - const struct registry_context *rctx = _data; + const struct registry_context *rctx = + (const struct registry_context *)_data; struct registry_key *root; WERROR error; @@ -66,7 +67,8 @@ static bool test_get_predefined_unknown(struct torture_context *tctx, static bool test_predef_key_by_name(struct torture_context *tctx, const void *_data) { - const struct registry_context *rctx = _data; + const struct registry_context *rctx = + (const struct registry_context *)_data; struct registry_key *root; WERROR error; @@ -84,7 +86,8 @@ static bool test_predef_key_by_name(struct torture_context *tctx, static bool test_predef_key_by_name_invalid(struct torture_context *tctx, const void *_data) { - const struct registry_context *rctx = _data; + const struct registry_context *rctx = + (const struct registry_context *)_data; struct registry_key *root; WERROR error; @@ -100,7 +103,8 @@ static bool test_predef_key_by_name_invalid(struct torture_context *tctx, static bool test_create_subkey(struct torture_context *tctx, const void *_data) { - const struct registry_context *rctx = _data; + const struct registry_context *rctx = + (const struct registry_context *)_data; struct registry_key *root, *newkey; WERROR error; @@ -121,7 +125,8 @@ static bool test_create_subkey(struct torture_context *tctx, static bool test_create_nested_subkey(struct torture_context *tctx, const void *_data) { - const struct registry_context *rctx = _data; + const struct registry_context *rctx = + (const struct registry_context *)_data; struct registry_key *root, *newkey1, *newkey2; WERROR error; @@ -148,7 +153,8 @@ static bool test_create_nested_subkey(struct torture_context *tctx, static bool test_key_add_abs_top(struct torture_context *tctx, const void *_data) { - const struct registry_context *rctx = _data; + const struct registry_context *rctx = + (const struct registry_context *)_data; struct registry_key *root; WERROR error; @@ -165,7 +171,8 @@ static bool test_key_add_abs(struct torture_context *tctx, const void *_data) { WERROR error; - const struct registry_context *rctx = _data; + const struct registry_context *rctx = + (const struct registry_context *)_data; struct registry_key *root, *result1, *result2; error = reg_key_add_abs(tctx, rctx, "HKEY_CLASSES_ROOT\\bloe", 0, NULL, &result1); @@ -190,7 +197,8 @@ static bool test_key_add_abs(struct torture_context *tctx, static bool test_del_key(struct torture_context *tctx, const void *_data) { - const struct registry_context *rctx = _data; + const struct registry_context *rctx = + (const struct registry_context *)_data; struct registry_key *root, *newkey; WERROR error; @@ -238,7 +246,8 @@ static bool create_test_key(struct torture_context *tctx, static bool test_flush_key(struct torture_context *tctx, const void *_data) { - const struct registry_context *rctx = _data; + const struct registry_context *rctx = + (const struct registry_context *)_data; struct registry_key *root, *subkey; WERROR error; @@ -256,7 +265,8 @@ static bool test_flush_key(struct torture_context *tctx, const void *_data) static bool test_query_key(struct torture_context *tctx, const void *_data) { - const struct registry_context *rctx = _data; + const struct registry_context *rctx = + (const struct registry_context *)_data; struct registry_key *root, *subkey; WERROR error; NTTIME last_changed_time; @@ -280,7 +290,8 @@ static bool test_query_key(struct torture_context *tctx, const void *_data) static bool test_query_key_nums(struct torture_context *tctx, const void *_data) { - const struct registry_context *rctx = _data; + const struct registry_context *rctx = + (const struct registry_context *)_data; struct registry_key *root, *subkey1, *subkey2; WERROR error; uint32_t num_subkeys, num_values; @@ -313,7 +324,8 @@ static bool test_query_key_nums(struct torture_context *tctx, const void *_data) */ static bool test_list_subkeys(struct torture_context *tctx, const void *_data) { - const struct registry_context *rctx = _data; + const struct registry_context *rctx = + (const struct registry_context *)_data; struct registry_key *subkey = NULL, *root; WERROR error; NTTIME last_mod_time; @@ -351,7 +363,8 @@ static bool test_list_subkeys(struct torture_context *tctx, const void *_data) */ static bool test_set_value(struct torture_context *tctx, const void *_data) { - const struct registry_context *rctx = _data; + const struct registry_context *rctx = + (const struct registry_context *)_data; struct registry_key *subkey = NULL, *root; WERROR error; uint32_t data = 42; @@ -371,7 +384,8 @@ static bool test_set_value(struct torture_context *tctx, const void *_data) */ static bool test_security(struct torture_context *tctx, const void *_data) { - const struct registry_context *rctx = _data; + const struct registry_context *rctx = + (const struct registry_context *)_data; struct registry_key *subkey = NULL, *root; WERROR error; struct security_descriptor *osd, *nsd; @@ -404,7 +418,8 @@ static bool test_security(struct torture_context *tctx, const void *_data) */ static bool test_get_value(struct torture_context *tctx, const void *_data) { - const struct registry_context *rctx = _data; + const struct registry_context *rctx = + (const struct registry_context *)_data; struct registry_key *subkey = NULL, *root; WERROR error; DATA_BLOB data; @@ -439,7 +454,8 @@ static bool test_get_value(struct torture_context *tctx, const void *_data) */ static bool test_del_value(struct torture_context *tctx, const void *_data) { - const struct registry_context *rctx = _data; + const struct registry_context *rctx = + (const struct registry_context *)_data; struct registry_key *subkey = NULL, *root; WERROR error; DATA_BLOB data; @@ -473,7 +489,8 @@ static bool test_del_value(struct torture_context *tctx, const void *_data) */ static bool test_list_values(struct torture_context *tctx, const void *_data) { - const struct registry_context *rctx = _data; + const struct registry_context *rctx = + (const struct registry_context *)_data; struct registry_key *subkey = NULL, *root; WERROR error; DATA_BLOB data; diff --git a/source4/lib/socket/socket.c b/source4/lib/socket/socket.c index 184c89f3ed..55a1b6394b 100644 --- a/source4/lib/socket/socket.c +++ b/source4/lib/socket/socket.c @@ -70,7 +70,7 @@ _PUBLIC_ NTSTATUS socket_create_with_ops(TALLOC_CTX *mem_ctx, const struct socke if (!(flags & SOCKET_FLAG_BLOCK) && type == SOCKET_TYPE_STREAM && - lp_parm_bool(-1, "socket", "testnonblock", False)) { + lp_parm_bool(NULL, "socket", "testnonblock", false)) { (*new_sock)->flags |= SOCKET_FLAG_TESTNONBLOCK; } diff --git a/source4/lib/tls/tlscert.c b/source4/lib/tls/tlscert.c index ad65df0e6c..240ae056c1 100644 --- a/source4/lib/tls/tlscert.c +++ b/source4/lib/tls/tlscert.c @@ -153,5 +153,5 @@ failed: } #else - void tls_cert_dummy(void) {} +void tls_cert_dummy(void) {} #endif diff --git a/source4/lib/util/tests/strlist.c b/source4/lib/util/tests/strlist.c index 41accd4bd2..437d9d741a 100644 --- a/source4/lib/util/tests/strlist.c +++ b/source4/lib/util/tests/strlist.c @@ -35,7 +35,7 @@ static const char *test_lists_shell_strings[] = { static bool test_lists_shell(struct torture_context *tctx, const void *test_data) { - const char *data = test_data; + const char *data = (const char *)test_data; const char **ret1, **ret2, *tmp; bool match = true; TALLOC_CTX *mem_ctx = tctx; -- cgit