From 38d72d8d888c4d0714b9ec783160d4e45215eb71 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Sun, 17 Apr 2022 07:29:36 +0000 Subject: [PATCH] Get rid of unused flags on Haiku * src/haikufns.c (haiku_free_frame_resources): Syntax fixes. * src/haikumenu.c (set_frame_menubar, run_menu_bar_help_event): * src/haikuterm.c (haiku_read_socket): Stop setting and consulting `menu_up_to_date_p'. * src/haikuterm.h (struct haiku_output): Delete `menu_up_to_date_p'. --- src/haikufns.c | 2 +- src/haikumenu.c | 15 ++------------- src/haikuterm.c | 10 ++++------ src/haikuterm.h | 8 ++++---- 4 files changed, 11 insertions(+), 24 deletions(-) diff --git a/src/haikufns.c b/src/haikufns.c index 128831dec2a..b040e6cafaa 100644 --- a/src/haikufns.c +++ b/src/haikufns.c @@ -1545,7 +1545,7 @@ haiku_free_frame_resources (struct frame *f) BWindow_quit (window); if (FRAME_OUTPUT_DATA (f)->saved_menu_event) - xfree (FRAME_OUTPUT_DATA (f))->saved_menu_event; + xfree (FRAME_OUTPUT_DATA (f)->saved_menu_event); xfree (FRAME_OUTPUT_DATA (f)); FRAME_OUTPUT_DATA (f) = NULL; diff --git a/src/haikumenu.c b/src/haikumenu.c index 8aced5f9d43..5b370f8f992 100644 --- a/src/haikumenu.c +++ b/src/haikumenu.c @@ -541,7 +541,6 @@ set_frame_menubar (struct frame *f, bool deep_p) if (!deep_p) { - FRAME_OUTPUT_DATA (f)->menu_up_to_date_p = 0; items = FRAME_MENU_BAR_ITEMS (f); Lisp_Object string; @@ -654,8 +653,6 @@ set_frame_menubar (struct frame *f, bool deep_p) set_buffer_internal_1 (prev); - FRAME_OUTPUT_DATA (f)->menu_up_to_date_p = 1; - /* If there has been no change in the Lisp-level contents of the menu bar, skip redisplaying it. Just exit. */ @@ -705,19 +702,11 @@ set_frame_menubar (struct frame *f, bool deep_p) void run_menu_bar_help_event (struct frame *f, int mb_idx) { - Lisp_Object frame; - Lisp_Object vec; - Lisp_Object help; - - block_input (); - if (!FRAME_OUTPUT_DATA (f)->menu_up_to_date_p) - { - unblock_input (); - return; - } + Lisp_Object frame, vec, help; XSETFRAME (frame, f); + block_input (); if (mb_idx < 0) { kbd_buffer_store_help_event (frame, Qnil); diff --git a/src/haikuterm.c b/src/haikuterm.c index 45d22ce22fb..8499dad932e 100644 --- a/src/haikuterm.c +++ b/src/haikuterm.c @@ -3525,9 +3525,8 @@ haiku_read_socket (struct terminal *terminal, struct input_event *hold_quit) if (!f || !FRAME_EXTERNAL_MENU_BAR (f)) continue; - if (FRAME_OUTPUT_DATA (f)->menu_up_to_date_p) - find_and_call_menu_selection (f, f->menu_bar_items_used, - f->menu_bar_vector, b->ptr); + find_and_call_menu_selection (f, f->menu_bar_items_used, + f->menu_bar_vector, b->ptr); break; } case FILE_PANEL_EVENT: @@ -3551,12 +3550,11 @@ haiku_read_socket (struct terminal *terminal, struct input_event *hold_quit) continue; struct frame *f = haiku_window_to_frame (b->window); - if (!f || !FRAME_EXTERNAL_MENU_BAR (f) || - !FRAME_OUTPUT_DATA (f)->menu_bar_open_p) + if (!f || !FRAME_EXTERNAL_MENU_BAR (f) + || !FRAME_OUTPUT_DATA (f)->menu_bar_open_p) continue; run_menu_bar_help_event (f, b->mb_idx); - break; } case ZOOM_EVENT: diff --git a/src/haikuterm.h b/src/haikuterm.h index e922743b18c..df4e7d47e8f 100644 --- a/src/haikuterm.h +++ b/src/haikuterm.h @@ -154,13 +154,13 @@ struct haiku_output haiku view; haiku menubar; - int menu_up_to_date_p; - int zoomed_p; - int hourglass_p; - int menu_bar_open_p; int fontset; int baseline_offset; + bool_bf zoomed_p : 1; + bool_bf hourglass_p : 1; + bool_bf menu_bar_open_p : 1; + /* Whether or not there is data in a back buffer that hasn't been displayed yet. */ bool dirty_p; -- 2.39.2