[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Same frame-positioning bug as before: negative top/left values on Wi
From: |
Ralf Angeli |
Subject: |
Re: Same frame-positioning bug as before: negative top/left values on Windows |
Date: |
Sat, 22 Jul 2006 09:08:17 +0200 |
* Kim F. Storm (2006-07-21) writes:
> Ralf Angeli <address@hidden> writes:
>
>> + left = w32_get_arg (Qnil, Qleft, "left", "Left", RES_TYPE_NUMBER);
>> + if (!EQ (left, Qunbound))
>> + CHECK_NUMBER (left);
>
>> One gripe I have with it is that the CHECK_NUMBER macro does not seem
>> to work. If I use a string for the `top' or `left' property no error
>> is thrown. Does anybody know why?
>
> You pass RES_TYPE_NUMBER to w32_get_arg, which is
> evaluated like this:
>
> case RES_TYPE_NUMBER:
> return make_number (atoi (SDATA (tem)));
>
> so if the value is not a number, atoi returns zero.
Oh, I see. Thanks for the info. Then I'll have to use
RES_TYPE_STRING if I wanted to catch erroneous values. It's probably
not worth the trouble anyway because a fallback of 0 is not too bad.
The reason I even got the idea of using CHECK_NUMER is code in x_icon
(in w32fns.c), which also uses w32_get_arg with RES_TYPE_NUMBER and
checks with CHECK_NUMBER afterwards. I guess this is a useless check
either.
--
Ralf