This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RFC patch mi-cmds.c table format (pedantic)


Hi Andrew, in this change:
	http://sources.redhat.com/ml/gdb-patches/2003-08/msg00052.html

the mi-cmds table changed from this format:

  {"break-info", "info break %s", 0},
  {"break-insert", 0, 0, mi_cmd_break_insert},

to this format:

  { "break-info", { "info break", 1 }, NULL, NULL },
  { "break-insert", { NULL, 0 }, 0, mi_cmd_break_insert},

As you can see here, the use of 0 vs NULL is inconsistent, and the spacing on the close parens on the last arg is inconsistent. The implied initialization of 0 is also used in many places. All of this is valid, but it could be a bit more consistent. So instead of

-  { "break-insert", { NULL, 0 }, 0, mi_cmd_break_insert},
+  { "break-insert", { NULL, 0 }, NULL, mi_cmd_break_insert},

-  { "exec-step", { NULL, 0 }, mi_cmd_exec_step},
+  { "exec-step", { NULL, 0 }, mi_cmd_exec_step, NULL},

-  { NULL, }
+  { NULL, { NULL, 0 }, NULL, NULL}


I didn't address the space before the closing } on each line because that would have bloated this pointless patch even more :-), but I thought I'd mention it.


Andrew, if you think this is worth of submitting for real I'll run it through the testsuite to be sure it's OK. It compiles without warnings.

J

Attachment: pa.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]