Skip to content

Commit 0b70241

Browse files
committed
Merge bitcoin-core#474: Fix header guards using reserved identifiers
abe2d3e Fix header guards using reserved identifiers (Dan Raviv) Pull request description: Identifiers starting with an underscore and followed immediately by a capital letter are reserved by the C++ standard. The only header guards not fixed are those in the headers auto-generated from java. Tree-SHA512: da31b8d718b3c3ffb81b3d12c93ce2d56c176f19a1936776c843fee069dbaa916946556cea16db34e1f977a937924d72c870230ac26e44386706ecd7cb25ba65
2 parents ab1f89f + abe2d3e commit 0b70241

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+165
-163
lines changed

contrib/lax_der_parsing.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@
4848
* 8.3.1.
4949
*/
5050

51-
#ifndef _SECP256K1_CONTRIB_LAX_DER_PARSING_H_
52-
#define _SECP256K1_CONTRIB_LAX_DER_PARSING_H_
51+
#ifndef SECP256K1_CONTRIB_LAX_DER_PARSING_H
52+
#define SECP256K1_CONTRIB_LAX_DER_PARSING_H
5353

5454
#include <secp256k1.h>
5555

56-
# ifdef __cplusplus
56+
#ifdef __cplusplus
5757
extern "C" {
58-
# endif
58+
#endif
5959

6060
/** Parse a signature in "lax DER" format
6161
*
@@ -88,4 +88,4 @@ int ecdsa_signature_parse_der_lax(
8888
}
8989
#endif
9090

91-
#endif
91+
#endif /* SECP256K1_CONTRIB_LAX_DER_PARSING_H */

contrib/lax_der_privatekey_parsing.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@
2525
* library are sufficient.
2626
*/
2727

28-
#ifndef _SECP256K1_CONTRIB_BER_PRIVATEKEY_H_
29-
#define _SECP256K1_CONTRIB_BER_PRIVATEKEY_H_
28+
#ifndef SECP256K1_CONTRIB_BER_PRIVATEKEY_H
29+
#define SECP256K1_CONTRIB_BER_PRIVATEKEY_H
3030

3131
#include <secp256k1.h>
3232

33-
# ifdef __cplusplus
33+
#ifdef __cplusplus
3434
extern "C" {
35-
# endif
35+
#endif
3636

3737
/** Export a private key in DER format.
3838
*
@@ -87,4 +87,4 @@ SECP256K1_WARN_UNUSED_RESULT int ec_privkey_import_der(
8787
}
8888
#endif
8989

90-
#endif
90+
#endif /* SECP256K1_CONTRIB_BER_PRIVATEKEY_H */

include/secp256k1.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
#ifndef _SECP256K1_
2-
# define _SECP256K1_
1+
#ifndef SECP256K1_H
2+
#define SECP256K1_H
33

4-
# ifdef __cplusplus
4+
#ifdef __cplusplus
55
extern "C" {
6-
# endif
6+
#endif
77

88
#include <stddef.h>
99

@@ -614,8 +614,8 @@ SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_combine(
614614
size_t n
615615
) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3);
616616

617-
# ifdef __cplusplus
617+
#ifdef __cplusplus
618618
}
619-
# endif
620-
621619
#endif
620+
621+
#endif /* SECP256K1_H */

include/secp256k1_ecdh.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
#ifndef _SECP256K1_ECDH_
2-
# define _SECP256K1_ECDH_
1+
#ifndef SECP256K1_ECDH_H
2+
#define SECP256K1_ECDH_H
33

4-
# include "secp256k1.h"
4+
#include "secp256k1.h"
55

6-
# ifdef __cplusplus
6+
#ifdef __cplusplus
77
extern "C" {
8-
# endif
8+
#endif
99

1010
/** Compute an EC Diffie-Hellman secret in constant time
1111
* Returns: 1: exponentiation was successful
@@ -24,8 +24,8 @@ SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ecdh(
2424
const unsigned char *privkey
2525
) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4);
2626

27-
# ifdef __cplusplus
27+
#ifdef __cplusplus
2828
}
29-
# endif
30-
3129
#endif
30+
31+
#endif /* SECP256K1_ECDH_H */

include/secp256k1_recovery.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
#ifndef _SECP256K1_RECOVERY_
2-
# define _SECP256K1_RECOVERY_
1+
#ifndef SECP256K1_RECOVERY_H
2+
#define SECP256K1_RECOVERY_H
33

4-
# include "secp256k1.h"
4+
#include "secp256k1.h"
55

6-
# ifdef __cplusplus
6+
#ifdef __cplusplus
77
extern "C" {
8-
# endif
8+
#endif
99

1010
/** Opaque data structured that holds a parsed ECDSA signature,
1111
* supporting pubkey recovery.
@@ -103,8 +103,8 @@ SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ecdsa_recover(
103103
const unsigned char *msg32
104104
) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4);
105105

106-
# ifdef __cplusplus
106+
#ifdef __cplusplus
107107
}
108-
# endif
109-
110108
#endif
109+
110+
#endif /* SECP256K1_RECOVERY_H */

src/basic-config.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
* file COPYING or http://www.opensource.org/licenses/mit-license.php.*
55
**********************************************************************/
66

7-
#ifndef _SECP256K1_BASIC_CONFIG_
8-
#define _SECP256K1_BASIC_CONFIG_
7+
#ifndef SECP256K1_BASIC_CONFIG_H
8+
#define SECP256K1_BASIC_CONFIG_H
99

1010
#ifdef USE_BASIC_CONFIG
1111

@@ -28,5 +28,6 @@
2828
#define USE_FIELD_10X26 1
2929
#define USE_SCALAR_8X32 1
3030

31-
#endif // USE_BASIC_CONFIG
32-
#endif // _SECP256K1_BASIC_CONFIG_
31+
#endif /* USE_BASIC_CONFIG */
32+
33+
#endif /* SECP256K1_BASIC_CONFIG_H */

src/bench.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
* file COPYING or http://www.opensource.org/licenses/mit-license.php.*
55
**********************************************************************/
66

7-
#ifndef _SECP256K1_BENCH_H_
8-
#define _SECP256K1_BENCH_H_
7+
#ifndef SECP256K1_BENCH_H
8+
#define SECP256K1_BENCH_H
99

1010
#include <stdio.h>
1111
#include <math.h>
@@ -63,4 +63,4 @@ void run_benchmark(char *name, void (*benchmark)(void*), void (*setup)(void*), v
6363
printf("us\n");
6464
}
6565

66-
#endif
66+
#endif /* SECP256K1_BENCH_H */

src/ecdsa.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
* file COPYING or http://www.opensource.org/licenses/mit-license.php.*
55
**********************************************************************/
66

7-
#ifndef _SECP256K1_ECDSA_
8-
#define _SECP256K1_ECDSA_
7+
#ifndef SECP256K1_ECDSA_H
8+
#define SECP256K1_ECDSA_H
99

1010
#include <stddef.h>
1111

@@ -18,4 +18,4 @@ static int secp256k1_ecdsa_sig_serialize(unsigned char *sig, size_t *size, const
1818
static int secp256k1_ecdsa_sig_verify(const secp256k1_ecmult_context *ctx, const secp256k1_scalar* r, const secp256k1_scalar* s, const secp256k1_ge *pubkey, const secp256k1_scalar *message);
1919
static int secp256k1_ecdsa_sig_sign(const secp256k1_ecmult_gen_context *ctx, secp256k1_scalar* r, secp256k1_scalar* s, const secp256k1_scalar *seckey, const secp256k1_scalar *message, const secp256k1_scalar *nonce, int *recid);
2020

21-
#endif
21+
#endif /* SECP256K1_ECDSA_H */

src/ecdsa_impl.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
**********************************************************************/
66

77

8-
#ifndef _SECP256K1_ECDSA_IMPL_H_
9-
#define _SECP256K1_ECDSA_IMPL_H_
8+
#ifndef SECP256K1_ECDSA_IMPL_H
9+
#define SECP256K1_ECDSA_IMPL_H
1010

1111
#include "scalar.h"
1212
#include "field.h"
@@ -310,4 +310,4 @@ static int secp256k1_ecdsa_sig_sign(const secp256k1_ecmult_gen_context *ctx, sec
310310
return 1;
311311
}
312312

313-
#endif
313+
#endif /* SECP256K1_ECDSA_IMPL_H */

src/eckey.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
* file COPYING or http://www.opensource.org/licenses/mit-license.php.*
55
**********************************************************************/
66

7-
#ifndef _SECP256K1_ECKEY_
8-
#define _SECP256K1_ECKEY_
7+
#ifndef SECP256K1_ECKEY_H
8+
#define SECP256K1_ECKEY_H
99

1010
#include <stddef.h>
1111

@@ -22,4 +22,4 @@ static int secp256k1_eckey_pubkey_tweak_add(const secp256k1_ecmult_context *ctx,
2222
static int secp256k1_eckey_privkey_tweak_mul(secp256k1_scalar *key, const secp256k1_scalar *tweak);
2323
static int secp256k1_eckey_pubkey_tweak_mul(const secp256k1_ecmult_context *ctx, secp256k1_ge *key, const secp256k1_scalar *tweak);
2424

25-
#endif
25+
#endif /* SECP256K1_ECKEY_H */

0 commit comments

Comments
 (0)