summaryrefslogtreecommitdiff
path: root/librpc/ndr
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2011-02-08 11:49:33 +0100
committerGünther Deschner <gd@samba.org>2011-02-08 14:05:36 +0100
commit947ba448a4d52bfbf03f6ed96e96d172a0c69dce (patch)
treecaf991069caf7f56c768dc0083a75b5e1c569300 /librpc/ndr
parent34722c72f687ad8a357656152aed9f6bafab1cad (diff)
downloadsamba-947ba448a4d52bfbf03f6ed96e96d172a0c69dce.tar.gz
samba-947ba448a4d52bfbf03f6ed96e96d172a0c69dce.tar.bz2
samba-947ba448a4d52bfbf03f6ed96e96d172a0c69dce.zip
libndr: apply some const and make is_valid_policy_hnd a callback to policy_handle_empty.
Guenther
Diffstat (limited to 'librpc/ndr')
-rw-r--r--librpc/ndr/libndr.h2
-rw-r--r--librpc/ndr/uuid.c6
2 files changed, 3 insertions, 5 deletions
diff --git a/librpc/ndr/libndr.h b/librpc/ndr/libndr.h
index f62153596d..67b5372911 100644
--- a/librpc/ndr/libndr.h
+++ b/librpc/ndr/libndr.h
@@ -505,7 +505,7 @@ NDR_SCALAR_PROTO(double, double)
enum ndr_err_code ndr_pull_policy_handle(struct ndr_pull *ndr, int ndr_flags, struct policy_handle *r);
enum ndr_err_code ndr_push_policy_handle(struct ndr_push *ndr, int ndr_flags, const struct policy_handle *r);
void ndr_print_policy_handle(struct ndr_print *ndr, const char *name, const struct policy_handle *r);
-bool policy_handle_empty(struct policy_handle *h);
+bool policy_handle_empty(const struct policy_handle *h);
bool is_valid_policy_hnd(const struct policy_handle *hnd);
bool policy_handle_equal(const struct policy_handle *hnd1,
const struct policy_handle *hnd2);
diff --git a/librpc/ndr/uuid.c b/librpc/ndr/uuid.c
index b6a7fc7071..445b6dda7e 100644
--- a/librpc/ndr/uuid.c
+++ b/librpc/ndr/uuid.c
@@ -331,16 +331,14 @@ _PUBLIC_ char *NS_GUID_string(TALLOC_CTX *mem_ctx, const struct GUID *guid)
guid->node[4], guid->node[5]);
}
-_PUBLIC_ bool policy_handle_empty(struct policy_handle *h)
+_PUBLIC_ bool policy_handle_empty(const struct policy_handle *h)
{
return (h->handle_type == 0 && GUID_all_zero(&h->uuid));
}
_PUBLIC_ bool is_valid_policy_hnd(const struct policy_handle *hnd)
{
- struct policy_handle tmp;
- ZERO_STRUCT(tmp);
- return (memcmp(&tmp, hnd, sizeof(tmp)) != 0);
+ return !policy_handle_empty(hnd);
}
_PUBLIC_ bool policy_handle_equal(const struct policy_handle *hnd1,