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:
13
cmp.c
13
cmp.c
@@ -1,5 +1,4 @@
|
||||
/* See LICENSE file for copyright and license details. */
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
@@ -17,19 +16,19 @@ usage(void)
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
bool lflag = false;
|
||||
bool sflag = false;
|
||||
bool same = true;
|
||||
int lflag = 0;
|
||||
int sflag = 0;
|
||||
int same = 1;
|
||||
int b[2], i;
|
||||
long line = 1, n = 1;
|
||||
FILE *fp[2];
|
||||
|
||||
ARGBEGIN {
|
||||
case 'l':
|
||||
lflag = true;
|
||||
lflag = 1;
|
||||
break;
|
||||
case 's':
|
||||
sflag = true;
|
||||
sflag = 1;
|
||||
break;
|
||||
default:
|
||||
usage();
|
||||
@@ -80,7 +79,7 @@ main(int argc, char *argv[])
|
||||
exit(Diff);
|
||||
} else {
|
||||
printf("%4ld %3o %3o\n", n, b[0], b[1]);
|
||||
same = false;
|
||||
same = 0;
|
||||
}
|
||||
}
|
||||
return same ? Same : Diff;
|
||||
|
Reference in New Issue
Block a user