]> vcs.slashdirt.org Git - sw/tic2json.git/commitdiff

vcs.slashdirt.org Git - sw/tic2json.git/commitdiff

git git / sw / tic2json.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7e26f62)
make filter_mode a bool
2021年8月21日 13:31:37 +0000 (15:31 +0200)
2021年8月21日 14:31:06 +0000 (16:31 +0200)

diff --git a/tic2json.c b/tic2json.c
index 76c1cc345413c73b292ce6176d8df1de618a333e..1ce2f4120dacafb7044c5df1d50eb5aca7f61e8f 100644 (file)
--- a/tic2json.c
+++ b/tic2json.c
@@ -27,7 +27,6 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <stdbool.h>
#include <err.h>
#include "tic2json.h"
@@ -40,7 +39,7 @@
int ticv02yylex_destroy();
#endif
-int filter_mode;
+bool filter_mode;
uint8_t *etiq_en; // type: < 255 tokens. This could be made a bit field if memory is a concern
static struct {
@@ -342,7 +341,7 @@ int main(int argc, char **argv)
bool ticset = false;
const char *fconfig = NULL;
- filter_mode = 0;
+ filter_mode = false;
etiq_en = NULL;
memset(&tp, 0, sizeof(tp));
diff --git a/tic2json.h b/tic2json.h
index 6f37e3755935a4bd85bda515a607632eab5003de..c8fb8254d96af547fd904be3e71e571494bb480f 100644 (file)
--- a/tic2json.h
+++ b/tic2json.h
@@ -11,6 +11,7 @@
#include <stdio.h>
#include <inttypes.h>
+#include <stdbool.h>
#ifdef BAREBUILD
#define pr_err(format, ...) /* nothing */
diff --git a/ticv01.l b/ticv01.l
index d27235c8f4cbc7faead9bc3bee7e73d4c8df0ec9..2fac10a24bbc8d115661ba43c078549d90eace25 100644 (file)
--- a/ticv01.l
+++ b/ticv01.l
@@ -64,7 +64,7 @@ SEP \x20
#include "tic2json.h"
#include "ticv01.tab.h"
- extern int filter_mode;
+ extern bool filter_mode;
static uint8_t checksum;
static void crc_calc(void)
diff --git a/ticv01.y b/ticv01.y
index a4dcd9e83df1128090aa326f4263e11db5f58303..d5cac26f61aab82e5b4ea6244725b922ba63b8c0 100644 (file)
--- a/ticv01.y
+++ b/ticv01.y
@@ -27,7 +27,7 @@ int ticv01yylex_destroy();
extern FILE *ticv01yyin;
static void yyerror(const char *);
-extern int filter_mode;
+extern bool filter_mode;
extern uint8_t *etiq_en;
%}
@@ -153,7 +153,7 @@ void parse_config_v01(const char *filename)
if (!etiq_en)
abort(); // OOM
- filter_mode = 1;
+ filter_mode = true;
if (ticv01yyparse()) {
pr_err("%s: filter config error!\n", filename);
exit(-1);
@@ -162,7 +162,7 @@ void parse_config_v01(const char *filename)
fclose(ticv01yyin);
ticv01yylex_destroy();
ticv01yyin = stdin;
- filter_mode = 0;
+ filter_mode = false;
}
#endif /* !BAREBUILD */
diff --git a/ticv02.l b/ticv02.l
index 18d5973e1ed987e5f3e66bf61163fea7ce0c06c0..69179300bfbd562203ebb64f4d142890381ed30b 100644 (file)
--- a/ticv02.l
+++ b/ticv02.l
@@ -49,7 +49,7 @@ SEP \x09
#include "tic2json.h"
#include "ticv02.tab.h"
- extern int filter_mode;
+ extern bool filter_mode;
static uint8_t checksum;
static void crc_calc(void)
diff --git a/ticv02.y b/ticv02.y
index 0282478f02a6d87860d394ceeade48bee7649493..ab16afaa7e496c03a284d2c23d97dd65c7e472b2 100644 (file)
--- a/ticv02.y
+++ b/ticv02.y
@@ -27,7 +27,7 @@ int ticv02yylex_destroy();
extern FILE *ticv02yyin;
static void yyerror(const char *);
-extern int filter_mode;
+extern bool filter_mode;
extern uint8_t *etiq_en;
%}
@@ -211,7 +211,7 @@ void parse_config_v02(const char *filename)
if (!etiq_en)
abort(); // OOM
- filter_mode = 1;
+ filter_mode = true;
if (ticv02yyparse()) {
pr_err("%s: filter config error!\n", filename);
exit(-1);
@@ -220,7 +220,7 @@ void parse_config_v02(const char *filename)
fclose(ticv02yyin);
ticv02yylex_destroy();
ticv02yyin = stdin;
- filter_mode = 0;
+ filter_mode = false;
}
#endif /* !BAREBUILD */
tic2json TIC parser/converter
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /