On Sun, Jul 5, 2015 at 1:32 PM, Paweł Dziepak <pdziepak@xxxxxxxxxxx> wrote:
Neither B_ERROR nor -1 is an invalid semaphore. The former is an error code
the latter is a signed integer.
const sem_id invalid_semaphore = -1;
...and then we can have:
sem_id
BitmapHWInterface::RetraceSemaphore()
{
return invalid_semaphore;
}
and nobody needs to ask what was the original author's intention.
Obviously, it would be even better if implicit casts between sem_id and
integers were disallowed but that would break things like if (sem < B_OK) in
C code.