[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: RFC: A new helper class
From:       Allan Sandfeld Jensen <kde () carewolf ! com>
Date:       2004-10-04 14:37:35
Message-ID: 200410041637.35555.kde () carewolf ! com
[Download RAW message or body]

On Monday 04 October 2004 16:13, Harri Porten wrote:
> On Mon, 4 Oct 2004, Allan Sandfeld Jensen wrote:
> > Maybe I am old-fashioned, but I prefer the traditional C-way of
> > representing this:
> > int ret;
> > ret>0 -> true
> > ret==0 -> false
> > ret<0 -> error/exception
>
> Funny. I'd interpret an value of 0 as meaning success in a C api. So it
> seems like this convention is not *that* safe ;)
>
You need to interpret it correctly. 
Larger-than or equal 0 means succes of the call, with the value being the 
result. In case of a boolean function, 0 means a succesfull call that 
returned false. In case of a void function 0 just means succes.

`Allan
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic