diff options
-rw-r--r-- | src/main.c | 6 | ||||
-rw-r--r-- | src/parser.y | 3 |
2 files changed, 5 insertions, 4 deletions
@@ -52,11 +52,11 @@ static bool eqnsolve(eqn_t *, uint64_t, uint64_t); static int eqnprint(eqn_t *); static void eqnfree(eqn_t *); -static uint64_t +static int popcnt(uint64_t n) { -#if __has_builtin(__builtin_popcount) - return __builtin_popcount(n); +#if !__has_builtin(__builtin_popcountg) + return __builtin_popcountg(n); #else uint64_t c; for (c = 0; n > 0; n &= n - 1) diff --git a/src/parser.y b/src/parser.y index e424068..07afbe7 100644 --- a/src/parser.y +++ b/src/parser.y @@ -1,6 +1,7 @@ %{ #include <ctype.h> #include <err.h> +#include <stdint.h> #include <stdio.h> #include <stdlib.h> @@ -80,7 +81,7 @@ expr: $$.eqn = xmalloc(sizeof(eqn_t)); $$.eqn->type = IDENT; $$.eqn->ch = $1; - $$.vars = 1 << (islower($1) ? $1-'a'+26 : $1-'A'); + $$.vars = UINT64_C(1) << (islower($1) ? $1-'a'+26 : $1-'A'); } | NOT expr { $$ = mkunop(NOT, $2); } | OPAR expr CPAR { $$ = mkunop(OPAR, $2); } |