aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Kangas2025-01-22 23:42:13 +0100
committerStefan Kangas2025-01-22 23:42:13 +0100
commitd3ada49a37e19d25170bf6322fee70d527055958 (patch)
treee3f048556d820dc4a57ab7ad7113f77e64ff38ae /src
parentbf55eb1a8ae95051ac5c8a646b2a106053d7b1b7 (diff)
downloademacs-d3ada49a37e19d25170bf6322fee70d527055958.tar.gz
emacs-d3ada49a37e19d25170bf6322fee70d527055958.zip
Minor image_error related cleanups
* 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.
Diffstat (limited to 'src')
-rw-r--r--src/image.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/image.c b/src/image.c
index 1db2df736a5..de6955c2a47 100644
--- a/src/image.c
+++ b/src/image.c
@@ -4140,10 +4140,8 @@ image_create_x_image_and_pixmap_1 (struct frame *f, int width, int height, int d
4140 if (*pixmap == NULL) 4140 if (*pixmap == NULL)
4141 { 4141 {
4142 DWORD err = GetLastError (); 4142 DWORD err = GetLastError ();
4143 Lisp_Object errcode;
4144 /* All system errors are < 10000, so the following is safe. */ 4143 /* All system errors are < 10000, so the following is safe. */
4145 XSETINT (errcode, err); 4144 image_error ("Unable to create bitmap, error code %d", make_fixnum (err));
4146 image_error ("Unable to create bitmap, error code %d", errcode);
4147 image_destroy_x_image (*pimg); 4145 image_destroy_x_image (*pimg);
4148 *pimg = NULL; 4146 *pimg = NULL;
4149 return 0; 4147 return 0;
@@ -9400,8 +9398,8 @@ tiff_handler (const char *log_format, const char *title,
9400 log entry, it's OK to truncate it. */ 9398 log entry, it's OK to truncate it. */
9401 char buf[4000]; 9399 char buf[4000];
9402 int len = vsnprintf (buf, sizeof buf, format, ap); 9400 int len = vsnprintf (buf, sizeof buf, format, ap);
9403 add_to_log (log_format, build_string (title), 9401 image_error (log_format, build_string (title),
9404 make_string (buf, max (0, min (len, sizeof buf - 1)))); 9402 make_string (buf, max (0, min (len, sizeof buf - 1))));
9405} 9403}
9406# undef MINGW_STATIC 9404# undef MINGW_STATIC
9407 9405