aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAntonio Borneo <borneo.antonio@gmail.com>2019-03-31 17:55:43 +0200
committerTomas Vanek <vanekt@fbl.cz>2019-05-14 19:32:49 +0100
commit84cfb727dfce2725d91af9f506bca49c8bb15de2 (patch)
tree9f6da22efcf86b003e0f54adcda097fae8b50b55 /src
parent5e027407e35e898fc4f87abeaef4b8177a51854b (diff)
downloadriscv-openocd-84cfb727dfce2725d91af9f506bca49c8bb15de2.zip
riscv-openocd-84cfb727dfce2725d91af9f506bca49c8bb15de2.tar.gz
riscv-openocd-84cfb727dfce2725d91af9f506bca49c8bb15de2.tar.bz2
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 <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5047 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Diffstat (limited to 'src')
-rw-r--r--src/helper/command.h5
1 files changed, 5 insertions, 0 deletions
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.
*/