diff mbox

[2/7] gdb: Use NULL instead of 0 for pointer comparison.

Message ID ca67590dc936ca9fb3290a5352adbbd0b20004ff.1448411121.git.andrew.burgess@embecosm.com
State New
Headers show

Commit Message

Andrew Burgess Nov. 25, 2015, 12:34 a.m. UTC
Small code cleanup, use NULL instead of 0 when checking pointers.  There
should be no user visible changes after this commit.

gdb/ChangeLog:

	* cli/cli-cmds.c (list_command): Use NULL instead of 0 when
	checking pointers.
---
 gdb/ChangeLog      | 5 +++++
 gdb/cli/cli-cmds.c | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

Comments

Pedro Alves Nov. 26, 2015, 12:37 p.m. UTC | #1
On 11/25/2015 12:34 AM, Andrew Burgess wrote:
> Small code cleanup, use NULL instead of 0 when checking pointers.  There
> should be no user visible changes after this commit.
> 
> gdb/ChangeLog:
> 
> 	* cli/cli-cmds.c (list_command): Use NULL instead of 0 when
> 	checking pointers.

OK.  Please feel free to push fixes like these as obvious.

Thanks,
Pedro Alves
diff mbox

Patch

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index d1e6cbf..9c22a9a 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@ 
 2015-11-24  Andrew Burgess  <andrew.burgess@embecosm.com>
 
+	* cli/cli-cmds.c (list_command): Use NULL instead of 0 when
+	checking pointers.
+
+2015-11-24  Andrew Burgess  <andrew.burgess@embecosm.com>
+
 	* source.c (lines_to_list): Make static.
 
 2015-11-23  Simon Marchi  <simon.marchi@ericsson.com>
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index 1886cae..841fc55 100644
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -907,7 +907,7 @@  list_command (char *arg, int from_tty)
   cleanup = make_cleanup (null_cleanup, NULL);
 
   /* Pull in the current default source line if necessary.  */
-  if (arg == 0 || arg[0] == '+' || arg[0] == '-')
+  if (arg == NULL || arg[0] == '+' || arg[0] == '-')
     {
       set_default_source_symtab_and_line ();
       cursal = get_current_source_symtab_and_line ();
@@ -936,7 +936,7 @@  list_command (char *arg, int from_tty)
 
   /* "l" or "l +" lists next ten lines.  */
 
-  if (arg == 0 || strcmp (arg, "+") == 0)
+  if (arg == NULL || strcmp (arg, "+") == 0)
     {
       print_source_lines (cursal.symtab, cursal.line,
 			  cursal.line + get_lines_to_list (), 0);