git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Randall S. Becker" <rsbecker@nexbridge.com>
To: "'Junio C Hamano'" <gitster@pobox.com>,
	"'Elijah Newren'" <newren@gmail.com>
Cc: "'Jeff King'" <peff@peff.net>,
	"'Git Mailing List'" <git@vger.kernel.org>
Subject: RE: [PATCH] strmap: make callers of strmap_remove() to call it in void context
Date: Tue, 15 Dec 2020 16:35:32 -0500	[thread overview]
Message-ID: <004a01d6d32a$3b92ec60$b2b8c520$@nexbridge.com> (raw)
In-Reply-To: <xmqqtusm7odr.fsf_-_@gitster.c.googlers.com>

> -----Original Message-----
> From: Junio C Hamano <gitster@pobox.com>
> Sent: December 15, 2020 4:26 PM
> To: Elijah Newren <newren@gmail.com>; Randall S. Becker
> <rsbecker@nexbridge.com>
> Cc: Jeff King <peff@peff.net>; Git Mailing List <git@vger.kernel.org>
> Subject: [PATCH] strmap: make callers of strmap_remove() to call it in
void
> context
> 
> Two "static inline" functions, both of which return void, call
> strmap_remove() and tries to return the value it returns as their return
value,
> which is just bogus, as strmap_remove() returns void itself.  Call it in
the void
> context and fall-thru the control to the end instead.
> 
> Reported-by: Randall S. Becker <rsbecker@nexbridge.com>
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
> ---
>  strmap.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/strmap.h b/strmap.h
> index c4c104411b..1e152d832d 100644
> --- a/strmap.h
> +++ b/strmap.h
> @@ -165,7 +165,7 @@ static inline int strintmap_contains(struct strintmap
> *map, const char *str)
> 
>  static inline void strintmap_remove(struct strintmap *map, const char
*str)  {
> -	return strmap_remove(&map->map, str, 0);
> +	strmap_remove(&map->map, str, 0);
>  }
> 
>  static inline int strintmap_empty(struct strintmap *map) @@ -249,7 +249,7
> @@ static inline int strset_contains(struct strset *set, const char *str)
> 
>  static inline void strset_remove(struct strset *set, const char *str)  {
> -	return strmap_remove(&set->map, str, 0);
> +	strmap_remove(&set->map, str, 0);
>  }
> 
>  static inline int strset_empty(struct strset *set)
> --
> 2.30.0-rc0-186-g20447144ec

Looks good from here.

Regards,
Randall


  reply	other threads:[~2020-12-15 21:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-14 23:12 [ANNOUNCE] git-2.30.0-rc0 - Compile Fails on HPE NonStop Randall S. Becker
2020-12-15  2:43 ` Junio C Hamano
2020-12-15  2:52   ` Jeff King
2020-12-15 15:55     ` Randall S. Becker
2020-12-15 16:21     ` Elijah Newren
2020-12-15 21:07       ` Junio C Hamano
2020-12-15 21:08       ` Junio C Hamano
2020-12-15 21:25         ` [PATCH] strmap: make callers of strmap_remove() to call it in void context Junio C Hamano
2020-12-15 21:35           ` Randall S. Becker [this message]
2020-12-15 21:26         ` [PATCH] compat-util: pretend that stub setitimer() always succeeds Junio C Hamano
2020-12-15 21:37         ` [ANNOUNCE] git-2.30.0-rc0 - Compile Fails on HPE NonStop Jeff King
2020-12-16 17:27           ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='004a01d6d32a$3b92ec60$b2b8c520$@nexbridge.com' \
    --to=rsbecker@nexbridge.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=newren@gmail.com \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).