[commit] delete unnecessary init of *list variables

Doug Evans dje@google.com
Wed Jul 17 20:30:00 GMT 2013


Hi.

There's no need to initialize these variables.
Plus when adding new prefix commands one can be left wondering
if one needs to update this function.

This patch removes the issue and simplifies the code.

Committed.

2013-07-17  Doug Evans  <dje@google.com>

	* cli/cli-cmds.c (init_cmd_lists): Delete unnecessary initialization
	of all *list variables.

Index: cli/cli-cmds.c
===================================================================
RCS file: /cvs/src/src/gdb/cli/cli-cmds.c,v
retrieving revision 1.158
diff -u -p -r1.158 cli-cmds.c
--- cli/cli-cmds.c	17 Jul 2013 19:01:48 -0000	1.158
+++ cli/cli-cmds.c	17 Jul 2013 19:49:24 -0000
@@ -1558,27 +1558,6 @@ void
 init_cmd_lists (void)
 {
   max_user_call_depth = 1024;
-
-  cmdlist = NULL;
-  infolist = NULL;
-  enablelist = NULL;
-  disablelist = NULL;
-  stoplist = NULL;
-  deletelist = NULL;
-  detachlist = NULL;
-  setlist = NULL;
-  unsetlist = NULL;
-  showlist = NULL;
-  sethistlist = NULL;
-  showhistlist = NULL;
-  unsethistlist = NULL;
-  maintenancelist = NULL;
-  maintenanceinfolist = NULL;
-  maintenanceprintlist = NULL;
-  setprintlist = NULL;
-  showprintlist = NULL;
-  setchecklist = NULL;
-  showchecklist = NULL;
 }
 
 static void



More information about the Gdb-patches mailing list