Skip to content

Commit

Permalink
Change ARG_CHECK_NO_RETURN to ARG_CHECK_VOID which returns (void)
Browse files Browse the repository at this point in the history
  • Loading branch information
real-or-random committed Dec 8, 2022
1 parent cf66f23 commit c635c1b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/secp256k1.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@
} \
} while(0)

#define ARG_CHECK_NO_RETURN(cond) do { \
#define ARG_CHECK_VOID(cond) do { \
if (EXPECT(!(cond), 0)) { \
secp256k1_callback_call(&ctx->illegal_callback, #cond); \
return; \
} \
} while(0)

Expand Down Expand Up @@ -166,7 +167,7 @@ secp256k1_context* secp256k1_context_clone(const 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) {
secp256k1_ecmult_gen_context_clear(&ctx->ecmult_gen_ctx);
}
Expand All @@ -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
because setting callbacks is allowed on *copies* of the static context:
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) {
fun = secp256k1_default_illegal_callback_fn;
}
Expand All @@ -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
because setting callbacks is allowed on *copies* of the static context:
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) {
fun = secp256k1_default_error_callback_fn;
}
Expand Down

0 comments on commit c635c1b

Please sign in to comment.