[perl #39855] [CAGE] configuration: define MIN/MAX macros for all integral typedefs

Christoph Otto via RT parrotbug-followup at parrotcode.org
Sat Apr 18 07:09:10 UTC 2009


On Wed Aug 06 20:07:05 2008, Whiteknight wrote:
> On Sat May 17 14:57:18 2008, pmichaud wrote:
> > On Mon Jul 17 11:59:47 2006, chip wrote:
> > > It's great to have INTVAL and UINTVAL, but without MAX_INTVAL it's
> kind of
> > > hard to work with them in some respects.  All integral typedefs should
> > have
> > > min/max macros.  Syntax not a big deal, it can be fixed later, just
> don't
> > > break anything when introducing them.
> > 
> > Nothing has happened on this ticket since it was introduced in 2006.  Do
> > we need MIN/MAX macros?  If so, why, or where do we expect them to be
> used?
> > 
> > Pm
> 
> Defining them on a 2's complement machine would be easy as pie:
> 
> #define MAX_UINTVAL (UINTVAL)((INTVAL)-1)
> #define MIN_UINTVAL (UINTVAL)0
> #define MAX_INTVAL  (((INTVAL)-1) / 2)
> #define MIN_INTVAL  ((~MAX_INTVAL) + 1)
> 
> ...and repeat for any other integral typedefs we have.
> 
> I do we even support any architecture that isn't 2's complement-based?
> 
> --Andrew Whitworth

+1 to apply and resolve.


More information about the parrot-dev mailing list