git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 5/7] vcs-svn: fix cppcheck warning

From
David Barr <davidbarr@google.com>
Date
May 24, 2012, 14:04 UTC
Message-ID
<1337868259-45626-6-git-send-email-davidbarr@google.com>
In-Reply-To
<1337868259-45626-1-git-send-email-davidbarr@google.com>
[vcs-svn/fast_export.c:211]: (warning) Using sizeof with a numeric constant as function argument might not be what you intended.
Signed-off-by: David Barr <davidbarr@google.com>
---
 vcs-svn/fast_export.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/vcs-svn/fast_export.c b/vcs-svn/fast_export.c
index 0b2b7b9..d06a81c 100644
--- a/vcs-svn/fast_export.c
+++ b/vcs-svn/fast_export.c
@@ -208,7 +208,7 @@ static long apply_delta(off_t len, struct line_buffer *input,
 		die("cannot apply delta");
 	if (old_data) {
 		/* Read the remainder of preimage and trailing newline. */
-		assert(!signed_add_overflows(preimage.max_off, 1));
+		assert(!signed_add_overflows(preimage.max_off, (off_t) 1));
 		preimage.max_off++;	/* room for newline */
 		if (move_window(&preimage, preimage.max_off - 1, 1))
 			die("cannot seek to end of input");
-- 
1.7.10.2
Previous: David BarrNext: Jonathan Nieder
Message 8 of 14 in “vcs-svn: housekeeping”
  1. 0/7 vcs-svn: housekeepingDavid Barr, May 24, 2012
  2. 1/7 vcs-svn: prefer constcmp to prefixcmpDavid Barr, May 24, 2012
  3. 2/7 vcs-svn: prefer strstr over memmemDavid Barr, May 24, 2012
  4. 3/7 vcs-svn: fix signedness warningsDavid Barr, May 24, 2012
  5. Jonathan NiederMay 24, 2012
  6. David Michael BarrMay 31, 2012
  7. 4/7 vcs-svn: drop no-op reset methodsDavid Barr, May 24, 2012
  8. 5/7 vcs-svn: fix cppcheck warningDavid Barr, May 24, 2012
  9. Jonathan NiederMay 24, 2012
  10. David Michael BarrMay 31, 2012
  11. 6/7 vcs-svn: fix clang-analyzer errorDavid Barr, May 24, 2012
  12. 7/7 vcs-svn: fix clang-analyzer warningDavid Barr, May 24, 2012
  13. Jonathan NiederMay 24, 2012
  14. David Michael BarrMay 31, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.