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

[PATCH] notes.c: remove inappropriate call to return

From
Brandon Casey <casey@nrlssc.navy.mil>
Date
Mar 18, 2010, 15:03 UTC
Message-ID
<FMCfttz0yXy1PiW0rQs7llBXL-J_qvqMmKHhFzRD_pqpDVu1DBh0TUAi68oer0RcT3kMvGDNHiQ@cipher.nrlssc.navy.mil>
In-Reply-To
<m6P-Qdljqt7xCgOUC581DdkndLOwc9aVqzGi_vEsC8UeEeGnpREXOnx-fSQIkTfaqsh9HzzlXIM@cipher.nrlssc.navy.mil>
From: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
---

Heh, I guess it's ok to call 'return' in a function returning void, but it shouldn't be passed an argument. :)

-brandon
 notes.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/notes.c b/notes.c
index a4f9926..07941b7 100644
--- a/notes.c
+++ b/notes.c
@@ -893,7 +893,7 @@ void remove_note(struct notes_tree *t, const unsigned char *object_sha1)
 	assert(t->initialized);
 	hashcpy(l.key_sha1, object_sha1);
 	hashclr(l.val_sha1);
-	return note_tree_remove(t, t->root, 0, &l);
+	note_tree_remove(t, t->root, 0, &l);
 }
 
 const unsigned char *get_note(struct notes_tree *t,
-- 
1.6.6.2
Previous: Brandon CaseyNext: Johan Herland
Message 2 of 3 in “notes.c: don't call 'return' in a void function”
  1. notes.c: don't call 'return' in a void functionBrandon Casey, Mar 18, 2010
  2. notes.c: remove inappropriate call to returnBrandon Casey, Mar 18, 2010
  3. Johan HerlandMar 18, 2010

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.