]> git.eshelyaron.com Git - emacs.git/commitdiff
Minor image_error related cleanups
authorStefan Kangas <stefankangas@gmail.com>
Wed, 22 Jan 2025 22:42:13 +0000 (23:42 +0100)
committerEshel Yaron <me@eshelyaron.com>
Thu, 23 Jan 2025 10:25:16 +0000 (11:25 +0100)
* src/image.c (image_create_x_image_and_pixmap_1): Avoid temporary
variable by passing the value directly to image_error.
(tiff_handler): Prefer image_error to add_to_log for local
consistency.

(cherry picked from commit d3ada49a37e19d25170bf6322fee70d527055958)

src/image.c

index 1db2df736a5ef81596b6993febc46a3fa5ea8eca..de6955c2a47b06c965da3fe518b8f74d5971ff39 100644 (file)
@@ -4140,10 +4140,8 @@ image_create_x_image_and_pixmap_1 (struct frame *f, int width, int height, int d
   if (*pixmap == NULL)
     {
       DWORD err = GetLastError ();
-      Lisp_Object errcode;
       /* All system errors are < 10000, so the following is safe.  */
-      XSETINT (errcode, err);
-      image_error ("Unable to create bitmap, error code %d", errcode);
+      image_error ("Unable to create bitmap, error code %d", make_fixnum (err));
       image_destroy_x_image (*pimg);
       *pimg = NULL;
       return 0;
@@ -9400,8 +9398,8 @@ tiff_handler (const char *log_format, const char *title,
      log entry, it's OK to truncate it.  */
   char buf[4000];
   int len = vsnprintf (buf, sizeof buf, format, ap);
-  add_to_log (log_format, build_string (title),
-             make_string (buf, max (0, min (len, sizeof buf - 1))));
+  image_error (log_format, build_string (title),
+              make_string (buf, max (0, min (len, sizeof buf - 1))));
 }
 # undef MINGW_STATIC