From ce3f0ce76f59216ff82ecd79e180a5c59d3d60d0 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Wed, 2 Nov 2011 18:59:40 +0100 Subject: Make use of the NULL macro Use this constant everywhere when referring to a null pointer instead of casting 0 to various types of pointers. Created using following semantic patch: @@ type type; @@ - (type *)0 + NULL Signed-off-by: Lukas Fleischer --- src/args.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'src/args.c') diff --git a/src/args.c b/src/args.c index 150b81c..be85fbe 100644 --- a/src/args.c +++ b/src/args.c @@ -906,10 +906,10 @@ parse_args (int argc, char **argv, struct conf *conf) else if (gflag) { io_init (cfile, datadir); - io_check_dir (path_dir, (int *)0); - io_check_dir (path_notes, (int *)0); - io_check_file (path_apts, (int *)0); - io_check_file (path_todo, (int *)0); + io_check_dir (path_dir, NULL); + io_check_dir (path_notes, NULL); + io_check_file (path_apts, NULL); + io_check_file (path_todo, NULL); io_load_app (); io_load_todo (); note_gc (); @@ -920,13 +920,13 @@ parse_args (int argc, char **argv, struct conf *conf) if (load_data) { io_init (cfile, datadir); - io_check_dir (path_dir, (int *)0); - io_check_dir (path_notes, (int *)0); + io_check_dir (path_dir, NULL); + io_check_dir (path_notes, NULL); } if (iflag) { - io_check_file (path_apts, (int *)0); - io_check_file (path_todo, (int *)0); + io_check_file (path_apts, NULL); + io_check_file (path_todo, NULL); /* Get default pager in case we need to show a log file. */ vars_init (conf); io_load_app (); @@ -938,8 +938,8 @@ parse_args (int argc, char **argv, struct conf *conf) } if (xflag) { - io_check_file (path_apts, (int *)0); - io_check_file (path_todo, (int *)0); + io_check_file (path_apts, NULL); + io_check_file (path_todo, NULL); io_load_app (); io_load_todo (); io_export_data (xfmt, conf); @@ -948,22 +948,22 @@ parse_args (int argc, char **argv, struct conf *conf) } if (tflag) { - io_check_file (path_todo, (int *)0); + io_check_file (path_todo, NULL); io_load_todo (); todo_arg (tnum, Nflag, preg); non_interactive = 1; } if (nflag) { - io_check_file (path_apts, (int *)0); + io_check_file (path_apts, NULL); io_load_app (); next_arg (); non_interactive = 1; } if (dflag || rflag || sflag) { - io_check_file (path_apts, (int *)0); - io_check_file (path_conf, (int *)0); + io_check_file (path_apts, NULL); + io_check_file (path_conf, NULL); io_load_app (); custom_load_conf (conf); /* To get output date format. */ if (dflag) @@ -977,8 +977,8 @@ parse_args (int argc, char **argv, struct conf *conf) { struct date day; - io_check_file (path_apts, (int *)0); - io_check_file (path_conf, (int *)0); + io_check_file (path_apts, NULL); + io_check_file (path_conf, NULL); vars_init (conf); custom_load_conf (conf); /* To get output date format. */ io_load_app (); -- cgit v1.2.3-54-g00ecf