bifcl: Use bools for boolean comparisons

This commit is contained in:
Tim Wojtulewicz 2023-02-23 10:22:04 -07:00
parent 224a42e1f0
commit 8662b29ac6
2 changed files with 8 additions and 8 deletions

View file

@ -23,7 +23,7 @@ char* copy_string(const char* s)
int line_number = 1; int line_number = 1;
extern int in_c_code; extern bool in_c_code;
int check_c_mode(int t) int check_c_mode(int t)
{ {
@ -156,7 +156,7 @@ extern int yyparse();
char* input_filename = nullptr; char* input_filename = nullptr;
char* input_filename_with_path = nullptr; char* input_filename_with_path = nullptr;
char* plugin = nullptr; char* plugin = nullptr;
int alternative_mode = 0; bool alternative_mode = false;
FILE* fp_zeek_init = nullptr; FILE* fp_zeek_init = nullptr;
FILE* fp_func_def = nullptr; FILE* fp_func_def = nullptr;
@ -339,12 +339,12 @@ int main(int argc, char* argv[])
{ {
switch ( opt ) { switch ( opt ) {
case 'p': case 'p':
alternative_mode = 1; alternative_mode = true;
plugin = (char*) optarg; plugin = (char*) optarg;
break; break;
case 's': case 's':
alternative_mode = 1; alternative_mode = true;
break; break;
default: default:

View file

@ -17,7 +17,7 @@ extern int line_number;
extern char* input_filename; extern char* input_filename;
extern char* input_filename_with_path; extern char* input_filename_with_path;
extern char* plugin; extern char* plugin;
extern int alternative_mode; extern bool alternative_mode;
#define print_line_directive(fp) fprintf(fp, "\n#line %d \"%s\"\n", line_number, input_filename_with_path) #define print_line_directive(fp) fprintf(fp, "\n#line %d \"%s\"\n", line_number, input_filename_with_path)
@ -29,7 +29,7 @@ extern FILE* fp_netvar_h;
extern FILE* fp_netvar_def; extern FILE* fp_netvar_def;
extern FILE* fp_netvar_init; extern FILE* fp_netvar_init;
int in_c_code = 0; bool in_c_code = false;
string current_module = GLOBAL_MODULE_NAME; string current_module = GLOBAL_MODULE_NAME;
int definition_type; int definition_type;
string type_name; string type_name;
@ -686,13 +686,13 @@ body: body_start c_body body_end
c_code_begin: /* empty */ c_code_begin: /* empty */
{ {
in_c_code = 1; in_c_code = true;
print_line_directive(fp_func_def); print_line_directive(fp_func_def);
} }
; ;
c_code_end: /* empty */ c_code_end: /* empty */
{ in_c_code = 0; } { in_c_code = false; }
; ;
body_start: TOK_LPB c_code_begin body_start: TOK_LPB c_code_begin