aboutsummaryrefslogtreecommitdiff
path: root/opcodes
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2002-02-08 12:12:15 +0000
committerNick Clifton <nickc@redhat.com>2002-02-08 12:12:15 +0000
commit5e37cc467605bb1dc2e791806b55a3ca52702d99 (patch)
treea8a0f7f5a2abd654a28b4f735cf04ed991a21d30 /opcodes
parent50a4c611305fef58905ffccdf0092ef69562598f (diff)
downloadbinutils-5e37cc467605bb1dc2e791806b55a3ca52702d99.zip
binutils-5e37cc467605bb1dc2e791806b55a3ca52702d99.tar.gz
binutils-5e37cc467605bb1dc2e791806b55a3ca52702d99.tar.bz2
Fix compile time warning messages
Diffstat (limited to 'opcodes')
-rw-r--r--opcodes/ChangeLog5
-rw-r--r--opcodes/or32-dis.c19
-rw-r--r--opcodes/or32-opc.c19
3 files changed, 27 insertions, 16 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index 37b95e3..c91f70b 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,8 @@
+2002-02-08 Ivan Guzvinec <ivang@opencores.org>
+
+ * or32-opc.c: Fix compile time warning messages.
+ * or32-dis.c: Fix compile time warning messages.
+
2002-02-08 Alexandre Oliva <aoliva@redhat.com>
Contribute sh64-elf.
diff --git a/opcodes/or32-dis.c b/opcodes/or32-dis.c
index cbfddcf..8876a30 100644
--- a/opcodes/or32-dis.c
+++ b/opcodes/or32-dis.c
@@ -25,8 +25,9 @@
#include "opcode/or32.h"
#include "safe-ctype.h"
#include <string.h>
+#include <stdlib.h>
-#define EXTEND29(x) ((x) & 0x10000000 ? ((x) | 0xf0000000) : ((x)))
+#define EXTEND29(x) ((x) & (unsigned long) 0x10000000 ? ((x) | (unsigned long) 0xf0000000) : ((x)))
static void find_bytes_big PARAMS ((unsigned char *, unsigned long *));
static void find_bytes_little PARAMS ((unsigned char *, unsigned long *));
@@ -81,10 +82,12 @@ or32_extract (param_ch, enc_initial, insn)
for (enc = enc_initial; *enc != '\0'; enc++)
if (*enc == param_ch)
- if (enc - 2 >= enc_initial && (*(enc - 2) == '0') && (*(enc - 1) == 'x'))
- continue;
- else
- param_pos++;
+ {
+ if (enc - 2 >= enc_initial && (*(enc - 2) == '0') && (*(enc - 1) == 'x'))
+ continue;
+ else
+ param_pos++;
+ }
#if DEBUG
printf ("or32_extract: %c %x ", param_ch, param_pos);
@@ -98,7 +101,7 @@ or32_extract (param_ch, enc_initial, insn)
if ((param_ch == '0') || (param_ch == '1'))
{
- unsigned long tmp = strtol (enc, NULL, 16);
+ unsigned long tmp = strtoul (enc, NULL, 16);
#if DEBUG
printf (" enc=%s, tmp=%x ", enc, tmp);
#endif
@@ -126,7 +129,7 @@ or32_extract (param_ch, enc_initial, insn)
if (!param_pos
&& letter_signed (param_ch)
- && ret >> letter_range (param_ch) - 1)
+ && ret >> (letter_range (param_ch) - 1))
{
#if DEBUG
printf ("\n ret=%x opc_pos=%x, param_pos=%x\n",
@@ -254,7 +257,7 @@ print_insn (memaddr, info)
/* The raw instruction. */
unsigned char insn_ch[4];
/* Address. Will be sign extened 27-bit. */
- int addr;
+ unsigned long addr;
/* The four bytes of the instruction. */
unsigned long insn;
find_byte_func_type find_byte_func = (find_byte_func_type)info->private_data;
diff --git a/opcodes/or32-opc.c b/opcodes/or32-opc.c
index 841c72f..8ccdfb1 100644
--- a/opcodes/or32-opc.c
+++ b/opcodes/or32-opc.c
@@ -348,7 +348,7 @@ static void
debug (int level, const char *format, ...)
{
/* Just to get rid of warnings. */
- format = level = 0;
+ format = (char *) level = 0;
}
#endif
@@ -411,7 +411,8 @@ letter_range (l)
int
insn_index (char *insn)
{
- int i, found = -1;
+ unsigned int i;
+ int found = -1;
for (i = 0; i < or32_num_opcodes; i++)
if (!strcmp (or32_opcodes[i].name, insn))
@@ -426,7 +427,7 @@ const char *
insn_name (index)
int index;
{
- if (index >= 0 && index < or32_num_opcodes)
+ if (index >= 0 && index < (int) or32_num_opcodes)
return or32_opcodes[index].name;
else
return "???";
@@ -507,7 +508,9 @@ cover_insn (cur, pass, mask)
int pass;
unsigned int mask;
{
- int best_first = 0, best_len = 0, i, last_match = -1, ninstr = 0;
+ int best_first = 0, last_match = -1, ninstr = 0;
+ unsigned int best_len = 0;
+ unsigned int i;
unsigned long cur_mask = mask;
unsigned long *next;
@@ -539,7 +542,7 @@ cover_insn (cur, pass, mask)
/* Find longest match. */
for (i = 0; i < 32; i++)
{
- int len;
+ unsigned int len;
for (len = best_len + 1; len < MIN (MAX_LEN, 33 - i); len++)
{
@@ -587,9 +590,9 @@ cover_insn (cur, pass, mask)
cur += 1 << best_len;
cur_mask = (1 << (unsigned long)best_len) - 1;
- for (i = 0; i < (1 << (unsigned long)best_len); i++)
+ for (i = 0; i < ((unsigned) 1 << best_len); i++)
{
- int j;
+ unsigned int j;
unsigned long *c;
curpass++;
@@ -755,7 +758,7 @@ parse_params (opcode, cur)
void
build_automata ()
{
- int i;
+ unsigned int i;
unsigned long *end;
struct insn_op_struct *cur;