[Top][All Lists]

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

Re: Type-error in C code

From: Jan Djärv
Subject: Re: Type-error in C code
Date: Sat, 13 Nov 2010 23:23:29 +0100
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; sv-SE; rv: Gecko/20101013 Thunderbird/3.1.5

Thien-Thi Nguyen skrev 2010-11-13 20.52:
() Jan Djärv<address@hidden>
() Sat, 13 Nov 2010 20:19:05 +0100
    However, I fixed the code to use make_fixnum_or_float anyway.
    In the future somebody may come along and wonder why a 32-bit
    number is put in a Lisp integer.

Not if they understand that an Atom is NOT a 32-bit number.
Perhaps if you revert the change and explain the limits of
the type in a nice comment, future programmers will not be
inclined to wonder when they look (only) at the source.

I think routing through ‘make_fixnum_or_float’ is suboptimal.

This code is only used when changing fullscreen or sticky frame parameter.
And that does not happen often. An extra check that ensures the value is below max fixnum is too small to be worth to optimize away. If atoms are 29 bits, they will be fixnum anyway.

        Jan D.

reply via email to

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