Change ARG_CHECK_NO_RETURN to ARG_CHECK_VOID which returns (void)

This commit is contained in:
Tim Ruffing 2022-12-07 12:59:45 +01:00
parent cf66f2357c
commit c635c1bfd5

View File

@ -51,9 +51,10 @@
} \ } \
} while(0) } while(0)
#define ARG_CHECK_NO_RETURN(cond) do { \ #define ARG_CHECK_VOID(cond) do { \
if (EXPECT(!(cond), 0)) { \ if (EXPECT(!(cond), 0)) { \
secp256k1_callback_call(&ctx->illegal_callback, #cond); \ secp256k1_callback_call(&ctx->illegal_callback, #cond); \
return; \
} \ } \
} while(0) } while(0)
@ -166,7 +167,7 @@ secp256k1_context* secp256k1_context_clone(const secp256k1_context* ctx) {
} }
void secp256k1_context_preallocated_destroy(secp256k1_context* ctx) { void secp256k1_context_preallocated_destroy(secp256k1_context* ctx) {
ARG_CHECK_NO_RETURN(ctx != secp256k1_context_static); ARG_CHECK_VOID(ctx != secp256k1_context_static);
if (ctx != NULL) { if (ctx != NULL) {
secp256k1_ecmult_gen_context_clear(&ctx->ecmult_gen_ctx); secp256k1_ecmult_gen_context_clear(&ctx->ecmult_gen_ctx);
} }
@ -183,7 +184,7 @@ void secp256k1_context_set_illegal_callback(secp256k1_context* ctx, void (*fun)(
/* We compare pointers instead of checking secp256k1_context_is_proper() here /* We compare pointers instead of checking secp256k1_context_is_proper() here
because setting callbacks is allowed on *copies* of the static context: because setting callbacks is allowed on *copies* of the static context:
it's harmless and makes testing easier. */ it's harmless and makes testing easier. */
ARG_CHECK_NO_RETURN(ctx != secp256k1_context_static); ARG_CHECK_VOID(ctx != secp256k1_context_static);
if (fun == NULL) { if (fun == NULL) {
fun = secp256k1_default_illegal_callback_fn; fun = secp256k1_default_illegal_callback_fn;
} }
@ -195,7 +196,7 @@ void secp256k1_context_set_error_callback(secp256k1_context* ctx, void (*fun)(co
/* We compare pointers instead of checking secp256k1_context_is_proper() here /* We compare pointers instead of checking secp256k1_context_is_proper() here
because setting callbacks is allowed on *copies* of the static context: because setting callbacks is allowed on *copies* of the static context:
it's harmless and makes testing easier. */ it's harmless and makes testing easier. */
ARG_CHECK_NO_RETURN(ctx != secp256k1_context_static); ARG_CHECK_VOID(ctx != secp256k1_context_static);
if (fun == NULL) { if (fun == NULL) {
fun = secp256k1_default_error_callback_fn; fun = secp256k1_default_error_callback_fn;
} }