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/torture | |
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/torture')
30 files changed, 93 insertions, 88 deletions
diff --git a/source4/torture/basic/aliases.c b/source4/torture/basic/aliases.c index 0b5f1fb88a..660009704b 100644 --- a/source4/torture/basic/aliases.c +++ b/source4/torture/basic/aliases.c @@ -381,9 +381,9 @@ static bool setpathinfo_aliases(struct torture_context *tctx, /* look for aliased info levels in trans2 calls */ -struct torture_suite *torture_trans2_aliases(void) +struct torture_suite *torture_trans2_aliases(TALLOC_CTX *mem_ctx) { - struct torture_suite *suite = torture_suite_create(talloc_autofree_context(), "ALIASES"); + struct torture_suite *suite = torture_suite_create(mem_ctx, "ALIASES"); torture_suite_add_1smb_test(suite, "QFILEINFO aliases", qfsinfo_aliases); torture_suite_add_1smb_test(suite, "QFSINFO aliases", qfileinfo_aliases); diff --git a/source4/torture/basic/attr.c b/source4/torture/basic/attr.c index 4c6a7a3ab6..07071bb68a 100644 --- a/source4/torture/basic/attr.c +++ b/source4/torture/basic/attr.c @@ -86,8 +86,8 @@ static const struct trunc_open_results attr_results[] = { }; -BOOL torture_openattrtest(struct torture_context *tctx, - struct smbcli_state *cli1) +bool torture_openattrtest(struct torture_context *tctx, + struct smbcli_state *cli1) { const char *fname = "\\openattr.file"; int fnum1; diff --git a/source4/torture/basic/base.c b/source4/torture/basic/base.c index 2cb0c6a985..8c510efab4 100644 --- a/source4/torture/basic/base.c +++ b/source4/torture/basic/base.c @@ -1715,7 +1715,7 @@ NTSTATUS torture_base_init(void) struct torture_suite *suite = torture_suite_create(talloc_autofree_context(), "BASE"); torture_suite_add_2smb_test(suite, "FDPASS", run_fdpasstest); - torture_suite_add_suite(suite, torture_base_locktest()); + torture_suite_add_suite(suite, torture_base_locktest(suite)); torture_suite_add_1smb_test(suite, "UNLINK", torture_unlinktest); torture_suite_add_1smb_test(suite, "ATTR", run_attrtest); torture_suite_add_1smb_test(suite, "TRANS2", run_trans2test); @@ -1750,7 +1750,7 @@ NTSTATUS torture_base_init(void) torture_suite_add_1smb_test(suite, "CASETABLE", torture_casetable); torture_suite_add_1smb_test(suite, "UTABLE", torture_utable); torture_suite_add_simple_test(suite, "SMB", torture_smb_scan); - torture_suite_add_suite(suite, torture_trans2_aliases()); + torture_suite_add_suite(suite, torture_trans2_aliases(suite)); torture_suite_add_1smb_test(suite, "TRANS2-SCAN", torture_trans2_scan); torture_suite_add_1smb_test(suite, "NTTRANS", torture_nttrans_scan); diff --git a/source4/torture/basic/denytest.c b/source4/torture/basic/denytest.c index 98f4323ce6..05c613d647 100644 --- a/source4/torture/basic/denytest.c +++ b/source4/torture/basic/denytest.c @@ -1410,8 +1410,8 @@ static void progress_bar(struct torture_context *tctx, uint_t i, uint_t total) /* this produces a matrix of deny mode behaviour for 1 connection */ -BOOL torture_denytest1(struct torture_context *tctx, - struct smbcli_state *cli1) +bool torture_denytest1(struct torture_context *tctx, + struct smbcli_state *cli1) { int fnum1, fnum2; int i; @@ -1500,9 +1500,9 @@ failed: /* this produces a matrix of deny mode behaviour with 2 connections */ -BOOL torture_denytest2(struct torture_context *tctx, - struct smbcli_state *cli1, - struct smbcli_state *cli2) +bool torture_denytest2(struct torture_context *tctx, + struct smbcli_state *cli1, + struct smbcli_state *cli2) { int fnum1, fnum2; int i; @@ -1588,9 +1588,9 @@ failed: /* simple test harness for playing with deny modes */ -BOOL torture_denytest3(struct torture_context *tctx, - struct smbcli_state *cli1, - struct smbcli_state *cli2) +bool torture_denytest3(struct torture_context *tctx, + struct smbcli_state *cli1, + struct smbcli_state *cli2) { int fnum1, fnum2; const char *fname; @@ -1889,7 +1889,8 @@ failed: /* a denytest for ntcreatex */ -BOOL torture_ntdenytest1(struct torture_context *tctx, struct smbcli_state *cli, int client) +bool torture_ntdenytest1(struct torture_context *tctx, + struct smbcli_state *cli, int client) { extern int torture_seed; @@ -1903,9 +1904,9 @@ BOOL torture_ntdenytest1(struct torture_context *tctx, struct smbcli_state *cli, /* a denytest for ntcreatex */ -BOOL torture_ntdenytest2(struct torture_context *torture, - struct smbcli_state *cli1, - struct smbcli_state *cli2) +bool torture_ntdenytest2(struct torture_context *torture, + struct smbcli_state *cli1, + struct smbcli_state *cli2) { return torture_ntdenytest(torture, cli1, cli2, 0); } @@ -1929,8 +1930,8 @@ BOOL torture_ntdenytest2(struct torture_context *torture, /* test sharing of handles with DENY_DOS on a single connection */ -BOOL torture_denydos_sharing(struct torture_context *tctx, - struct smbcli_state *cli) +bool torture_denydos_sharing(struct torture_context *tctx, + struct smbcli_state *cli) { union smb_open io; union smb_fileinfo finfo; diff --git a/source4/torture/basic/dir.c b/source4/torture/basic/dir.c index 8b37188299..9f9122fe32 100644 --- a/source4/torture/basic/dir.c +++ b/source4/torture/basic/dir.c @@ -33,8 +33,8 @@ static void list_fn(struct clilist_file_info *finfo, const char *name, void *sta /* test directory listing speed */ -BOOL torture_dirtest1(struct torture_context *tctx, - struct smbcli_state *cli) +bool torture_dirtest1(struct torture_context *tctx, + struct smbcli_state *cli) { int i; int fnum; @@ -76,8 +76,8 @@ BOOL torture_dirtest1(struct torture_context *tctx, return correct; } -BOOL torture_dirtest2(struct torture_context *tctx, - struct smbcli_state *cli) +bool torture_dirtest2(struct torture_context *tctx, + struct smbcli_state *cli) { int i; int fnum, num_seen; diff --git a/source4/torture/basic/disconnect.c b/source4/torture/basic/disconnect.c index e05e3ef082..1dab4b0cae 100644 --- a/source4/torture/basic/disconnect.c +++ b/source4/torture/basic/disconnect.c @@ -126,7 +126,7 @@ static BOOL test_disconnect_lock(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) /* basic testing of disconnects */ -BOOL torture_disconnect(struct torture_context *torture) +bool torture_disconnect(struct torture_context *torture) { BOOL ret = True; TALLOC_CTX *mem_ctx; diff --git a/source4/torture/basic/locking.c b/source4/torture/basic/locking.c index aa3168fb08..0d66ecf30b 100644 --- a/source4/torture/basic/locking.c +++ b/source4/torture/basic/locking.c @@ -795,10 +795,9 @@ fail: return correct; } -struct torture_suite *torture_base_locktest(void) +struct torture_suite *torture_base_locktest(TALLOC_CTX *mem_ctx) { - struct torture_suite *suite = torture_suite_create(talloc_autofree_context(), - "LOCK"); + struct torture_suite *suite = torture_suite_create(mem_ctx, "LOCK"); torture_suite_add_2smb_test(suite, "LOCK1", torture_locktest1); torture_suite_add_1smb_test(suite, "LOCK2", torture_locktest2); torture_suite_add_2smb_test(suite, "LOCK3", torture_locktest3); diff --git a/source4/torture/basic/mangle_test.c b/source4/torture/basic/mangle_test.c index 665360fc64..d13450dd3a 100644 --- a/source4/torture/basic/mangle_test.c +++ b/source4/torture/basic/mangle_test.c @@ -155,8 +155,8 @@ static void gen_name(char *name) } -BOOL torture_mangle(struct torture_context *torture, - struct smbcli_state *cli) +bool torture_mangle(struct torture_context *torture, + struct smbcli_state *cli) { extern int torture_numops; int i; diff --git a/source4/torture/basic/properties.c b/source4/torture/basic/properties.c index 6a8e84cc2f..f389fa35f9 100644 --- a/source4/torture/basic/properties.c +++ b/source4/torture/basic/properties.c @@ -88,8 +88,8 @@ static void show_bits(const struct bitmapping *bm, uint32_t value) /* print out server properties */ -BOOL torture_test_properties(struct torture_context *torture, - struct smbcli_state *cli) +bool torture_test_properties(struct torture_context *torture, + struct smbcli_state *cli) { BOOL correct = True; union smb_fsinfo fs; diff --git a/source4/torture/basic/rename.c b/source4/torture/basic/rename.c index 572048e0ea..12fd5e1c99 100644 --- a/source4/torture/basic/rename.c +++ b/source4/torture/basic/rename.c @@ -27,8 +27,8 @@ /* Test rename on files open with share delete and no share delete. */ -BOOL torture_test_rename(struct torture_context *tctx, - struct smbcli_state *cli1) +bool torture_test_rename(struct torture_context *tctx, + struct smbcli_state *cli1) { const char *fname = "\\test.txt"; const char *fname1 = "\\test1.txt"; diff --git a/source4/torture/basic/unlink.c b/source4/torture/basic/unlink.c index 60d5a1554d..bb829051a2 100644 --- a/source4/torture/basic/unlink.c +++ b/source4/torture/basic/unlink.c @@ -33,7 +33,7 @@ 1) the server does not allow an unlink on a file that is open */ -BOOL torture_unlinktest(struct torture_context *tctx, struct smbcli_state *cli) +bool torture_unlinktest(struct torture_context *tctx, struct smbcli_state *cli) { const char *fname = BASEDIR "\\unlink.tst"; int fnum; diff --git a/source4/torture/nbench/nbio.c b/source4/torture/nbench/nbio.c index 9624a7b14f..e35b9d14ab 100644 --- a/source4/torture/nbench/nbio.c +++ b/source4/torture/nbench/nbio.c @@ -386,7 +386,7 @@ static struct smbcli_state *c; static BOOL oplock_handler(struct smbcli_transport *transport, uint16_t tid, uint16_t fnum, uint8_t level, void *private) { - struct smbcli_tree *tree = private; + struct smbcli_tree *tree = (struct smbcli_tree *)private; return smbcli_oplock_ack(tree, fnum, OPLOCK_BREAK_TO_NONE); } diff --git a/source4/torture/nbt/dgram.c b/source4/torture/nbt/dgram.c index 2effe25ab7..ee97242de5 100644 --- a/source4/torture/nbt/dgram.c +++ b/source4/torture/nbt/dgram.c @@ -42,7 +42,7 @@ static void netlogon_handler(struct dgram_mailslot_handler *dgmslot, { NTSTATUS status; struct nbt_netlogon_packet netlogon; - int *replies = dgmslot->private; + int *replies = (int *)dgmslot->private; printf("netlogon reply from %s:%d\n", src->addr, src->port); @@ -227,7 +227,7 @@ static void ntlogon_handler(struct dgram_mailslot_handler *dgmslot, { NTSTATUS status; struct nbt_ntlogon_packet ntlogon; - int *replies = dgmslot->private; + int *replies = (int *)dgmslot->private; printf("ntlogon reply from %s:%d\n", src->addr, src->port); diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 78f6352ed6..0d9e758647 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -220,7 +220,7 @@ static bool test_assoc_ctx2(struct torture_context *tctx) /* display a replication entry */ -static void display_entry(TALLOC_CTX *tctx, struct wrepl_name *name) +static void display_entry(struct torture_context *tctx, struct wrepl_name *name) { int i; @@ -537,8 +537,8 @@ static const struct wrepl_ip addresses_X_3_4[] = { } }; -static struct test_wrepl_conflict_conn *test_create_conflict_ctx(TALLOC_CTX *tctx, - const char *address) +static struct test_wrepl_conflict_conn *test_create_conflict_ctx( + struct torture_context *tctx, const char *address) { struct test_wrepl_conflict_conn *ctx; struct wrepl_associate associate; @@ -9450,7 +9450,8 @@ static void test_conflict_owned_active_vs_replica_handler_query(struct nbt_name_ { struct nbt_name *name; struct nbt_name_packet *rep_packet; - struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private; + struct test_conflict_owned_active_vs_replica_struct *rec = + (struct test_conflict_owned_active_vs_replica_struct *)nbtsock->incoming.private; _NBT_ASSERT(req_packet->qdcount, 1); _NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS); @@ -9546,7 +9547,8 @@ static void test_conflict_owned_active_vs_replica_handler_release( { struct nbt_name *name; struct nbt_name_packet *rep_packet; - struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private; + struct test_conflict_owned_active_vs_replica_struct *rec = + (struct test_conflict_owned_active_vs_replica_struct *)nbtsock->incoming.private; _NBT_ASSERT(req_packet->qdcount, 1); _NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS); @@ -9597,7 +9599,8 @@ static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket struct nbt_name_packet *req_packet, struct socket_address *src) { - struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private; + struct test_conflict_owned_active_vs_replica_struct *rec = + (struct test_conflict_owned_active_vs_replica_struct *)nbtsock->incoming.private; rec->defend.ret = false; diff --git a/source4/torture/raw/chkpath.c b/source4/torture/raw/chkpath.c index a56afee546..6240584a68 100644 --- a/source4/torture/raw/chkpath.c +++ b/source4/torture/raw/chkpath.c @@ -215,7 +215,7 @@ done: basic testing of chkpath calls */ bool torture_raw_chkpath(struct torture_context *torture, - struct smbcli_state *cli) + struct smbcli_state *cli) { bool ret = true; int fnum; diff --git a/source4/torture/raw/close.c b/source4/torture/raw/close.c index 34ac2f0db8..6f139f8530 100644 --- a/source4/torture/raw/close.c +++ b/source4/torture/raw/close.c @@ -28,7 +28,7 @@ * basic testing of all RAW_CLOSE_* calls */ bool torture_raw_close(struct torture_context *torture, - struct smbcli_state *cli) + struct smbcli_state *cli) { bool ret = true; union smb_close io; diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c index 374ff3cb98..e66ebcde02 100644 --- a/source4/torture/raw/composite.c +++ b/source4/torture/raw/composite.c @@ -400,7 +400,7 @@ static BOOL test_fsinfo(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) basic testing of libcli composite calls */ bool torture_raw_composite(struct torture_context *tctx, - struct smbcli_state *cli) + struct smbcli_state *cli) { bool ret = true; diff --git a/source4/torture/raw/context.c b/source4/torture/raw/context.c index df7f5f3851..11cb91768b 100644 --- a/source4/torture/raw/context.c +++ b/source4/torture/raw/context.c @@ -886,7 +886,7 @@ static bool torture_raw_context_int(struct torture_context *tctx, basic testing of session/tree context calls */ bool torture_raw_context(struct torture_context *torture, - struct smbcli_state *cli) + struct smbcli_state *cli) { bool ret = true; if (lp_use_spnego()) { diff --git a/source4/torture/raw/eas.c b/source4/torture/raw/eas.c index 7e9c742943..b6eedbc586 100644 --- a/source4/torture/raw/eas.c +++ b/source4/torture/raw/eas.c @@ -463,7 +463,7 @@ bool torture_raw_eas(struct torture_context *torture, struct smbcli_state *cli) /* test max EA size */ -BOOL torture_max_eas(struct torture_context *torture) +bool torture_max_eas(struct torture_context *torture) { struct smbcli_state *cli; BOOL ret = True; diff --git a/source4/torture/raw/ioctl.c b/source4/torture/raw/ioctl.c index 8e98822e11..357332c716 100644 --- a/source4/torture/raw/ioctl.c +++ b/source4/torture/raw/ioctl.c @@ -152,7 +152,7 @@ done: basic testing of some ioctl calls */ bool torture_raw_ioctl(struct torture_context *torture, - struct smbcli_state *cli) + struct smbcli_state *cli) { bool ret = true; diff --git a/source4/torture/raw/mkdir.c b/source4/torture/raw/mkdir.c index 0e2fd1afe0..071783a277 100644 --- a/source4/torture/raw/mkdir.c +++ b/source4/torture/raw/mkdir.c @@ -160,8 +160,8 @@ done: /* basic testing of all RAW_MKDIR_* calls */ -BOOL torture_raw_mkdir(struct torture_context *torture, - struct smbcli_state *cli) +bool torture_raw_mkdir(struct torture_context *torture, + struct smbcli_state *cli) { bool ret = true; diff --git a/source4/torture/raw/notify.c b/source4/torture/raw/notify.c index 1540a4a2dd..7d0d46d3d1 100644 --- a/source4/torture/raw/notify.c +++ b/source4/torture/raw/notify.c @@ -1019,7 +1019,7 @@ done: static void tcp_dis_handler(struct smbcli_transport *t, void *p) { - struct smbcli_state *cli = p; + struct smbcli_state *cli = (struct smbcli_state *)p; smbcli_transport_dead(cli->transport, NT_STATUS_LOCAL_DISCONNECT); cli->transport = NULL; cli->tree = NULL; @@ -1284,8 +1284,8 @@ done: basic testing of change notify */ bool torture_raw_notify(struct torture_context *torture, - struct smbcli_state *cli, - struct smbcli_state *cli2) + struct smbcli_state *cli, + struct smbcli_state *cli2) { bool ret = true; diff --git a/source4/torture/raw/oplock.c b/source4/torture/raw/oplock.c index 7a921af422..ad7676dcac 100644 --- a/source4/torture/raw/oplock.c +++ b/source4/torture/raw/oplock.c @@ -53,10 +53,11 @@ static struct { /* a handler function for oplock break requests. Ack it as a break to level II if possible */ -static BOOL oplock_handler_ack_to_levelII(struct smbcli_transport *transport, uint16_t tid, - uint16_t fnum, uint8_t level, void *private) +static bool oplock_handler_ack_to_levelII(struct smbcli_transport *transport, + uint16_t tid, uint16_t fnum, + uint8_t level, void *private) { - struct smbcli_tree *tree = private; + struct smbcli_tree *tree = (struct smbcli_tree *)private; break_info.fnum = fnum; break_info.level = level; break_info.count++; @@ -69,11 +70,11 @@ static BOOL oplock_handler_ack_to_levelII(struct smbcli_transport *transport, ui /* a handler function for oplock break requests. Ack it as a break to none */ -static BOOL oplock_handler_ack_to_none(struct smbcli_transport *transport, uint16_t tid, - uint16_t fnum, uint8_t level, - void *private) +static bool oplock_handler_ack_to_none(struct smbcli_transport *transport, + uint16_t tid, uint16_t fnum, + uint8_t level, void *private) { - struct smbcli_tree *tree = private; + struct smbcli_tree *tree = (struct smbcli_tree *)private; break_info.fnum = fnum; break_info.level = level; break_info.count++; @@ -100,7 +101,7 @@ static BOOL oplock_handler_close(struct smbcli_transport *transport, uint16_t ti uint16_t fnum, uint8_t level, void *private) { union smb_close io; - struct smbcli_tree *tree = private; + struct smbcli_tree *tree = (struct smbcli_tree *)private; struct smbcli_request *req; break_info.fnum = fnum; @@ -1406,10 +1407,11 @@ static struct hold_oplock_info { NTCREATEX_SHARE_ACCESS_READ|NTCREATEX_SHARE_ACCESS_WRITE|NTCREATEX_SHARE_ACCESS_DELETE, }, }; -static BOOL oplock_handler_hold(struct smbcli_transport *transport, uint16_t tid, - uint16_t fnum, uint8_t level, void *private) +static bool oplock_handler_hold(struct smbcli_transport *transport, + uint16_t tid, uint16_t fnum, uint8_t level, + void *private) { - struct smbcli_tree *tree = private; + struct smbcli_tree *tree = (struct smbcli_tree *)private; struct hold_oplock_info *info; int i; @@ -1444,7 +1446,8 @@ static BOOL oplock_handler_hold(struct smbcli_transport *transport, uint16_t tid BOOL torture_hold_oplock(struct torture_context *torture, struct smbcli_state *cli) { - struct event_context *ev = cli->transport->socket->event.ctx; + struct event_context *ev = + (struct event_context *)cli->transport->socket->event.ctx; int i; printf("Setting up open files with oplocks in %s\n", BASEDIR); diff --git a/source4/torture/raw/read.c b/source4/torture/raw/read.c index f1048f25ac..3c108dce2d 100644 --- a/source4/torture/raw/read.c +++ b/source4/torture/raw/read.c @@ -93,7 +93,7 @@ static bool test_read(struct torture_context *tctx, struct smbcli_state *cli) const char *test_data = "TEST DATA"; uint_t seed = time(NULL); - buf = talloc_zero_size(tctx, maxsize); + buf = talloc_zero_array(tctx, uint8_t, maxsize); if (!torture_setup_dir(cli, BASEDIR)) { return False; @@ -220,7 +220,7 @@ static bool test_lockread(struct torture_context *tctx, const char *test_data = "TEST DATA"; uint_t seed = time(NULL); - buf = talloc_zero_size(tctx, maxsize); + buf = talloc_zero_array(tctx, uint8_t, maxsize); if (!torture_setup_dir(cli, BASEDIR)) { return False; @@ -365,7 +365,7 @@ static bool test_readx(struct torture_context *tctx, struct smbcli_state *cli) const char *test_data = "TEST DATA"; uint_t seed = time(NULL); - buf = talloc_zero_size(tctx, maxsize); + buf = talloc_zero_array(tctx, uint8_t, maxsize); if (!torture_setup_dir(cli, BASEDIR)) { return False; @@ -604,7 +604,7 @@ static bool test_readbraw(struct torture_context *tctx, const char *test_data = "TEST DATA"; uint_t seed = time(NULL); - buf = talloc_zero_size(tctx, maxsize); + buf = talloc_zero_array(tctx, uint8_t, maxsize); if (!torture_setup_dir(cli, BASEDIR)) { return False; @@ -778,7 +778,7 @@ static bool test_read_for_execute(struct torture_context *tctx, const char *fname = BASEDIR "\\test.txt"; const uint8_t data[] = "TEST DATA"; - buf = talloc_zero_size(tctx, maxsize); + buf = talloc_zero_array(tctx, uint8_t, maxsize); if (!torture_setup_dir(cli, BASEDIR)) { return False; diff --git a/source4/torture/raw/samba3hide.c b/source4/torture/raw/samba3hide.c index 3fe151f009..309f65487a 100644 --- a/source4/torture/raw/samba3hide.c +++ b/source4/torture/raw/samba3hide.c @@ -125,7 +125,7 @@ static NTSTATUS smbcli_chmod(struct smbcli_tree *tree, const char *fname, return smb_raw_setpathinfo(tree, &sfinfo); } -BOOL torture_samba3_hide(struct torture_context *torture) +bool torture_samba3_hide(struct torture_context *torture) { struct smbcli_state *cli; const char *fname = "test.txt"; @@ -274,7 +274,7 @@ BOOL torture_samba3_hide(struct torture_context *torture) * close. smb_close should return NT_STATUS_ACCESS_DENIED. */ -BOOL torture_samba3_closeerr(struct torture_context *tctx) +bool torture_samba3_closeerr(struct torture_context *tctx) { struct smbcli_state *cli = NULL; BOOL result = False; diff --git a/source4/torture/raw/samba3misc.c b/source4/torture/raw/samba3misc.c index e1b1fcaf6d..57595dab44 100644 --- a/source4/torture/raw/samba3misc.c +++ b/source4/torture/raw/samba3misc.c @@ -34,7 +34,7 @@ } \ } while (0) -BOOL torture_samba3_checkfsp(struct torture_context *torture) +bool torture_samba3_checkfsp(struct torture_context *torture) { struct smbcli_state *cli; const char *fname = "test.txt"; @@ -323,7 +323,7 @@ static NTSTATUS raw_smbcli_ntcreate(struct smbcli_tree *tree, const char *fname, } -BOOL torture_samba3_badpath(struct torture_context *torture) +bool torture_samba3_badpath(struct torture_context *torture) { struct smbcli_state *cli_nt; struct smbcli_state *cli_dos; @@ -607,7 +607,7 @@ static void count_fn(struct clilist_file_info *info, const char *name, *counter += 1; } -BOOL torture_samba3_caseinsensitive(struct torture_context *torture) +bool torture_samba3_caseinsensitive(struct torture_context *torture) { struct smbcli_state *cli; TALLOC_CTX *mem_ctx; @@ -672,7 +672,7 @@ BOOL torture_samba3_caseinsensitive(struct torture_context *torture) * on an underlying file */ -BOOL torture_samba3_posixtimedlock(struct torture_context *tctx) +bool torture_samba3_posixtimedlock(struct torture_context *tctx) { struct smbcli_state *cli; NTSTATUS status; diff --git a/source4/torture/raw/search.c b/source4/torture/raw/search.c index b1931d9359..7b6529245b 100644 --- a/source4/torture/raw/search.c +++ b/source4/torture/raw/search.c @@ -32,7 +32,7 @@ */ static BOOL single_search_callback(void *private, const union smb_search_data *file) { - union smb_search_data *data = private; + union smb_search_data *data = (union smb_search_data *)private; *data = *file; @@ -511,7 +511,7 @@ struct multiple_result { */ static BOOL multiple_search_callback(void *private, const union smb_search_data *file) { - struct multiple_result *data = private; + struct multiple_result *data = (struct multiple_result *)private; data->count++; @@ -541,7 +541,7 @@ static NTSTATUS multiple_search(struct smbcli_state *cli, union smb_search_next io2; NTSTATUS status; const int per_search = 100; - struct multiple_result *result = data; + struct multiple_result *result = (struct multiple_result *)data; if (data_level == RAW_SEARCH_DATA_SEARCH) { io.search_first.level = RAW_SEARCH_SEARCH; diff --git a/source4/torture/raw/streams.c b/source4/torture/raw/streams.c index 24428efcf7..c51c6ea2df 100644 --- a/source4/torture/raw/streams.c +++ b/source4/torture/raw/streams.c @@ -73,7 +73,7 @@ static BOOL check_stream(struct smbcli_state *cli, TALLOC_CTX *mem_ctx, return False; } - buf = talloc_size(mem_ctx, strlen(value)+11); + buf = talloc_array(mem_ctx, uint8_t, strlen(value)+11); ret = smbcli_read(cli->tree, fnum, buf, 0, strlen(value)+11); if (ret != strlen(value)) { diff --git a/source4/torture/raw/unlink.c b/source4/torture/raw/unlink.c index c307b14e08..860a09727d 100644 --- a/source4/torture/raw/unlink.c +++ b/source4/torture/raw/unlink.c @@ -439,8 +439,7 @@ done: */ struct torture_suite *torture_raw_unlink(TALLOC_CTX *mem_ctx) { - struct torture_suite *suite = torture_suite_create(mem_ctx, - "UNLINK"); + struct torture_suite *suite = torture_suite_create(mem_ctx, "UNLINK"); torture_suite_add_1smb_test(suite, "unlink", test_unlink); torture_suite_add_1smb_test(suite, "delete_on_close", test_delete_on_close); diff --git a/source4/torture/raw/write.c b/source4/torture/raw/write.c index b704a19ed6..6151c60a71 100644 --- a/source4/torture/raw/write.c +++ b/source4/torture/raw/write.c @@ -108,7 +108,7 @@ static bool test_write(struct torture_context *tctx, uint_t seed = time(NULL); union smb_fileinfo finfo; - buf = talloc_zero_size(tctx, maxsize); + buf = talloc_zero_array(tctx, uint8_t, maxsize); if (!torture_setup_dir(cli, BASEDIR)) { return False; @@ -242,7 +242,7 @@ static bool test_writex(struct torture_context *tctx, torture_comment(tctx, "dangerous not set - limiting range of test to 2^%d\n", max_bits); } - buf = talloc_zero_size(tctx, maxsize); + buf = talloc_zero_array(tctx, uint8_t, maxsize); if (!torture_setup_dir(cli, BASEDIR)) { return False; @@ -424,7 +424,7 @@ static bool test_writeunlock(struct torture_context *tctx, uint_t seed = time(NULL); union smb_fileinfo finfo; - buf = talloc_zero_size(tctx, maxsize); + buf = talloc_zero_array(tctx, uint8_t, maxsize); if (!torture_setup_dir(cli, BASEDIR)) { return False; @@ -567,7 +567,7 @@ static bool test_writeclose(struct torture_context *tctx, uint_t seed = time(NULL); union smb_fileinfo finfo; - buf = talloc_zero_size(tctx, maxsize); + buf = talloc_zero_array(tctx, uint8_t, maxsize); if (!torture_setup_dir(cli, BASEDIR)) { return False; |