]> git.eshelyaron.com Git - emacs.git/commitdiff
* image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 28 Jul 2011 09:40:05 +0000 (02:40 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 28 Jul 2011 09:40:05 +0000 (02:40 -0700)
In other words, assume that every image size is allowed, on non-X
hosts.  This assumption is probably wrong, but it lets Emacs compile.

src/ChangeLog
src/image.c

index 7da6dcbee8fea1a5b786da75d04527d15e283fa8..045c431178921aa9af034ddfe8be4dce97f67c45 100644 (file)
@@ -1,3 +1,9 @@
+2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
+       In other words, assume that every image size is allowed, on non-X
+       hosts.  This assumption is probably wrong, but it lets Emacs compile.
+
 2011-07-28  Andreas Schwab  <schwab@linux-m68k.org>
 
        * regex.c (re_iswctype): Convert return values to boolean.
index 7a5ac40b3d29842da74eb557347e97ab881e69eb..fb1d825fa5484a8a0aa236978bc9ae00761d44b8 100644 (file)
@@ -1906,16 +1906,17 @@ static int x_create_x_image_and_pixmap (struct frame *, int, int, int,
 static void x_destroy_x_image (XImagePtr);
 static void x_put_x_image (struct frame *, XImagePtr, Pixmap, int, int);
 
-/* Return nonzero if XIMG's size WIDTH x HEIGHT doesn't break X.
+/* Return nonzero if XIMG's size WIDTH x HEIGHT doesn't break the
+   windowing system.
    WIDTH and HEIGHT must both be positive.
    If XIMG is null, assume it is a bitmap.  */
 static int
 x_check_image_size (XImagePtr ximg, int width, int height)
 {
+#ifdef HAVE_X_WINDOWS
   /* Respect Xlib's limits: it cannot deal with images that have more
      than INT_MAX (and/or UINT_MAX) bytes.  And respect Emacs's limits
-     of PTRDIFF_MAX (and/or SIZE_MAX) bytes for any object.  For now,
-     assume all windowing systems have the same limits that X does.  */
+     of PTRDIFF_MAX (and/or SIZE_MAX) bytes for any object.  */
   enum
   {
     XLIB_BYTES_MAX = min (INT_MAX, UINT_MAX),
@@ -1937,6 +1938,11 @@ x_check_image_size (XImagePtr ximg, int width, int height)
     }
   return (width <= (INT_MAX - (bitmap_pad - 1)) / depth
          && height <= X_IMAGE_BYTES_MAX / bytes_per_line);
+#else
+  /* FIXME: Implement this check for the HAVE_NS and HAVE_NTGUI cases.
+     For now, assume that every image size is allowed on these systems.  */
+  return 1;
+#endif
 }
 
 /* Create an XImage and a pixmap of size WIDTH x HEIGHT for use on