bifcl: Use nullptrs for pointer initializations

This commit is contained in:
Tim Wojtulewicz 2023-02-23 10:21:10 -07:00
parent 4ed4f3e1b8
commit 224a42e1f0
2 changed files with 16 additions and 16 deletions

View file

@ -153,19 +153,19 @@ int yywrap()
}
extern int yyparse();
char* input_filename = 0;
char* input_filename_with_path = 0;
char* plugin = 0;
char* input_filename = nullptr;
char* input_filename_with_path = nullptr;
char* plugin = nullptr;
int alternative_mode = 0;
FILE* fp_zeek_init = 0;
FILE* fp_func_def = 0;
FILE* fp_func_h = 0;
FILE* fp_func_init = 0;
FILE* fp_func_register = 0;
FILE* fp_netvar_h = 0;
FILE* fp_netvar_def = 0;
FILE* fp_netvar_init = 0;
FILE* fp_zeek_init = nullptr;
FILE* fp_func_def = nullptr;
FILE* fp_func_h = nullptr;
FILE* fp_func_init = nullptr;
FILE* fp_func_register = nullptr;
FILE* fp_netvar_h = nullptr;
FILE* fp_netvar_def = nullptr;
FILE* fp_netvar_init = nullptr;
void remove_file(const char *surfix);
void err_exit(void);
@ -201,7 +201,7 @@ void init_alternative_mode()
fp_func_h = open_output_file("h");
fp_func_def = open_output_file("cc");
fp_func_init = open_output_file("init.cc");
fp_func_register = plugin ? open_output_file("register.cc") : NULL;
fp_func_register = plugin ? open_output_file("register.cc") : nullptr;
fp_netvar_h = fp_func_h;
fp_netvar_def = fp_func_def;
@ -425,7 +425,7 @@ void close_if_open(FILE **fpp)
{
if (*fpp)
fclose(*fpp);
*fpp = NULL;
*fpp = nullptr;
}
void close_all_output_files(void)

View file

@ -246,7 +246,7 @@ static void print_event_c_body(FILE* fp)
fprintf(fp, "\t// allocation.\n");
fprintf(fp, "\n");
BuiltinFuncArg* connection_arg = 0;
BuiltinFuncArg* connection_arg = nullptr;
fprintf(fp, "\tzeek::event_mgr.Enqueue(%s, zeek::Args{\n", decl.c_fullname.c_str());
@ -258,7 +258,7 @@ static void print_event_c_body(FILE* fp)
if ( args[i]->Type() == TYPE_CONNECTION )
{
if ( connection_arg == 0 )
if ( connection_arg == nullptr )
connection_arg = args[i];
else
{
@ -567,7 +567,7 @@ plain_head: head_1 args arg_end opt_ws
head_1: TOK_ID opt_ws arg_begin
{
const char* method_type = 0;
const char* method_type = nullptr;
set_decl_name($1);
if ( definition_type == FUNC_DEF )