git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] notes.c: don't call 'return' in a void function
@ 2010-03-18 14:50 Brandon Casey
  2010-03-18 15:03 ` [PATCH] notes.c: remove inappropriate call to return Brandon Casey
  0 siblings, 1 reply; 3+ messages in thread
From: Brandon Casey @ 2010-03-18 14:50 UTC (permalink / raw)
  To: gitster; +Cc: johan, git, Brandon Casey

From: Brandon Casey <drafnel@gmail.com>


Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
---
 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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] notes.c: remove inappropriate call to return
  2010-03-18 14:50 [PATCH] notes.c: don't call 'return' in a void function Brandon Casey
@ 2010-03-18 15:03 ` Brandon Casey
  2010-03-18 15:37   ` Johan Herland
  0 siblings, 1 reply; 3+ messages in thread
From: Brandon Casey @ 2010-03-18 15:03 UTC (permalink / raw)
  To: gitster; +Cc: johan, git, Brandon Casey

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] notes.c: remove inappropriate call to return
  2010-03-18 15:03 ` [PATCH] notes.c: remove inappropriate call to return Brandon Casey
@ 2010-03-18 15:37   ` Johan Herland
  0 siblings, 0 replies; 3+ messages in thread
From: Johan Herland @ 2010-03-18 15:37 UTC (permalink / raw)
  To: git; +Cc: Brandon Casey, gitster, Brandon Casey

On Thursday 18 March 2010, Brandon Casey wrote:
> 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,

Yes, I noticed this during a recent code review in some related code, 
but I haven't yet got around to posting a cleanup patch.

Acked-by: Johan Herland <johan@herland.net>


...Johan

-- 
Johan Herland, <johan@herland.net>
www.herland.net

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-03-18 15:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-18 14:50 [PATCH] notes.c: don't call 'return' in a void function Brandon Casey
2010-03-18 15:03 ` [PATCH] notes.c: remove inappropriate call to return Brandon Casey
2010-03-18 15:37   ` Johan Herland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).