diff options
author | Werner Koch <wk@gnupg.org> | 2013-12-12 15:13:09 +0100 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2013-12-12 15:28:06 +0100 |
commit | 3b30e9840d4b351c4de73b126e561154cb7df4cc (patch) | |
tree | ef3d2d1127165ef5866840d33ccde9d35a2dee33 /src/misc.c | |
parent | cd548ba2dc777b8b27d8d33182ba733c20222120 (diff) | |
download | libgcrypt-3b30e9840d4b351c4de73b126e561154cb7df4cc.tar.gz |
Remove macro hacks for internal vs. external functions. Part 2 and last.
* src/visibility.h: Remove remaining define/undef hacks for symbol
visibility. Add macros to detect the use of the public functions.
Change all affected functions by replacing them by the x-macros.
* src/g10lib.h: Add internal prototypes.
(xtrymalloc, xtrycalloc, xtrymalloc_secure, xtrycalloc_secure)
(xtryrealloc, xtrystrdup, xmalloc, xcalloc, xmalloc_secure)
(xcalloc_secure, xrealloc, xstrdup, xfree): New macros.
--
The use of xmalloc/xtrymalloc/xfree is a more common pattern than the
gcry_free etc. functions. Those functions behave like those defined
by C and thus for better readability we use these macros and not
the underscore prefixed functions.
Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'src/misc.c')
-rw-r--r-- | src/misc.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -355,7 +355,7 @@ _gcry_log_printmpi (const char *text, gcry_mpi_t mpi) do_printhex (text, sign? "-":"+", "", 1); else do_printhex (text, sign? "-":"+", rawmpi, rawmpilen); - gcry_free (rawmpi); + xfree (rawmpi); } } } @@ -400,7 +400,7 @@ _gcry_log_printsxp (const char *text, gcry_sexp_t sexp) size_t size; size = sexp_sprint (sexp, GCRYSEXP_FMT_ADVANCED, NULL, 0); - p = buf = gcry_xmalloc (size); + p = buf = xmalloc (size); sexp_sprint (sexp, GCRYSEXP_FMT_ADVANCED, buf, size); do @@ -429,7 +429,7 @@ _gcry_log_printsxp (const char *text, gcry_sexp_t sexp) log_printf ("\n"); } while (*p); - gcry_free (buf); + xfree (buf); } else if (text) log_printf ("\n"); |