Re: [PATCH 2/7] object.c: make type_from_string() return "enum object_type"

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

 



On Mon, Mar 08, 2021 at 09:04:21PM +0100, Ævar Arnfjörð Bjarmason wrote:
> Change the type_from_string*() functions to return an "enum
> object_type", and refactor their callers to check for "== OBJ_BAD"
> instead of "< 0".
>
> This helps to distinguish code in object.c where we really do return
> -1 from code that returns an "enum object_type", whose OBJ_BAD happens
> to be -1.

I'm not sure I understand the intention of this and the following few
patches. I could imagine that you eventually want to use other negative
return values for a different purpose, but OBJ_BAD _is_ '-1' (as you
note), and we use 'int' and 'enum object_type' interchangeably in other
parts of the code.

That's not to say that I'm necessarily opposed to picking up these few
patches, but rather that I don't fully understand their purpose.

The patch below looks good.

Thanks,
Taylor



[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