Re: [PATCH v4 12/22] fsck.h: re-order and re-assign "enum fsck_msg_type"

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

 



Ævar Arnfjörð Bjarmason  <avarab@xxxxxxxxx> writes:

> Change the values in the "enum fsck_msg_type" from being manually
> assigned to using default C enum values.
>
> This means we end up with a FSCK_IGNORE=0, which was previously
> defined as "2".
>
> I'm confident that nothing relies on these values, we always compare
> them explicitly. Let's not omit "0" so it won't be assumed that we're
> using these as a boolean somewhere.

Do you mean by "compare them explicitly", we always compare for
equality?  

If the code had depended on constructs like "if (msg < FSCK_ERROR)",
this change would break badly.

> diff --git a/fsck.h b/fsck.h
> index 2ecc15eee7..fce9981a0c 100644
> --- a/fsck.h
> +++ b/fsck.h
> @@ -4,11 +4,13 @@
>  #include "oidset.h"
>  
>  enum fsck_msg_type {
> -	FSCK_INFO  = -2,
> -	FSCK_FATAL = -1,
> -	FSCK_ERROR = 1,
> +	/* for internal use only */
> +	FSCK_IGNORE,
> +	FSCK_INFO,
> +	FSCK_FATAL,
> +	/* "public", fed to e.g. error_func callbacks */
> +	FSCK_ERROR,
>  	FSCK_WARN,
> -	FSCK_IGNORE
>  };
>  
>  struct fsck_options;




[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