Re: [PATCH v2 09/18] unpack-trees: add a new update_sparsity() function
- From
Derrick Stolee <stolee@gmail.com>
- Date
- Mar 23, 2020, 18:21 UTC
- Message-ID
- <5a83259e-af03-1930-a62b-75ad37b05f37@gmail.com>
- In-Reply-To
- <CABPp-BF7=jJ2fWFcriC3E0=ZrUWawXoLbz659jtYdtkTJ4we_w@mail.gmail.com>
On 3/23/2020 2:10 PM, Elijah Newren wrote:
Show 16 quoted lines
> On Mon, Mar 23, 2020 at 11:02 AM Derrick Stolee <stolee@gmail.com> wrote:
>>
>> On 3/21/2020 2:00 PM, Elijah Newren via GitGitGadget wrote:
>>> +enum update_sparsity_result {
>>> + UPDATE_SPARSITY_SUCCESS = 0,
>>> + UPDATE_SPARSITY_WARNINGS = 1,
>>> + UPDATE_SPARSITY_INDEX_UPDATE_FAILURES = -1,
>>> + UPDATE_SPARSITY_WORKTREE_UPDATE_FAILURES = -2
>>> +};
>>> +
>>
>> Is there a reason this isn't located just before
>> update_sparsity()?
>
> You mean move it to unpack-trees.c? If I did that, the code in
> sparse-checkout.c that uses two of these values would fail to compile.No, I just meant the function declaration below in unpack-trees.h.
Show 8 quoted lines
>>> +int update_sparsity(struct unpack_trees_options *options); >>> + >> >> This appears to not use the enum as it should. > > Whoops! Will fix. (Interesting that the compiler didn't flag any > kind of warning based on mismatch of declared function return types > for update_sparsity() in the .c and .h files...)
*shrug* enums are essentially decoration over an int, so I'm not surprised it can happen.
-Stolee