From: Junio C Hamano Date: Sat, 12 Oct 2019 02:16:53 GMT Subject: Re: [PATCH v4 2/3] format-patch: use enum variables Message-ID: In-Reply-To: <19ee1f71493fa584991f530e952d9198880208eb.1570821015.git.liu.denton@gmail.com> Denton Liu writes: > -#define THREAD_SHALLOW 1 > -#define THREAD_DEEP 2 > -static int thread; > +enum thread_level { > + THREAD_UNSET, > + THREAD_SHALLOW, > + THREAD_DEEP > +}; > +static enum thread_level thread; As the assignment of values do not change, this is a safe conversion even if an existing code did things like if (!thread) ... do this ...; Hopefully nobody did arithmetic on it; thread_level may now become unsigned depending on the compiler. > -static int config_cover_letter; > +static enum cover_setting config_cover_letter; Likewise about the signedness.