Re: [PATCH] oidset: don't return value from oidset_init
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 8, 2018, 23:26 UTC
- Message-ID
- <xmqqincc6if3.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <20180107230404.23289-1-t.gummerer@gmail.com>
Thomas Gummerer <t.gummerer@gmail.com> writes:
Show 15 quoted lines
> c3a9ad3117 ("oidset: add iterator methods to oidset", 2017-11-21)
> introduced a 'oidset_init()' function in oidset.h, which has void as
> return type, but returns an expression.
> ...
> diff --git a/oidset.h b/oidset.h
> index 783abceccd..40ec5f87fe 100644
> --- a/oidset.h
> +++ b/oidset.h
> @@ -27,7 +27,7 @@ struct oidset {
>
> static inline void oidset_init(struct oidset *set, size_t initial_size)
> {
> - return oidmap_init(&set->map, initial_size);
> + oidmap_init(&set->map, initial_size);
> }Makes sense. Perhaps "inline" hids this from error-checking compilers, I wonder?