aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-09-04 12:05:04 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-09-04 12:05:04 +0200
commit0d5f7878b54042a11efc34d75761b87e43d20792 (patch)
tree440e55b9956e1815d3450699afdc02f213d05284
parentbdb98719d90223f1a3ca551538c74de4f534796a (diff)
Formatting
-rw-r--r--src/main.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/main.c b/src/main.c
index 8cd8468..fd2fbcc 100644
--- a/src/main.c
+++ b/src/main.c
@@ -99,8 +99,7 @@ astprocess(ast_t a)
const char **symtab = utf8 ? symbols_utf8 : symbols_ascii;
for (int i = 0; i < MAXVARS; i++) {
- bool set = a.vars & UINT64_C(1)<<i;
- if (set)
+ if ((a.vars & UINT64_C(1)<<i) != 0)
printf("%c ", i < 26 ? i + 'A' : i + 'a' - 26);
}
printf("%s ", symtab[TBLVBAR]);
@@ -117,13 +116,12 @@ astprocess(ast_t a)
putchar('\n');
for (uint64_t msk = 0; msk < (UINT64_C(1) << varcnt); msk++) {
- for (int i = varcnt; i --> 0;) {
- bool bit = msk & 1<<i;
- printf("%d ", bit);
- }
- printf("%s ", symtab[TBLVBAR]);
- int w = (eqnw & 1) == 0 ? eqnw / 2 : eqnw/2 + 1;
- printf("% *d\n", w, eqnsolve(a.eqn, a.vars, msk));
+ for (int i = varcnt; i --> 0;)
+ printf("%d ", (bool)(msk & UINT64_C(1)<<i));
+ printf("%s % *d\n",
+ symtab[TBLVBAR],
+ (eqnw & 1) == 0 ? eqnw / 2 : eqnw/2 + 1,
+ eqnsolve(a.eqn, a.vars, msk));
}
eqnfree(a.eqn);