From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,dae0d16459f3b8ae X-Google-Attributes: gidfee84,public X-Google-Thread: 102b9a,824138e43ad71fbd,start X-Google-Attributes: gid102b9a,public X-Google-ArrivalTime: 1994-06-01 00:51:33 PST Path: bga.com!news.sprintlink.net!hookup!usc!math.ohio-state.edu!jussieu.fr!univ-lyon1.fr!swidir.switch.ch!epflnews!monnier From: monnier@di.epfl.ch (Stefan Monnier) Newsgroups: comp.unix.osf.osf1,comp.emacs Subject: Re: emacs-19.24 being ported to alpha ? Date: 1 Jun 1994 05:09:20 GMT Organization: Ecole Polytechnique Federale de Lausanne Message-ID: <2sh560$ivv@info.epfl.ch> References: <2sfbot$c9a@elna.ethz.ch> NNTP-Posting-Host: didec4.epfl.ch Xref: bga.com comp.unix.osf.osf1:1824 comp.emacs:2109 In article , Henk Mos wrote: > Yes, I had the same problem. There is a bitshift problem with the > float-to-int conversion in floatfns.c. Compiling with gcc will show the > warnings. > floatfns.c has a lot of changes compared to 19.22 but I closed my eyes > and replaced it with the 19.22 version and recompiled. > Everything (including scrollbar) works fine now. Another "solution" is to correct the bitshifts. The problem is pretty simple (as explained by gcc): the shift is too big for the data type. Actually the reason it is too big is because it's done on a constant "1" which is considered as int, whereas the shift assumes it is a long. Replacing it with "1L" tells the compiler it's a long. I also changed the subsequent cast to int into a cast to long.. don't know if it helps or hurts or does nothing, but... The scrollbars seem to work now, at least. The floatfns.c file looks like this now (from line 178): -------------------------------------------------------------------- ... /* Convert float to Lisp_Int if it fits, else signal a range error using the given arguments. */ #define FLOAT_TO_INT(x, i, name, num) \ do \ { \ if ((x) >= (1L << (VALBITS-1)) || (x) <= - (1L << (VALBITS-1)) - 1) \ range_error (name, num); \ XSET (i, Lisp_Int, (long)(x)); \ } \ while (0) #define FLOAT_TO_INT2(x, i, name, num1, num2) \ do \ { \ if ((x) >= (1L << (VALBITS-1)) || (x) <= - (1L << (VALBITS-1)) - 1) \ range_error2 (name, num1, num2); \ XSET (i, Lisp_Int, (long)(x)); \ } \ while (0) ... --------------------------------------------------------------------- I don't feel very comfortable with that fix (probably because it's not really portable as far as I know), but it works on my alpha, so I'm happy. Stefan