Replace 0 with TARGET_XFER_EOF in to_xfer_partial
authorYao Qi <yao@codesourcery.com>
Wed, 6 Aug 2014 06:02:35 +0000 (14:02 +0800)
committerYao Qi <yao@codesourcery.com>
Thu, 7 Aug 2014 12:39:12 +0000 (20:39 +0800)
I run splint in gdb source and get the following warnings:

  ../../../git/gdb/corelow.c:740: Return value type int does not match declared type enum target_xfer_status: 0

'TARGET_XFER_EOF' (enum target_xfer_status) is expected to be returned,
but 0 is returned.  This patch is to replace 0 with TARGET_XFER_EOF
in the implementations of to_xfer_partial.

gdb:

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

* corelow.c (core_xfer_partial): Replace 0 with TARGET_XFER_EOF.
* remote-m32r-sdi.c (m32r_xfer_memory): Likewise.
* remote.c (remote_read_bytes): Likewise.

gdb/ChangeLog
gdb/corelow.c
gdb/remote-m32r-sdi.c
gdb/remote.c

index 68d1db9719f554bc97afcba1cecb8bdc26bdabb6..93bfc721b90d3663414f6894e2d31f25c47f34d3 100644 (file)
@@ -1,3 +1,9 @@
+2014-08-07  Yao Qi  <yao@codesourcery.com>
+
+       * corelow.c (core_xfer_partial): Replace 0 with TARGET_XFER_EOF.
+       * remote-m32r-sdi.c (m32r_xfer_memory): Likewise.
+       * remote.c (remote_read_bytes): Likewise.
+
 2014-08-07  Yao Qi  <yao@codesourcery.com>
 
        * dwarf2read.c (struct dwarf2_per_cu_data) <u>: Tweak comments.
index ff4d7338357d5e9a00af1869272f5b4ae9698a39..ecd99f61cebee57a450b53a8888bffd21e2a59c5 100644 (file)
@@ -734,7 +734,7 @@ core_xfer_partial (struct target_ops *ops, enum target_object object,
 
          size = bfd_section_size (core_bfd, section);
          if (offset >= size)
-           return 0;
+           return TARGET_XFER_EOF;
          size -= offset;
          if (size > len)
            size = len;
index 5443fe0a223735dc0c682e468afa66fa19c89c43..3d6b0c679fde59839250b5ebf0c087c88b79eaca 100644 (file)
@@ -1080,7 +1080,7 @@ m32r_xfer_memory (gdb_byte *readbuf, const gdb_byte *writebuf,
              if (remote_debug)
                fprintf_unfiltered (gdb_stdlog,
                                    "m32r_xfer_memory() failed\n");
-             return 0;
+             return TARGET_XFER_EOF;
            }
          ret = send_data (writebuf, len);
        }
@@ -1094,7 +1094,7 @@ m32r_xfer_memory (gdb_byte *readbuf, const gdb_byte *writebuf,
        {
          if (remote_debug)
            fprintf_unfiltered (gdb_stdlog, "m32r_xfer_memory() failed\n");
-         return 0;
+         return TARGET_XFER_EOF;
        }
 
       c = serial_readchar (sdi_desc, SDI_TIMEOUT);
@@ -1102,7 +1102,7 @@ m32r_xfer_memory (gdb_byte *readbuf, const gdb_byte *writebuf,
        {
          if (remote_debug)
            fprintf_unfiltered (gdb_stdlog, "m32r_xfer_memory() failed\n");
-         return 0;
+         return TARGET_XFER_EOF;
        }
 
       ret = recv_data (readbuf, len);
index 8decd08536ae684510d899a96b8b4c5337e799e1..473bb724a20a809f115edffeb76afc34d2a673ff 100644 (file)
@@ -6823,7 +6823,7 @@ remote_read_bytes (struct target_ops *ops, CORE_ADDR memaddr,
                   gdb_byte *myaddr, ULONGEST len, ULONGEST *xfered_len)
 {
   if (len == 0)
-    return 0;
+    return TARGET_XFER_EOF;
 
   if (get_traceframe_number () != -1)
     {