Re: [PATCH v2 1/6] midx: add MIDX_PROGRESS flag <snip>
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 2, 2019, 07:04 UTC
- Message-ID
- <xmqqlfu3eigp.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <xmqqsgobg0rv.fsf@gitster-ct.c.googlers.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 11 quoted lines
> William Baker <williamtbakeremail@gmail.com> writes:
>
>> Although my debugger might not be the smartest, I haven't noticed any
>> downsides to switching this to an enum.
>
> Well, if you write
>
> enum { BIT_0 = 1, BIT_1 = 2, BIT_3 = 4 } var;
>
> it's pretty much a promise that the normal value for the var is one
> of these listed values to your readers.... that is why compilers give a warning when you write
switch (var) {
case ...:
...
}and do not have case arms for all the declared enum values without having the 'default' arm.