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:
11
grep.c
11
grep.c
@@ -1,6 +1,5 @@
|
||||
/* See LICENSE file for copyright and license details. */
|
||||
#include <regex.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -14,9 +13,9 @@ enum { Match = 0, NoMatch = 1, Error = 2 };
|
||||
static void addpattern(const char *);
|
||||
static int grep(FILE *, const char *);
|
||||
|
||||
static bool eflag = false;
|
||||
static bool vflag = false;
|
||||
static bool many;
|
||||
static int eflag = 0;
|
||||
static int vflag = 0;
|
||||
static int many;
|
||||
static char mode = 0;
|
||||
|
||||
static struct plist {
|
||||
@@ -45,7 +44,7 @@ main(int argc, char *argv[])
|
||||
break;
|
||||
case 'e':
|
||||
addpattern(EARGF(usage()));
|
||||
eflag = true;
|
||||
eflag = 1;
|
||||
break;
|
||||
case 'c':
|
||||
case 'l':
|
||||
@@ -57,7 +56,7 @@ main(int argc, char *argv[])
|
||||
flags |= REG_ICASE;
|
||||
break;
|
||||
case 'v':
|
||||
vflag = true;
|
||||
vflag = 1;
|
||||
break;
|
||||
default:
|
||||
usage();
|
||||
|
Reference in New Issue
Block a user