Skip to content

Commit 608bb36

Browse files
field: Inline fe_verify fields in repr headers
Otherwise, the repr headers field_AxB.h would need to include field.h to be self-contained but this recursive inclusion leaves clangd confused, see clangd/clangd#337 .
1 parent 755349d commit 608bb36

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

src/field.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,6 @@
2929
* implementation also provides a secp256k1_fe_verify routine to verify that
3030
* these fields match the run-time value and perform internal consistency
3131
* checks. */
32-
#ifdef VERIFY
33-
# define SECP256K1_FE_VERIFY_FIELDS \
34-
int magnitude; \
35-
int normalized;
36-
#else
37-
# define SECP256K1_FE_VERIFY_FIELDS
38-
#endif
3932

4033
#if defined(SECP256K1_WIDEMUL_INT128)
4134
#include "field_5x52.h"

src/field_10x26.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ typedef struct {
3030
* sum(i=0..9, n[i] << (i*26)) < p
3131
* (together these imply n[9] <= 2^22 - 1)
3232
*/
33-
SECP256K1_FE_VERIFY_FIELDS
33+
#ifdef VERIFY
34+
int magnitude;
35+
int normalized;
36+
#endif
3437
} secp256k1_fe;
3538

3639
/* Unpacks a constant into a overlapping multi-limbed FE element. */

src/field_5x52.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ typedef struct {
3030
* sum(i=0..4, n[i] << (i*52)) < p
3131
* (together these imply n[4] <= 2^48 - 1)
3232
*/
33-
SECP256K1_FE_VERIFY_FIELDS
33+
#ifdef VERIFY
34+
int magnitude;
35+
int normalized;
36+
#endif
3437
} secp256k1_fe;
3538

3639
/* Unpacks a constant into a overlapping multi-limbed FE element. */

0 commit comments

Comments
 (0)