From cd962355abad90a2161765a7be7d26e63572cab7 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 7 Sep 2007 15:08:14 +0000 Subject: r25000: Fix some more C++ compatibility warnings. (This used to be commit 08bb1ef643ab906f1645cf6f32763dc73b1884e4) --- source4/torture/raw/chkpath.c | 2 +- source4/torture/raw/close.c | 2 +- source4/torture/raw/composite.c | 2 +- source4/torture/raw/context.c | 2 +- source4/torture/raw/eas.c | 2 +- source4/torture/raw/ioctl.c | 2 +- source4/torture/raw/mkdir.c | 4 ++-- source4/torture/raw/notify.c | 6 +++--- source4/torture/raw/oplock.c | 27 +++++++++++++++------------ source4/torture/raw/read.c | 10 +++++----- source4/torture/raw/samba3hide.c | 4 ++-- source4/torture/raw/samba3misc.c | 8 ++++---- source4/torture/raw/search.c | 6 +++--- source4/torture/raw/streams.c | 2 +- source4/torture/raw/unlink.c | 3 +-- source4/torture/raw/write.c | 8 ++++---- 16 files changed, 46 insertions(+), 44 deletions(-) (limited to 'source4/torture/raw') 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; -- cgit