diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2025-08-12 09:36:36 +0100 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2025-08-12 09:36:36 +0100 |
| commit | 50bd8f0f568120e554d416f474cc72247d0b3240 (patch) | |
| tree | 236b8ebed5af17f8220981deffd69b97f0d08fe7 /src/solvers/h48/utils.h | |
| parent | 315d0f118f3d5ec2578249182f7b0eebf99d2943 (diff) | |
| parent | b36ed11e322152ff9ab813af78a08c35b42d5f94 (diff) | |
| download | nissy-core-50bd8f0f568120e554d416f474cc72247d0b3240.tar.gz nissy-core-50bd8f0f568120e554d416f474cc72247d0b3240.zip | |
Merge branch 'master' of https://github.com/sebastianotronto/nissy-core into windows
Diffstat (limited to 'src/solvers/h48/utils.h')
| -rw-r--r-- | src/solvers/h48/utils.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/solvers/h48/utils.h b/src/solvers/h48/utils.h index b266c66..aa2ddde 100644 --- a/src/solvers/h48/utils.h +++ b/src/solvers/h48/utils.h | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | #if SIZE_MAX == UINT64_MAX | ||
| 2 | #define H48_HMAX UINT8_C(11) | ||
| 3 | #else | ||
| 4 | #define H48_HMAX UINT8_C(7) | ||
| 5 | #endif | ||
| 6 | |||
| 1 | long long parse_h48_hk( | 7 | long long parse_h48_hk( |
| 2 | const char *, uint8_t [static 1], uint8_t [static 1]); | 8 | const char *, uint8_t [static 1], uint8_t [static 1]); |
| 3 | STATIC long long dataid_h48(const char *, char [static NISSY_SIZE_DATAID]); | 9 | STATIC long long dataid_h48(const char *, char [static NISSY_SIZE_DATAID]); |
| @@ -18,8 +24,9 @@ parse_h48_hk(const char *buf, uint8_t h[static 1], uint8_t k[static 1]) | |||
| 18 | buf++; | 24 | buf++; |
| 19 | 25 | ||
| 20 | *h = atoi(buf); | 26 | *h = atoi(buf); |
| 21 | if (*h > 11) { | 27 | if (*h > H48_HMAX) { |
| 22 | LOG("[H48] Invalid value %" PRIu8 " for parameter h\n", *h); | 28 | LOG("[H48] Invalid value %" PRIu8 " for parameter h (must be " |
| 29 | "at most %" PRIu8 ")\n", *h, H48_HMAX); | ||
| 23 | goto parse_h48_hk_error; | 30 | goto parse_h48_hk_error; |
| 24 | } | 31 | } |
| 25 | 32 | ||
