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

List:       kde-core-devel
Subject:    Re: symbolic return values
From:       Mirko Sucker <mirko.sucker () unibw-hamburg ! de>
Date:       2000-03-30 20:35:24
[Download RAW message or body]

David Faure wrote:
> 
> On Wed, Mar 29, 2000 at 09:20:38AM +0200, Hummel, Timo wrote:
> > Hi,
> >
> > I would like to use return values in the style FUNCTION_INVALID or such
> > (#defined or consts) instead of returning numbers (0, -1, -2 etc). Is this
> > the standard style or do most KDE functions return numbers instead of
> > symbolic return values?
> 
> Use an enum, I'd say, and make the function return an int, out of that enum.
This is done in libkab, for example, see addressbook.h, and really makes
sense. Much more readable code. 
--Mirko.
-- 
Denn der  Mensch  liebt und ehrt den  Menschen,  solange er ihn
nicht zu beurteilen vermag, und die Sehnsucht ist ein Erzeugnis
mangelhafter Erkenntnis. (Thomas Mann)

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

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