This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Replace 0 with TARGET_XFER_EOF in to_xfer_partial


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.  I'll commit it in two
days.

gdb:

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

	* corelow.c (core_xfer_partial): Replace 0 with TARGET_XFER_EOF.
	* remote-m32r-sdi.c (m32r_xfer_memory): Likewise.
---
 gdb/corelow.c         | 2 +-
 gdb/remote-m32r-sdi.c | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/gdb/corelow.c b/gdb/corelow.c
index ad780ed..4d783b6 100644
--- a/gdb/corelow.c
+++ b/gdb/corelow.c
@@ -737,7 +737,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;
diff --git a/gdb/remote-m32r-sdi.c b/gdb/remote-m32r-sdi.c
index e5b66a0..3d2260d 100644
--- a/gdb/remote-m32r-sdi.c
+++ b/gdb/remote-m32r-sdi.c
@@ -1081,7 +1081,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);
 	}
@@ -1095,7 +1095,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);
@@ -1103,7 +1103,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);
-- 
1.9.0


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]