diff options
Diffstat (limited to 'match')
| -rw-r--r-- | match/match.c | 10 | ||||
| -rw-r--r-- | match/match.h | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/match/match.c b/match/match.c index 604faaf..44297d9 100644 --- a/match/match.c +++ b/match/match.c | |||
| @@ -12,13 +12,9 @@ const float BIG_VALUE = 1e20; | |||
| 12 | 12 | ||
| 13 | typedef unsigned short col_t; | 13 | typedef unsigned short col_t; |
| 14 | 14 | ||
| 15 | #define GETBIT2(m, row, col) ((m[col]>>row)&1U) | 15 | #define GETBIT2(m, row, col) ((m[col]>>(row))&1U) |
| 16 | #define SETBIT2(m, row, col) (m[col]|=(1U<<row)) | 16 | #define SETBIT2(m, row, col) (m[col]|=(1U<<(row))) |
| 17 | #define CLEARBIT2(m, row, col) (m[col]&=~(1U<<row)) | 17 | #define CLEARBIT2(m, row, col) (m[col]&=~(1U<<(row))) |
| 18 | |||
| 19 | #define GETBIT(m, x) ((m>>x)&1U) | ||
| 20 | #define SETBIT(m, x) (m|=(1U<<x)) | ||
| 21 | #define CLEARBIT(m, x) (m&=~(1U<<x)) | ||
| 22 | 18 | ||
| 23 | /********************************************************/ | 19 | /********************************************************/ |
| 24 | 20 | ||
diff --git a/match/match.h b/match/match.h index 8936de4..03bf600 100644 --- a/match/match.h +++ b/match/match.h | |||
| @@ -13,6 +13,10 @@ | |||
| 13 | #define MIN(a, b) ((a) < (b) ? (a) : (b)) | 13 | #define MIN(a, b) ((a) < (b) ? (a) : (b)) |
| 14 | #define MAX(a, b) ((a) < (b) ? (b) : (a)) | 14 | #define MAX(a, b) ((a) < (b) ? (b) : (a)) |
| 15 | 15 | ||
| 16 | #define GETBIT(m, x) ((m>>(x))&1U) | ||
| 17 | #define SETBIT(m, x) (m|=(1U<<(x))) | ||
| 18 | #define CLEARBIT(m, x) (m&=~(1U<<(x))) | ||
| 19 | |||
| 16 | typedef int bool; | 20 | typedef int bool; |
| 17 | 21 | ||
| 18 | //////////////////////////////////////////////////////// | 22 | //////////////////////////////////////////////////////// |
