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

View File

@@ -1,5 +1,4 @@
/* See LICENSE file for copyright and license details. */
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <wchar.h>
@@ -13,7 +12,7 @@ typedef struct {
static int expand(Fdescr *f, int tabstop);
static bool iflag = false;
static int iflag = 0;
static void
usage(void)
@@ -30,7 +29,7 @@ main(int argc, char *argv[])
ARGBEGIN {
case 'i':
iflag = true;
iflag = 1;
break;
case 't':
tabstop = estrtol(EARGF(usage()), 0);
@@ -82,7 +81,7 @@ expand(Fdescr *dsc, int tabstop)
{
int col = 0;
wint_t c;
bool bol = true;
int bol = 1;
for (;;) {
c = in(dsc);
@@ -104,18 +103,18 @@ expand(Fdescr *dsc, int tabstop)
case '\b':
if (col)
col--;
bol = false;
bol = 0;
out(c);
break;
case '\n':
col = 0;
bol = true;
bol = 1;
out(c);
break;
default:
col++;
if (c != ' ')
bol = false;
bol = 0;
out(c);
break;
}