Skip to content

Commit

Permalink
fix: Add brackets to avoid unexpected macro behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
marktwtn committed Jan 3, 2020
1 parent 1af1e2d commit c33068f
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/naming-convention.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ dcurl uses the **[snake case](https://en.wikipedia.org/wiki/Snake_case)** naming

- Macro: Use capital letters
```
#define MIN_TRYTE_VALUE -13
#define MIN_TRYTE_VALUE (-13)
#define MAX_TRYTE_VALUE 13
```

2 changes: 1 addition & 1 deletion src/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#ifndef CONSTANTS_H_
#define CONSTANTS_H_

#define MIN_TRYTE_VALUE -13
#define MIN_TRYTE_VALUE (-13)
#define MAX_TRYTE_VALUE 13
#define SIGNATURE_SIZE 6561
#define DEPTH 3
Expand Down
2 changes: 1 addition & 1 deletion src/pow_avx.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ struct pow_avx_context_s {
#include <x86intrin.h>
#endif

#define INCR_START HASH_TRITS_LENGTH - NONCE_TRITS_LENGTH + 4 + 27
#define INCR_START (HASH_TRITS_LENGTH - NONCE_TRITS_LENGTH + 4 + 27)

#ifdef __AVX2__
#define HBITS 0xFFFFFFFFFFFFFFFFuLL
Expand Down
2 changes: 1 addition & 1 deletion src/pow_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ struct pow_c_context_s {

#define HBITS 0xFFFFFFFFFFFFFFFFuLL
#define LBITS 0x0000000000000000uLL
#define INCR_START HASH_TRITS_LENGTH - NONCE_TRITS_LENGTH + 4 + 27
#define INCR_START (HASH_TRITS_LENGTH - NONCE_TRITS_LENGTH + 4 + 27)
#define LOW0 \
0xDB6DB6DB6DB6DB6DuLL // 0b1101101101101101101101101101101101101101101101101101101101101101L;
#define HIGH0 \
Expand Down
2 changes: 1 addition & 1 deletion src/pow_sse.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ struct pow_sse_context_s {

#define HBITS 0xFFFFFFFFFFFFFFFFuLL
#define LBITS 0x0000000000000000uLL
#define INCR_START HASH_TRITS_LENGTH - NONCE_TRITS_LENGTH + 4 + 27
#define INCR_START (HASH_TRITS_LENGTH - NONCE_TRITS_LENGTH + 4 + 27)
#define LOW00 \
0xDB6DB6DB6DB6DB6DuLL // 0b1101101101101101101101101101101101101101101101101101101101101101L;
#define HIGH00 \
Expand Down

0 comments on commit c33068f

Please sign in to comment.