From 4a03172e66694b51a24f7b5566f361c1f1767e29 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 16 Jan 2005 23:23:45 +0000 Subject: r4791: used the new talloc type safety macros to make the "void *private" pointers in the composite code type safe. This is a bit of an experiement, I'd be interested in comments on whether we should use this more widely. (This used to be commit 0e1da827b380998355f75f4ef4f424802059c278) --- source4/libcli/composite/loadfile.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source4/libcli/composite/loadfile.c') diff --git a/source4/libcli/composite/loadfile.c b/source4/libcli/composite/loadfile.c index 2d38096c88..8290876224 100644 --- a/source4/libcli/composite/loadfile.c +++ b/source4/libcli/composite/loadfile.c @@ -45,7 +45,7 @@ struct loadfile_state { static NTSTATUS setup_close(struct smbcli_composite *c, struct smbcli_tree *tree, uint16_t fnum) { - struct loadfile_state *state = c->private; + struct loadfile_state *state = talloc_get_type(c->private, struct loadfile_state); union smb_close *io_close; /* nothing to read, setup the close */ @@ -74,7 +74,7 @@ static NTSTATUS setup_close(struct smbcli_composite *c, static NTSTATUS loadfile_open(struct smbcli_composite *c, struct smb_composite_loadfile *io) { - struct loadfile_state *state = c->private; + struct loadfile_state *state = talloc_get_type(c->private, struct loadfile_state); struct smbcli_tree *tree = state->req->tree; NTSTATUS status; @@ -128,7 +128,7 @@ static NTSTATUS loadfile_open(struct smbcli_composite *c, static NTSTATUS loadfile_read(struct smbcli_composite *c, struct smb_composite_loadfile *io) { - struct loadfile_state *state = c->private; + struct loadfile_state *state = talloc_get_type(c->private, struct loadfile_state); struct smbcli_tree *tree = state->req->tree; NTSTATUS status; @@ -162,7 +162,7 @@ static NTSTATUS loadfile_read(struct smbcli_composite *c, static NTSTATUS loadfile_close(struct smbcli_composite *c, struct smb_composite_loadfile *io) { - struct loadfile_state *state = c->private; + struct loadfile_state *state = talloc_get_type(c->private, struct loadfile_state); NTSTATUS status; status = smbcli_request_simple_recv(state->req); @@ -183,7 +183,7 @@ static NTSTATUS loadfile_close(struct smbcli_composite *c, static void loadfile_handler(struct smbcli_request *req) { struct smbcli_composite *c = req->async.private; - struct loadfile_state *state = c->private; + struct loadfile_state *state = talloc_get_type(c->private, struct loadfile_state); /* when this handler is called, the stage indicates what call has just finished */ @@ -271,7 +271,7 @@ NTSTATUS smb_composite_loadfile_recv(struct smbcli_composite *c, TALLOC_CTX *mem status = smb_composite_wait(c); if (NT_STATUS_IS_OK(status)) { - struct loadfile_state *state = c->private; + struct loadfile_state *state = talloc_get_type(c->private, struct loadfile_state); talloc_steal(mem_ctx, state->io->out.data); } -- cgit