On 7/6/2015 11:45, gus knight wrote:
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 codeI'm not sure where that define should go -- and all I was doing here
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.
was making this specific instance of RetraceSemaphore() be exactly the
same as the other 4 instances that all return -1.
-gus