On Jun 10, 2015 22:02, "Dirk Hohndel" <[email protected]> wrote:
>
> So you treat this function as void (called as void, no return at the end),
> yet it's declared as int and returns report_error(...) in case of error.
>
> Which one should it be?

The "int" return is literally because it makes the code cleaner with the
whole

    return report_error(..);

thing, but nobody ever actually cares whether it succeeds or not, since we
will end up using the cached copy regardless.

So it's a "'yes, it returns a status, but you don't necessarily have to use
it" thing.

Not unusual. Lots of C functions return calls that are never used. How
often have you used the return value of "memcpy()"?

     Linus
_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to