fixed compiler warning on opcodes/z80-dis.c

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

fixed compiler warning on opcodes/z80-dis.c

Bugzilla from arnold.metselaar@planet.nl
Hello,
I have applied the following patch to get rid of some warnings
for opcodes/z80-dis.c.
Arnold

opcodes/ChangeLog:
        * z80-dis.c (struct buffer, prt_d, prt_d_n, pref_xd_cb): Use
        unsigned char to hold data to be disassembled.

Index: opcodes/z80-dis.c
===================================================================
RCS file: /cvs/src/src/opcodes/z80-dis.c,v
retrieving revision 1.1
diff -u -p -r1.1 z80-dis.c
--- opcodes/z80-dis.c   25 Oct 2005 17:40:16 -0000      1.1
+++ opcodes/z80-dis.c   17 Jan 2006 21:02:37 -0000
@@ -26,7 +26,7 @@ struct buffer
   bfd_vma base;
   int n_fetch;
   int n_used;
-  char data[4];
+  unsigned char data[4];
 } ;

 typedef int (*func)(struct buffer *, disassemble_info *, char
*);
@@ -377,9 +377,9 @@ static int
 prt_d (struct buffer *buf, disassemble_info * info, char *txt)
 {
   int d;
-  signed char *p;
+  unsigned char *p;

-  p = (unsigned char*) buf->data + buf->n_fetch;
+  p = buf->data + buf->n_fetch;

   if (fetch_data (buf, info, 1))
     {
@@ -398,9 +398,9 @@ prt_d_n (struct buffer *buf, disassemble
 {
   char mytxt[TXTSIZ];
   int d;
-  signed char *p;
+  unsigned char *p;

-  p = (unsigned char*) buf->data + buf->n_fetch;
+  p = buf->data + buf->n_fetch;

   if (fetch_data (buf, info, 1))
     {
@@ -454,7 +454,7 @@ pref_xd_cb (struct buffer * buf, disasse
     {
       int d;
       char arg[TXTSIZ];
-      signed char *p;
+      unsigned char *p;

       buf->n_used = 4;
       p = buf->data;