From 3b30e9840d4b351c4de73b126e561154cb7df4cc Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Thu, 12 Dec 2013 15:13:09 +0100 Subject: 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 --- mpi/mpi-mod.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mpi/mpi-mod.c') diff --git a/mpi/mpi-mod.c b/mpi/mpi-mod.c index 0a8cfb67..88624720 100644 --- a/mpi/mpi-mod.c +++ b/mpi/mpi-mod.c @@ -62,7 +62,7 @@ _gcry_mpi_barrett_init (gcry_mpi_t m, int copy) gcry_mpi_t tmp; mpi_normalize (m); - ctx = gcry_xcalloc (1, sizeof *ctx); + ctx = xcalloc (1, sizeof *ctx); if (copy) { @@ -99,7 +99,7 @@ _gcry_mpi_barrett_free (mpi_barrett_t ctx) mpi_free (ctx->r3); if (ctx->m_copied) mpi_free (ctx->m); - gcry_free (ctx); + xfree (ctx); } } -- cgit v1.2.1