From 77defd2c3b2102a499856d1535d7069556cce843 Mon Sep 17 00:00:00 2001 From: Tim Ruffing Date: Sat, 9 Mar 2019 11:41:21 +0100 Subject: [PATCH] Add secp256k1_ prefix to default callback functions --- src/secp256k1.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/secp256k1.c b/src/secp256k1.c index 6a2e63c4d6..6954e1bcf7 100644 --- a/src/secp256k1.c +++ b/src/secp256k1.c @@ -36,28 +36,28 @@ #ifndef USE_EXTERNAL_DEFAULT_CALLBACKS #include #include -static void default_illegal_callback_fn(const char* str, void* data) { +static void secp256k1_default_illegal_callback_fn(const char* str, void* data) { (void)data; fprintf(stderr, "[libsecp256k1] illegal argument: %s\n", str); abort(); } -static void default_error_callback_fn(const char* str, void* data) { +static void secp256k1_default_error_callback_fn(const char* str, void* data) { (void)data; fprintf(stderr, "[libsecp256k1] internal consistency check failed: %s\n", str); abort(); } #else -void default_illegal_callback_fn(const char* str, void* data); -void default_error_callback_fn(const char* str, void* data); +void secp256k1_default_illegal_callback_fn(const char* str, void* data); +void secp256k1_default_error_callback_fn(const char* str, void* data); #endif static const secp256k1_callback default_illegal_callback = { - default_illegal_callback_fn, + secp256k1_default_illegal_callback_fn, NULL }; static const secp256k1_callback default_error_callback = { - default_error_callback_fn, + secp256k1_default_error_callback_fn, NULL }; @@ -71,8 +71,8 @@ struct secp256k1_context_struct { static const secp256k1_context secp256k1_context_no_precomp_ = { { 0 }, { 0 }, - { default_illegal_callback_fn, 0 }, - { default_error_callback_fn, 0 } + { secp256k1_default_illegal_callback_fn, 0 }, + { secp256k1_default_error_callback_fn, 0 } }; const secp256k1_context *secp256k1_context_no_precomp = &secp256k1_context_no_precomp_; @@ -190,7 +190,7 @@ void secp256k1_context_destroy(secp256k1_context* ctx) { void secp256k1_context_set_illegal_callback(secp256k1_context* ctx, void (*fun)(const char* message, void* data), const void* data) { ARG_CHECK_NO_RETURN(ctx != secp256k1_context_no_precomp); if (fun == NULL) { - fun = default_illegal_callback_fn; + fun = secp256k1_default_illegal_callback_fn; } ctx->illegal_callback.fn = fun; ctx->illegal_callback.data = data; @@ -199,7 +199,7 @@ void secp256k1_context_set_illegal_callback(secp256k1_context* ctx, void (*fun)( void secp256k1_context_set_error_callback(secp256k1_context* ctx, void (*fun)(const char* message, void* data), const void* data) { ARG_CHECK_NO_RETURN(ctx != secp256k1_context_no_precomp); if (fun == NULL) { - fun = default_error_callback_fn; + fun = secp256k1_default_error_callback_fn; } ctx->error_callback.fn = fun; ctx->error_callback.data = data;