Un-boolify sbase

It actually makes the binaries smaller, the code easier to read
(gems like "val == true", "val == false" are gone) and actually
predictable in the sense of that we actually know what we're
working with (one bitwise operator was quite adventurous and
should now be fixed).

This is also more consistent with the other suckless projects
around which don't use boolean types.
This commit is contained in:
FRIGN
2014-11-13 21:24:47 +01:00
committed by sin
parent 7d2683ddf2
commit ec8246bbc6
41 changed files with 215 additions and 257 deletions

11
seq.c
View File

@@ -1,5 +1,4 @@
/* See LICENSE file for copyright and license details. */
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -9,7 +8,7 @@
static int digitsleft(const char *);
static int digitsright(const char *);
static bool validfmt(const char *);
static int validfmt(const char *);
static void
usage(void)
@@ -22,7 +21,7 @@ int
main(int argc, char *argv[])
{
const char *starts = "1", *steps = "1", *ends = "1", *sep = "\n";
bool wflag = false;
int wflag = 0;
char *tmp, ftmp[BUFSIZ], *fmt = ftmp;
double start, step, end, out, dir;
int left, right;
@@ -37,7 +36,7 @@ main(int argc, char *argv[])
sep = EARGF(usage());
break;
case 'w':
wflag = true;
wflag = 1;
break;
default:
usage();
@@ -116,7 +115,7 @@ digitsright(const char *d)
return MAX(0, after - shift);
}
static bool
static int
validfmt(const char *fmt)
{
int occur = 0;
@@ -149,6 +148,6 @@ format:
occur++;
goto literal;
default:
return false;
return 0;
}
}