Dear Jerry and Jeff -

On Sat, Apr 16, 2011 at 10:39 PM, Jerry James <james@xemacs.org> wrote:
On Sat, Apr 16, 2011 at 5:31 PM, Jeff Sparkes <jsparkes@gmail.com> wrote:
> I don't even see a << in my patch!?  Maybe some header is converting log2
> into a shift?  Neither gcc nor g++ complained about this on my Ubuntu
> system.  I'll add explicit casts.  Try this patch.

make_int is doing the shifting, because of the tag bits.  The problem
is that log2() produces a double instead of an int.  There was no
patch attached to your message, but casting the result of log2() to an
int is the way to go.

 Yes, this patch seems to work:

diff -r 5ec4534daf16 src/ChangeLog
--- a/src/ChangeLog Thu Apr 14 08:40:18 2011 -0400
+++ b/src/ChangeLog Sat Apr 16 23:37:19 2011 -0400
@@ -1,0 +1,5 @@
+2011-04-16  Vin Shelton  <acs@xemacs.org>
+
+ * device-tty.c (tty_device_system_metrics): Cast result of log2()
+ call to int so make_int() will be able to handle it.
+
diff -r 5ec4534daf16 src/device-tty.c
--- a/src/device-tty.c Thu Apr 14 08:40:18 2011 -0400
+++ b/src/device-tty.c Sat Apr 16 23:37:19 2011 -0400
@@ -197,7 +197,7 @@
       return Fcons (make_int (CONSOLE_TTY_DATA (con)->width),
     make_int (CONSOLE_TTY_DATA (con)->height));
     case DM_num_bit_planes:
-      return make_int (log2 (CONSOLE_TTY_DATA (con)->colors));
+      return make_int ((int)log2 (CONSOLE_TTY_DATA (con)->colors));
     case DM_num_color_cells:
       return make_int (CONSOLE_TTY_DATA (con)->colors);
     default: /* No such device metric property for TTY devices */


  - Vin