This is an automated email from Gerrit. Antonio Borneo ([email protected]) just uploaded a new patch set to Gerrit, which you can find at http://openocd.zylin.com/5047
-- gerrit commit 41bd64c3d4d9335b076c2c2805a1d9a7470a4b93 Author: Antonio Borneo <[email protected]> Date: Sun Mar 31 17:55:43 2019 +0200 helper/command: add macro CMD Accessing the variable "cmd" in a COMMAND_HANDLER is confusing because the variable definition is not visible in the prototype, thus "cmd" can be identified by the reader as a global variable defined somewhere else. Add the new macro CMD to make more evident it is a part of the COMMAND_HANDLER. Change-Id: I8f63da593a931045cc404323f143b88c5c80ab5e Signed-off-by: Antonio Borneo <[email protected]> diff --git a/src/helper/command.h b/src/helper/command.h index f9c02e5..9aed282 100644 --- a/src/helper/command.h +++ b/src/helper/command.h @@ -122,6 +122,11 @@ struct command_invocation { #define COMMAND_HELPER(name, extra ...) __COMMAND_HANDLER(name, extra) /** + * Use this macro to access the command being handled, + * rather than accessing the variable directly. It may be moved. + */ +#define CMD (cmd) +/** * Use this macro to access the context of the command being handled, * rather than accessing the variable directly. It may be moved. */ -- _______________________________________________ OpenOCD-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openocd-devel
