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]

 



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

> 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.

"We will be adding different error modes and the plan is to signal
them by returning negative values other than -1" would make sense
(if that is what we are going to see in the remainder of the
series), but not the above.

To the callees, what comes back from a function is -1 either way,
and they cannot tell -1 resulting from OBJ_BAD and -1 resulting from
error() apart, can they?





[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