diff src/macfns.c @ 56146:5e784b2ea638

* macfns.c (Fx_display_color_cells): Do not limit return value to 256. * macterm.c (mac_initialize_display_info): Initialize n_planes correctly on Mac OSX.
author Jan Djärv <jan.h.d@swipnet.se>
date Thu, 17 Jun 2004 13:04:25 +0000
parents ea8bedb61d89
children df3c9bb112b3 4c90ffeb71c5
line wrap: on
line diff
--- a/src/macfns.c	Thu Jun 17 08:33:27 2004 +0000
+++ b/src/macfns.c	Thu Jun 17 13:04:25 2004 +0000
@@ -2939,8 +2939,8 @@
 {
   struct mac_display_info *dpyinfo = check_x_display_info (display);
 
-  /* MAC_TODO: check whether this is right */
-  return make_number (dpyinfo->n_planes >= 8 ? 256 : 1 << dpyinfo->n_planes - 1);
+  /* We force 24+ bit depths to 24-bit to prevent an overflow.  */
+  return make_number (1 << min (dpyinfo->n_planes, 24));
 }
 
 DEFUN ("x-server-max-request-size", Fx_server_max_request_size,