diff options
author | Sergey Belyashov <sergey.belyashov@gmail.com> | 2020-01-09 11:47:44 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2020-01-09 11:49:18 +0000 |
commit | 40c75bc8b07abc5d5774ea1c439b69c96e7fd485 (patch) | |
tree | bb0efc3b78e0eb8a7ddbed1d2af4979f18ab8719 /opcodes/z80-dis.c | |
parent | 72aea32839b5f4a2c8fa67e60451169b841941c0 (diff) | |
download | fsf-binutils-gdb-40c75bc8b07abc5d5774ea1c439b69c96e7fd485.zip fsf-binutils-gdb-40c75bc8b07abc5d5774ea1c439b69c96e7fd485.tar.gz fsf-binutils-gdb-40c75bc8b07abc5d5774ea1c439b69c96e7fd485.tar.bz2 |
Fix compile time warnings about comparisons always being false.
PR 25224
gas * config/tc-z80.c (emit_ld_m_rr): Use integer types when checking
opcode byte values.
(emit_ld_r_r): Likewise.
(emit_ld_rr_m): Likewise.
(emit_ld_rr_nn): Likewise.
opcodes * z80-dis.c (ld_ii_ii): Use character constant when checking
opcode byte value.
Diffstat (limited to 'opcodes/z80-dis.c')
-rw-r--r-- | opcodes/z80-dis.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/opcodes/z80-dis.c b/opcodes/z80-dis.c index 581d4f4..8dc7598 100644 --- a/opcodes/z80-dis.c +++ b/opcodes/z80-dis.c @@ -82,7 +82,7 @@ fetch_data (struct buffer *buf, disassemble_info * info, int n) { int r; - if (buf->n_fetch + n > (int)sizeof(buf->data)) + if (buf->n_fetch + n > (int)sizeof (buf->data)) abort (); r = info->read_memory_func (buf->base + buf->n_fetch, @@ -470,9 +470,9 @@ pref_ed (struct buffer *buf, disassemble_info *info, { struct tab_elt *p; - if (fetch_data(buf, info, 1)) + if (fetch_data (buf, info, 1)) { - for (p = opc_ed; p->val != (buf->data[1] & p->mask) || !mach_inst(buf, p); ++p) + for (p = opc_ed; p->val != (buf->data[1] & p->mask) || !mach_inst (buf, p); ++p) ; p->fp (buf, info, p->text); } @@ -585,7 +585,7 @@ ld_r_d (struct buffer *buf, disassemble_info * info, const char *txt) } static int -ld_d_r(struct buffer *buf, disassemble_info * info, const char *txt) +ld_d_r (struct buffer *buf, disassemble_info * info, const char *txt) { char mytxt[TXTSIZ]; signed char c; @@ -596,14 +596,14 @@ ld_d_r(struct buffer *buf, disassemble_info * info, const char *txt) } static int -ld_ii_ii(struct buffer *buf, disassemble_info * info, const char *txt) +ld_ii_ii (struct buffer *buf, disassemble_info * info, const char *txt) { char mytxt[TXTSIZ]; signed char c; int p; static const char *ii[2] = { "ix", "iy" }; - p = (buf->data[buf->n_fetch - 2] == '\xdd') ? 0 : 1; + p = (buf->data[buf->n_fetch - 2] == (char) 0xdd) ? 0 : 1; c = buf->data[buf->n_fetch - 1]; if ((c & 0x07) != 0x07) p = 1 - p; /* 0 -> 1, 1 -> 0 */ @@ -858,7 +858,7 @@ print_insn_z80_buf (struct buffer *buf, disassemble_info *info) if (! fetch_data (buf, info, 1)) return -1; - for (p = opc_main; p->val != (buf->data[0] & p->mask) || !mach_inst(buf, p); ++p) + for (p = opc_main; p->val != (buf->data[0] & p->mask) || !mach_inst (buf, p); ++p) ; p->fp (buf, info, p->text); |