Re: [PATCH v4 2/3] format-patch: use enum variables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Denton Liu <liu.denton@xxxxxxxxx> 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.




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux