Julien Jehannet avatar Julien Jehannet committed 757b56e

use bool datatype (ANSI C99)

Comments (0)

Files changed (2)

 # flags
-CFLAGS   = -ansi -pedantic -Wall -Os ${CPPFLAGS}
+CFLAGS   = -ansi -pedantic -Wall -Os ${CPPFLAGS} -std=c99
 LDFLAGS  = -s
 # compiler and linker
 #include <sys/types.h>
 #include <termios.h>
 #include <unistd.h>
+#include <stdbool.h>
 #define XSEL          "xsel -h >/dev/null 2>&1 && test -n \"$DISPLAY\" && xsel -ob || cat /tmp/.sandy.clipboard.$USER"
 #define CONTROL(ch)   (ch ^ 0x40)
 static void   drawmenu(void);
 static char  *fstrstr(const char*, const char*);
 static void   insert(const char*, ssize_t);
-static void   match(int);
+static void   match(bool);
 static size_t nextrune(int);
 static void   readstdin(void);
 static int    run(void);
-match(int sub) {
+match(bool sub) {
 	size_t len = strlen(text);
 	Item *lexact, *lprefix, *lsubstr, *exactend, *prefixend, *substrend;
 	Item *item, *lnext;
 			strncpy(text, sel->text, sizeof text);
 			cursor = strlen(text);
-			match(TRUE);
+			match(true);
 		case CONTROL('K'):
 			text[cursor] = '\0';
-			match(FALSE);
+			match(false);
 		case CONTROL('U'):
 			insert(NULL, 0 - cursor);
 	inputw=MIN(inputw, mw/3);
-	match(FALSE);
+	match(false);
 	if(position!=0) fprintf(stderr, "\033[%iH", (position>0 || result<0)?0:ws.ws_row);
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.