From: Douglas Bagnall Date: Wed, 10 Mar 2021 09:05:37 +0000 (+1300) Subject: util: don't mark impure functions as pure X-Git-Tag: tevent-0.11.0~1562 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c45e0896107ad1097b5cf76d8a60968320a7a737;p=thirdparty%2Fsamba.git util: don't mark impure functions as pure nothing that allocates memory can be pure, unless it guarantees to allocate exactly the same pointer very time (which it does not). Signed-off-by: Douglas Bagnall Reviewed-by: Jeremy Allison --- diff --git a/lib/util/samba_util.h b/lib/util/samba_util.h index f0bfa809d7b..4e279b72df1 100644 --- a/lib/util/samba_util.h +++ b/lib/util/samba_util.h @@ -237,12 +237,12 @@ _PUBLIC_ size_t strhex_to_str(char *p, size_t p_len, const char *strhex, size_t /** * Parse a hex string and return a data blob. */ -_PUBLIC_ _PURE_ DATA_BLOB strhex_to_data_blob(TALLOC_CTX *mem_ctx, const char *strhex) ; +_PUBLIC_ DATA_BLOB strhex_to_data_blob(TALLOC_CTX *mem_ctx, const char *strhex) ; /** * Parse a hex dump and return a data blob */ -_PUBLIC_ _PURE_ DATA_BLOB hexdump_to_data_blob(TALLOC_CTX *mem_ctx, const char *hexdump, size_t len); +_PUBLIC_ DATA_BLOB hexdump_to_data_blob(TALLOC_CTX *mem_ctx, const char *hexdump, size_t len); /** * Print a buf in hex. Assumes dst is at least (srclen*2)+1 large. diff --git a/lib/util/util.c b/lib/util/util.c index 57f19aaa1a1..7d7fb91e875 100644 --- a/lib/util/util.c +++ b/lib/util/util.c @@ -900,7 +900,7 @@ _PUBLIC_ size_t strhex_to_str(char *p, size_t p_len, const char *strhex, size_t /** * Parse a hex string and return a data blob. */ -_PUBLIC_ _PURE_ DATA_BLOB strhex_to_data_blob(TALLOC_CTX *mem_ctx, const char *strhex) +_PUBLIC_ DATA_BLOB strhex_to_data_blob(TALLOC_CTX *mem_ctx, const char *strhex) { DATA_BLOB ret_blob = data_blob_talloc(mem_ctx, NULL, strlen(strhex)/2+1); @@ -916,7 +916,7 @@ _PUBLIC_ _PURE_ DATA_BLOB strhex_to_data_blob(TALLOC_CTX *mem_ctx, const char *s * is generated from dump_data_cb() elsewhere in this file * */ -_PUBLIC_ _PURE_ DATA_BLOB hexdump_to_data_blob(TALLOC_CTX *mem_ctx, const char *hexdump, size_t hexdump_len) +_PUBLIC_ DATA_BLOB hexdump_to_data_blob(TALLOC_CTX *mem_ctx, const char *hexdump, size_t hexdump_len) { DATA_BLOB ret_blob = { 0 }; size_t i = 0;