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

25
uname.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 <sys/utsname.h>
@@ -16,36 +15,36 @@ usage(void)
int
main(int argc, char *argv[])
{
bool mflag = false;
bool nflag = false;
bool rflag = false;
bool sflag = false;
bool vflag = false;
int mflag = 0;
int nflag = 0;
int rflag = 0;
int sflag = 0;
int vflag = 0;
struct utsname u;
ARGBEGIN {
case 'a':
mflag = nflag = rflag = sflag = vflag = true;
mflag = nflag = rflag = sflag = vflag = 1;
break;
case 'm':
mflag = true;
mflag = 1;
break;
case 'n':
nflag = true;
nflag = 1;
break;
case 'r':
rflag = true;
rflag = 1;
break;
case 's':
sflag = true;
sflag = 1;
break;
case 'v':
vflag = true;
vflag = 1;
break;
default:
usage();
} ARGEND;
if (uname(&u) == -1)
if (uname(&u) < 0)
eprintf("uname:");
if (sflag || !(nflag || rflag || vflag || mflag))