]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix pointer assignment with different signedness
authorYao Qi <yao@codesourcery.com>
Tue, 7 Jan 2014 10:12:21 +0000 (18:12 +0800)
committerYao Qi <yao@codesourcery.com>
Wed, 8 Jan 2014 02:44:32 +0000 (10:44 +0800)
This patch fixes these errors below:

../../binutils-gdb/gdb/spu-linux-nat.c: In function ‘spu_symbol_file_add_from_memory’:
../../binutils-gdb/gdb/spu-linux-nat.c:368:3: error: pointer targets in passing argument 2 of ‘spu_proc_xfer_spu’ differ in signedness [-Werror=pointer-sign]
../../binutils-gdb/gdb/spu-linux-nat.c:232:1: note: expected ‘gdb_byte *’ but argument is of type ‘char *’
../../binutils-gdb/gdb/spu-linux-nat.c: In function ‘spu_xfer_partial’:
../../binutils-gdb/gdb/spu-linux-nat.c:598:7: error: pointer targets in passing argument 1 of ‘strtoulst’ differ in signedness [-Werror=pointer-sign]
In file included from ../../binutils-gdb/gdb/defs.h:769:0,
                 from ../../binutils-gdb/gdb/spu-linux-nat.c:21:
../../binutils-gdb/gdb/utils.h:43:15: note: expected ‘const char *’ but argument is of type ‘gdb_byte *’

gdb:

2014-01-08  Yao Qi  <yao@codesourcery.com>

* spu-linux-nat.c (spu_symbol_file_add_from_memory): Change
type of 'id' to gdb_byte.  Cast 'id' to 'const char *'.
(spu_xfer_partial): Cast 'buf' to 'const char *'.

gdb/ChangeLog
gdb/spu-linux-nat.c

index e5c7bdce82487332740b035080abb730109e3365..01a0c56f5940fd66fbaa3ec0a960a8a5c80fa9da 100644 (file)
@@ -1,3 +1,9 @@
+2014-01-08  Yao Qi  <yao@codesourcery.com>
+
+       * spu-linux-nat.c (spu_symbol_file_add_from_memory): Change
+       type of 'id' to gdb_byte.  Cast 'id' to 'const char *'.
+       (spu_xfer_partial): Cast 'buf' to 'const char *'.
+
 2014-01-08  Yao Qi  <yao@codesourcery.com>
 
        * spu-linux-nat.c (spu_symbol_file_add_from_memory): Pass
index cfd5fd96a9d626310f20b9b66d1e850cc19ee9b3..4c62ec7457489490dbd7c5c6037c5998742fce14 100644 (file)
@@ -359,7 +359,7 @@ spu_symbol_file_add_from_memory (int inferior_fd)
   ULONGEST addr;
   struct bfd *nbfd;
 
-  char id[128];
+  gdb_byte id[128];
   char annex[32];
   int len;
 
@@ -369,7 +369,7 @@ spu_symbol_file_add_from_memory (int inferior_fd)
   if (len <= 0 || len >= sizeof id)
     return;
   id[len] = 0;
-  addr = strtoulst (id, NULL, 16);
+  addr = strtoulst ((const char *) id, NULL, 16);
   if (!addr)
     return;
 
@@ -596,7 +596,7 @@ spu_xfer_partial (struct target_ops *ops,
       if (spu_proc_xfer_spu (lslr_annex, buf, NULL, 0, sizeof buf) <= 0)
        return ret;
 
-      lslr = strtoulst (buf, NULL, 16);
+      lslr = strtoulst ((const char *) buf, NULL, 16);
       return spu_proc_xfer_spu (mem_annex, readbuf, writebuf,
                                offset & lslr, len);
     }