diff options
| author | Eli Zaretskii | 2024-10-22 04:56:19 -0400 |
|---|---|---|
| committer | Eli Zaretskii | 2024-10-22 04:56:19 -0400 |
| commit | 9accfc24bcd82087d936cf7ee37470f86cac8ea7 (patch) | |
| tree | 58a4a82579d92c4e1595c41f21dfe82125deba14 | |
| parent | 55af24a1c29724401d66ddd485cf6e4776fe5050 (diff) | |
| download | emacs-9accfc24bcd82087d936cf7ee37470f86cac8ea7.tar.gz emacs-9accfc24bcd82087d936cf7ee37470f86cac8ea7.zip | |
Fix compilation warnings
* src/frame.c (tty_child_size_param):
* src/frame.h (MOUSE_HL_INFO): Avoid NULL dereference warnings.
| -rw-r--r-- | src/frame.c | 16 | ||||
| -rw-r--r-- | src/frame.h | 4 |
2 files changed, 12 insertions, 8 deletions
diff --git a/src/frame.c b/src/frame.c index 2b90d9b524c..6b7f04aed80 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -1428,7 +1428,7 @@ tty_child_size_param (struct frame *child, Lisp_Object key, | |||
| 1428 | if (CONSP (val)) | 1428 | if (CONSP (val)) |
| 1429 | { | 1429 | { |
| 1430 | /* Width and height may look like (width text-pixels | 1430 | /* Width and height may look like (width text-pixels |
| 1431 | . PIXELS) on window systems. Mimic that. */ | 1431 | . PIXELS) on window systems. Mimic that. */ |
| 1432 | val = XCDR (val); | 1432 | val = XCDR (val); |
| 1433 | if (EQ (val, Qtext_pixels)) | 1433 | if (EQ (val, Qtext_pixels)) |
| 1434 | val = XCDR (val); | 1434 | val = XCDR (val); |
| @@ -1436,11 +1436,17 @@ tty_child_size_param (struct frame *child, Lisp_Object key, | |||
| 1436 | else if (FLOATP (val)) | 1436 | else if (FLOATP (val)) |
| 1437 | { | 1437 | { |
| 1438 | /* Width and height may be a float, in which case | 1438 | /* Width and height may be a float, in which case |
| 1439 | it's a multiple of the parent's value. */ | 1439 | it's a multiple of the parent's value. */ |
| 1440 | struct frame *parent = FRAME_PARENT_FRAME (child); | 1440 | struct frame *parent = FRAME_PARENT_FRAME (child); |
| 1441 | int sz = (EQ (key, Qwidth) ? FRAME_TOTAL_COLS (parent) | 1441 | eassert (parent); /* the caller ensures this, but... */ |
| 1442 | : FRAME_TOTAL_LINES (parent)); | 1442 | if (parent) |
| 1443 | val = make_fixnum (XFLOAT_DATA (val) * sz); | 1443 | { |
| 1444 | int sz = (EQ (key, Qwidth) ? FRAME_TOTAL_COLS (parent) | ||
| 1445 | : FRAME_TOTAL_LINES (parent)); | ||
| 1446 | val = make_fixnum (XFLOAT_DATA (val) * sz); | ||
| 1447 | } | ||
| 1448 | else | ||
| 1449 | val = Qnil; | ||
| 1444 | } | 1450 | } |
| 1445 | 1451 | ||
| 1446 | if (FIXNATP (val)) | 1452 | if (FIXNATP (val)) |
diff --git a/src/frame.h b/src/frame.h index 0b7368fb29b..9a9d025e638 100644 --- a/src/frame.h +++ b/src/frame.h | |||
| @@ -1018,9 +1018,7 @@ default_pixels_per_inch_y (void) | |||
| 1018 | #ifndef HAVE_ANDROID | 1018 | #ifndef HAVE_ANDROID |
| 1019 | # define MOUSE_HL_INFO(F) \ | 1019 | # define MOUSE_HL_INFO(F) \ |
| 1020 | (FRAME_WINDOW_P (F) \ | 1020 | (FRAME_WINDOW_P (F) \ |
| 1021 | ? (FRAME_OUTPUT_DATA (F) \ | 1021 | ? &FRAME_DISPLAY_INFO (F)->mouse_highlight \ |
| 1022 | ? &FRAME_DISPLAY_INFO (F)->mouse_highlight \ | ||
| 1023 | : NULL) \ | ||
| 1024 | : &(F)->output_data.tty->display_info->mouse_highlight) | 1022 | : &(F)->output_data.tty->display_info->mouse_highlight) |
| 1025 | #else | 1023 | #else |
| 1026 | /* There is no "struct tty_output" on Android at all. */ | 1024 | /* There is no "struct tty_output" on Android at all. */ |