From 48e07444e834f277665ac2010bd24b0fdc74194a Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 16 Jan 2005 23:32:37 +0000 Subject: r4792: use type safety int the test suite too (This used to be commit 4a963e3b7aa38f0f6907bcd8acaaeb8c7982cafa) --- source4/torture/raw/composite.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'source4/torture') diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c index f1fb6a9829..080db4f2c2 100644 --- a/source4/torture/raw/composite.c +++ b/source4/torture/raw/composite.c @@ -28,7 +28,7 @@ static void loadfile_complete(struct smbcli_composite *c) { - int *count = c->async.private; + int *count = talloc_get_type(c->async.private, int); (*count)++; } @@ -45,7 +45,8 @@ static BOOL test_loadfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) char *data; size_t len = random() % 100000; const int num_ops = 50; - int i, count=0; + int i; + int *count = talloc_zero(mem_ctx, int); data = talloc_array(mem_ctx, uint8_t, len); @@ -72,16 +73,16 @@ static BOOL test_loadfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) for (i=0;itree, &io2); c[i]->async.fn = loadfile_complete; - c[i]->async.private = &count; + c[i]->async.private = count; } printf("waiting for completion\n"); - while (count != num_ops) { + while (*count != num_ops) { event_loop_once(cli->transport->socket->event.ctx); - printf("count=%d\r", count); + printf("count=%d\r", *count); fflush(stdout); } - printf("count=%d\n", count); + printf("count=%d\n", *count); for (i=0;i