gdb/cli: Remove casts of NULL during assignment.
authorAndrew Burgess <andrew.burgess@embecosm.com>
Mon, 31 Aug 2015 20:25:37 +0000 (21:25 +0100)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Fri, 4 Sep 2015 15:50:20 +0000 (16:50 +0100)
In the following code:

    struct symbol *wsym = (struct symbol *) NULL;

the cast of NULL is redundant, it adds noise, and is just one more thing
to change if the type of wsym ever changes.  There are a relatively
small number of places in gdb where the above code pattern is used.
Usually the cast is removed like this:

    struct symbol *wsym = NULL;

This commit updates all the places within the gdb/cli directory where we
cast NULL during assignment, removing the cast.

gdb/ChangeLog:

* cli/cli-decode.c (find_cmd): Remove cast of NULL pointer.

gdb/ChangeLog
gdb/cli/cli-decode.c

index 2ae453f61629ae547f0dca70f247a69010d77aba..fdf2cd17f07ac931a24a3518ee1b3376c2e75a1b 100644 (file)
@@ -1,3 +1,7 @@
+2015-09-04  Andrew Burgess  <andrew.burgess@embecosm.com>
+
+       * cli/cli-decode.c (find_cmd): Remove cast of NULL pointer.
+
 2015-09-04  Andrew Burgess  <andrew.burgess@embecosm.com>
 
        * c-valprint.c (print_unpacked_pointer): Remove cast of NULL
index f5b6fc479fdcaa8404216cc494e8a0b0c7bc7e5b..cab2336ff8f67f192def4dded0f6ffd22e758b7d 100644 (file)
@@ -1219,7 +1219,7 @@ find_cmd (const char *command, int len, struct cmd_list_element *clist,
 {
   struct cmd_list_element *found, *c;
 
-  found = (struct cmd_list_element *) NULL;
+  found = NULL;
   *nfound = 0;
   for (c = clist; c; c = c->next)
     if (!strncmp (command, c->name, len)