emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EMACS_INT cleanup


From: Eli Zaretskii
Subject: Re: EMACS_INT cleanup
Date: Thu, 23 Sep 2010 22:46:09 +0200

> From: Lars Magne Ingebrigtsen <address@hidden>
> Date: Thu, 23 Sep 2010 22:41:45 +0200
> 
> Lars Magne Ingebrigtsen <address@hidden> writes:
> 
> > I just added the (int) here, which seemed to do the trick:
> >
> > #define USE_SAFE_ALLOCA                     \
> >   int sa_count = (int) SPECPDL_INDEX (), sa_must_free = 0
> 
> Or perhaps this would be better:
> 
> #define SPECPDL_INDEX()       ((int) (specpdl_ptr - specpdl))
> 
> It'd get rid of a lot of warnings, and we're really returning an int,
> aren't we?  Sort of?

Better make it a type that is 64-bit wide on a 64-bit host.  Perhaps

  #define SPECPDL_INDEX()       ((unsigned long) (specpdl_ptr - specpdl))

Although I doubt that someone will have more than 2GB or
unwind_protect'ed methods, but it's probably cleaner that way, because
it doesn't require one reason about the possible magnitude of the
values.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]