Re: [PATCH v2 1/6] midx: add MIDX_PROGRESS flag <snip>
- From
- William Baker <williamtbakeremail@gmail.com>
- Date
- Sep 23, 2019, 21:55 UTC
- Message-ID
- <b5ce3e27-3401-9726-18dc-358f69f1b996@gmail.com>
- In-Reply-To
- <20190921121104.GA6787@szeder.dev>
On 9/21/19 5:11 AM, SZEDER Gábor wrote:
Show 14 quoted lines
>> >> +#define MIDX_PROGRESS (1 << 0) > > Please consider using an enum. > > A preprocessor constant is just that: a number. It is shown as a > number while debugging, and there is no clear indication what related > values belong in the same group (apart from the prefix of the macro > name), or what possible values an 'unsigned flags' variable might have > (though in this particular case there is only a single possible > value...). > > An enum, however, is much friendlier to humans when debugging, because > even 'gdb' shows the value using the symbolic names, e.g.:
Thanks for this suggestion. I agree on the benefits of using an enum here and will make the switch in my next set of changes.
-William