Re: [AD] SF.net SVN: alleg:[11393] allegro/branches/4.9

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On January 6, 2009, Peter Wang wrote:
> On 2009-01-06, Thomas Fjellstrom <tfjellstrom@xxxxxxxxxx> wrote:
> > On January 6, 2009, Evert Glebbeek wrote:
> > > On 6-Jan-09, at 11:16 AM, Thomas Fjellstrom wrote:
> > > >>> fix al_path_exists return type
> > > >>
> > > >> Shouldn't it return bool rather than int32_t?
> > > >
> > > > Only if booleans can store three values.
> > >
> > > Yes/no/maybe?
> > > A path either exists, or it doesn't, right? Why do you need three
> > > return values?
> >
> > As the code says, 1 for true, 0 for false, -1 on error.
>
> We also need to replace int32_ts in the path and fshook code by plain
> int.  Using int32_t indiscriminately hides the places where a variable
> *actually* needs to be exactly 32-bits wide, or if it's 32-bits "just
> because" (i.e. no reason at all).

All of the important places use off_t and size_t so things can deal with large 
files. Though I suppose the other int32s should be changed.. If libc uses plain 
ints, we probably should as well.

For some reason I thought it was a good idea to have a consistent size of the 
types in the api. Most of them are just boolean or error codes.

> Peter
>
>
> ---------------------------------------------------------------------------
>---


-- 
Thomas Fjellstrom
tfjellstrom@xxxxxxxxxx




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/