Skip to content

Commit

Permalink
Merge #1639: Make static context const
Browse files Browse the repository at this point in the history
432ac57 Make static context const (Daniel Pfeifer)

Pull request description:

  Fixes #1637

ACKs for top commit:
  real-or-random:
    ACK 432ac57

Tree-SHA512: 64e91a02fff8fd31bd6da3a37f25f572877343fb8081693c42a0517fae5cbc3951f38ec372d0a1fd91388596b6d85531d3f154a49208b43b0f56a4c72951c42b
  • Loading branch information
real-or-random committed Feb 25, 2025
2 parents 1b1fc09 + 432ac57 commit 6c2a39d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions include/secp256k1.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,10 @@ typedef int (*secp256k1_nonce_function)(
*
* It is highly recommended to call secp256k1_selftest before using this context.
*/
SECP256K1_API const secp256k1_context *secp256k1_context_static;
SECP256K1_API const secp256k1_context * const secp256k1_context_static;

/** Deprecated alias for secp256k1_context_static. */
SECP256K1_API const secp256k1_context *secp256k1_context_no_precomp
SECP256K1_API const secp256k1_context * const secp256k1_context_no_precomp
SECP256K1_DEPRECATED("Use secp256k1_context_static instead");

/** Perform basic self tests (to be used in conjunction with secp256k1_context_static)
Expand Down
4 changes: 2 additions & 2 deletions src/secp256k1.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ static const secp256k1_context secp256k1_context_static_ = {
{ secp256k1_default_error_callback_fn, 0 },
0
};
const secp256k1_context *secp256k1_context_static = &secp256k1_context_static_;
const secp256k1_context *secp256k1_context_no_precomp = &secp256k1_context_static_;
const secp256k1_context * const secp256k1_context_static = &secp256k1_context_static_;
const secp256k1_context * const secp256k1_context_no_precomp = &secp256k1_context_static_;

/* Helper function that determines if a context is proper, i.e., is not the static context or a copy thereof.
*
Expand Down

0 comments on commit 6c2a39d

Please sign in to comment.