> On Sat, 03 Jun 2000 22:06:09 PDT, the world broke into rejoicing as
> Dylan Paul Thurston <[EMAIL PROTECTED]>  said:
> > On Sat, Jun 03, 2000 at 10:20:40AM -0700, Peter C. Norton wrote:
> > > On Sat, Jun 03, 2000 at 05:01:51AM -0500, Richard Wackerbarth wrote:
> > > > I agree. Using gint32 rather than int only solves part of the problem.
> > > > foo_t is much more flexible.It reduces the architecture dependency to a 
> > > > single point in the code.
> > > How is this different from using already-created typedefs in glib?  glib
> > > seems to provide a lot of the types necessary, already done.
> > 
> > I think the point is that you might decide to change the size of one
> > of the types at some point.
> 
> Ah, yes.
> 
> Basic idea being that it might be good to have a single type, of
> platform-independent shape, that GnuCash uses.
> 
> Thus, perhaps, the
>     gcint
> type.
> 
> Thus, everything in GnuCash would use the gcint type.
> 
> gcint is defined via:
>   typedef gint32 gcint;
> 
> which accordingly references whatever glib.h provides.
> 
> Note that this costs us _nothing_ at runtime, as the evaluation of types
> is done by the C preprocessor, and this gets expanded, by the compiler, 
> to whatever is the "real" type from its perspective.

I've always had trouble getting constants to have the right type.
I don't think the preprocessor will hanle this cleanly (or have things
changed since I last looked at C?).  Evin if (gint32)7 works (I seem to
remember thst this is not what is technically called a "constant expression"),
there is still trouble with things like getting the maximum integer of type
gint32.

I see

#define G_MININT        INT_MIN
#define G_MAXINT        INT_MAX

in glibconfig.h, but nowhere do I see a G_MAXINT32.

Or is there something else I need to knw?

-- hendrik.



--
Gnucash Developer's List
To unsubscribe send empty email to: [EMAIL PROTECTED]


Reply via email to