diff options
author | Yao Qi <yao.qi@linaro.org> | 2017-01-13 12:21:22 +0000 |
---|---|---|
committer | Yao Qi <yao.qi@linaro.org> | 2017-01-13 12:21:22 +0000 |
commit | f622ea96de49d77646f52501ef00d03132fcb2df (patch) | |
tree | 865e9139caa81146f81ad933efc89744d4eca402 /COPYING.LIB | |
parent | 404c84343097091e21090727948d1461bf316118 (diff) | |
download | gdb-f622ea96de49d77646f52501ef00d03132fcb2df.zip gdb-f622ea96de49d77646f52501ef00d03132fcb2df.tar.gz gdb-f622ea96de49d77646f52501ef00d03132fcb2df.tar.bz2 |
Remove magic numbers in m68k-dis.c:print_insn_arg
When I inspect the return values of disassmblers, I happen to see
various -1/-2/-3 magic numbers are used in m68k-dis.c. This patch
is to replace them with enum.
-1 and -2 is "clearly documented" in print_ins_arg's comments, but
-3 isn't. In fact, -3 is returned when FETCH_DATA returns false,
which means memory error (because fetch_data return 0 on memory
error). So I name enum PRINT_INSN_ARG_MEMORY_ERROR for -3.
This patch is a refactor patch, doesn't affect any functionality.
opcodes:
2017-01-13 Yao Qi <yao.qi@linaro.org>
* m68k-dis.c (enum print_insn_arg_error): New.
(NEXTBYTE): Replace -3 with
PRINT_INSN_ARG_MEMORY_ERROR.
(NEXTULONG): Likewise.
(NEXTSINGLE): Likewise.
(NEXTDOUBLE): Likewise.
(NEXTDOUBLE): Likewise.
(NEXTPACKED): Likewise.
(FETCH_ARG): Likewise.
(FETCH_DATA): Update comments.
(print_insn_arg): Update comments. Replace magic numbers with
enum.
(match_insn_m68k): Likewise.
Diffstat (limited to 'COPYING.LIB')
0 files changed, 0 insertions, 0 deletions