From 5e26e94092b56ee47e7ec7837f7cd0feb3fb0119 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 7 Jun 2011 11:58:39 +1000 Subject: s3-talloc Change TALLOC_ZERO_ARRAY() to talloc_zero_array() Using the standard macro makes it easier to move code into common, as TALLOC_ZERO_ARRAY isn't standard talloc. --- source3/lib/bitmap.c | 2 +- source3/lib/netapi/cm.c | 2 +- source3/lib/netapi/group.c | 8 ++++---- source3/lib/netapi/localgroup.c | 2 +- source3/lib/netapi/user.c | 6 +++--- source3/lib/util_sock.c | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) (limited to 'source3/lib') diff --git a/source3/lib/bitmap.c b/source3/lib/bitmap.c index 0acfcd8813..5216b05c58 100644 --- a/source3/lib/bitmap.c +++ b/source3/lib/bitmap.c @@ -34,7 +34,7 @@ struct bitmap *bitmap_talloc(TALLOC_CTX *mem_ctx, int n) if (!bm) return NULL; bm->n = n; - bm->b = TALLOC_ZERO_ARRAY(bm, uint32, (n+31)/32); + bm->b = talloc_zero_array(bm, uint32, (n+31)/32); if (!bm->b) { TALLOC_FREE(bm); return NULL; diff --git a/source3/lib/netapi/cm.c b/source3/lib/netapi/cm.c index 3adb97e357..47ccf8bb7a 100644 --- a/source3/lib/netapi/cm.c +++ b/source3/lib/netapi/cm.c @@ -188,7 +188,7 @@ static NTSTATUS pipe_cm_connect(TALLOC_CTX *mem_ctx, struct client_pipe_connection *p; NTSTATUS status; - p = TALLOC_ZERO_ARRAY(mem_ctx, struct client_pipe_connection, 1); + p = talloc_zero_array(mem_ctx, struct client_pipe_connection, 1); if (!p) { return NT_STATUS_NO_MEMORY; } diff --git a/source3/lib/netapi/group.c b/source3/lib/netapi/group.c index 4295d9f7bb..710ec3790f 100644 --- a/source3/lib/netapi/group.c +++ b/source3/lib/netapi/group.c @@ -1157,7 +1157,7 @@ static WERROR convert_samr_disp_groups_to_GROUP_INFO_0_buffer(TALLOC_CTX *mem_ct struct GROUP_INFO_0 *g0; int i; - g0 = TALLOC_ZERO_ARRAY(mem_ctx, struct GROUP_INFO_0, groups->count); + g0 = talloc_zero_array(mem_ctx, struct GROUP_INFO_0, groups->count); W_ERROR_HAVE_NO_MEMORY(g0); for (i=0; icount; i++) { @@ -1183,7 +1183,7 @@ static WERROR convert_samr_disp_groups_to_GROUP_INFO_1_buffer(TALLOC_CTX *mem_ct struct GROUP_INFO_1 *g1; int i; - g1 = TALLOC_ZERO_ARRAY(mem_ctx, struct GROUP_INFO_1, groups->count); + g1 = talloc_zero_array(mem_ctx, struct GROUP_INFO_1, groups->count); W_ERROR_HAVE_NO_MEMORY(g1); for (i=0; icount; i++) { @@ -1211,7 +1211,7 @@ static WERROR convert_samr_disp_groups_to_GROUP_INFO_2_buffer(TALLOC_CTX *mem_ct struct GROUP_INFO_2 *g2; int i; - g2 = TALLOC_ZERO_ARRAY(mem_ctx, struct GROUP_INFO_2, groups->count); + g2 = talloc_zero_array(mem_ctx, struct GROUP_INFO_2, groups->count); W_ERROR_HAVE_NO_MEMORY(g2); for (i=0; icount; i++) { @@ -1242,7 +1242,7 @@ static WERROR convert_samr_disp_groups_to_GROUP_INFO_3_buffer(TALLOC_CTX *mem_ct struct GROUP_INFO_3 *g3; int i; - g3 = TALLOC_ZERO_ARRAY(mem_ctx, struct GROUP_INFO_3, groups->count); + g3 = talloc_zero_array(mem_ctx, struct GROUP_INFO_3, groups->count); W_ERROR_HAVE_NO_MEMORY(g3); for (i=0; icount; i++) { diff --git a/source3/lib/netapi/localgroup.c b/source3/lib/netapi/localgroup.c index 54ec14eb84..816afc230f 100644 --- a/source3/lib/netapi/localgroup.c +++ b/source3/lib/netapi/localgroup.c @@ -1115,7 +1115,7 @@ static WERROR NetLocalGroupModifyMembers_r(struct libnetapi_ctx *ctx, ZERO_STRUCT(domain_handle); ZERO_STRUCT(alias_handle); - member_sids = TALLOC_ZERO_ARRAY(ctx, struct dom_sid, + member_sids = talloc_zero_array(ctx, struct dom_sid, r->in.total_entries); W_ERROR_HAVE_NO_MEMORY(member_sids); diff --git a/source3/lib/netapi/user.c b/source3/lib/netapi/user.c index f1182100c7..3003a39397 100644 --- a/source3/lib/netapi/user.c +++ b/source3/lib/netapi/user.c @@ -1436,7 +1436,7 @@ static WERROR convert_samr_dispinfo_to_NET_DISPLAY_USER(TALLOC_CTX *mem_ctx, struct NET_DISPLAY_USER *user = NULL; int i; - user = TALLOC_ZERO_ARRAY(mem_ctx, + user = talloc_zero_array(mem_ctx, struct NET_DISPLAY_USER, info->count); W_ERROR_HAVE_NO_MEMORY(user); @@ -1480,7 +1480,7 @@ static WERROR convert_samr_dispinfo_to_NET_DISPLAY_MACHINE(TALLOC_CTX *mem_ctx, struct NET_DISPLAY_MACHINE *machine = NULL; int i; - machine = TALLOC_ZERO_ARRAY(mem_ctx, + machine = talloc_zero_array(mem_ctx, struct NET_DISPLAY_MACHINE, info->count); W_ERROR_HAVE_NO_MEMORY(machine); @@ -1522,7 +1522,7 @@ static WERROR convert_samr_dispinfo_to_NET_DISPLAY_GROUP(TALLOC_CTX *mem_ctx, struct NET_DISPLAY_GROUP *group = NULL; int i; - group = TALLOC_ZERO_ARRAY(mem_ctx, + group = talloc_zero_array(mem_ctx, struct NET_DISPLAY_GROUP, info->count); W_ERROR_HAVE_NO_MEMORY(group); diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c index 5b01d11bc6..d44adaf915 100644 --- a/source3/lib/util_sock.c +++ b/source3/lib/util_sock.c @@ -1521,7 +1521,7 @@ int poll_one_fd(int fd, int events, int timeout, int *revents) int ret; int saved_errno; - fds = TALLOC_ZERO_ARRAY(talloc_tos(), struct pollfd, 2); + fds = talloc_zero_array(talloc_tos(), struct pollfd, 2); if (fds == NULL) { errno = ENOMEM; return -1; -- cgit