]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix coding style of some Haiku files
authorPo Lu <luangruo@yahoo.com>
Tue, 7 Jun 2022 12:13:10 +0000 (12:13 +0000)
committerPo Lu <luangruo@yahoo.com>
Tue, 7 Jun 2022 12:13:42 +0000 (12:13 +0000)
* src/haiku_support.cc: (FrameResized):
(class EmacsView, AfterResize): Fix coding and initializer
style.

* src/haiku_support.h (struct haiku_resize_event): Rename
confusingly named fields.
* src/haikuterm.c (haiku_read_socket): Update accordingly.

src/haiku_support.cc
src/haiku_support.h
src/haikuterm.c

index 3b1a2cfcb38373a1dcd831bcd2c03fd989bb7fce..3c8e5dc8c2e871f25c8b50f92d03a1b07c93f650 100644 (file)
@@ -1103,8 +1103,8 @@ public:
   {
     struct haiku_resize_event rq;
     rq.window = this;
-    rq.px_heightf = newHeight + 1.0f;
-    rq.px_widthf = newWidth + 1.0f;
+    rq.width = newWidth + 1.0f;
+    rq.height = newHeight + 1.0f;
 
     haiku_write (FRAME_RESIZED, &rq);
     BWindow::FrameResized (newWidth, newHeight);
@@ -1492,25 +1492,36 @@ public:
 class EmacsView : public BView
 {
 public:
-  uint32_t previous_buttons = 0;
-  int looper_locked_count = 0;
+  uint32_t previous_buttons;
+  int looper_locked_count;
   BRegion sb_region;
   BRegion invalid_region;
 
-  BView *offscreen_draw_view = NULL;
-  BBitmap *offscreen_draw_bitmap_1 = NULL;
-  BBitmap *copy_bitmap = NULL;
+  BView *offscreen_draw_view;
+  BBitmap *offscreen_draw_bitmap_1;
+  BBitmap *copy_bitmap;
 
 #ifdef USE_BE_CAIRO
-  cairo_surface_t *cr_surface = NULL;
-  cairo_t *cr_context = NULL;
+  cairo_surface_t *cr_surface;
+  cairo_t *cr_context;
   BLocker cr_surface_lock;
 #endif
 
   BPoint tt_absl_pos;
-  BMessage *wait_for_release_message = NULL;
-
-  EmacsView () : BView (BRect (0, 0, 0, 0), "Emacs", B_FOLLOW_NONE, B_WILL_DRAW)
+  BMessage *wait_for_release_message;
+
+  EmacsView () : BView (BRect (0, 0, 0, 0), "Emacs",
+                       B_FOLLOW_NONE, B_WILL_DRAW),
+                previous_buttons (0),
+                looper_locked_count (0),
+                offscreen_draw_view (NULL),
+                offscreen_draw_bitmap_1 (NULL),
+                copy_bitmap (NULL),
+#ifdef USE_BE_CAIRO
+                cr_surface (NULL),
+                cr_context (NULL),
+#endif
+                wait_for_release_message (NULL)
   {
 
   }
@@ -1658,9 +1669,7 @@ public:
 #endif
 
        if (looper_locked_count)
-         {
-           offscreen_draw_bitmap_1->Lock ();
-         }
+         offscreen_draw_bitmap_1->Lock ();
 
        UnlockLooper ();
       }
index 9597c24c5db648d36506a467daea791949bdbb47..a2ad222f85a0e2a2301e2f4056226e9faae11e1a 100644 (file)
@@ -129,8 +129,8 @@ struct haiku_quit_requested_event
 struct haiku_resize_event
 {
   void *window;
-  float px_heightf;
-  float px_widthf;
+  float width;
+  float height;
 };
 
 struct haiku_expose_event
index 0a994b7e605ca079c4e4fd3ff52e216d67dce959..55e8640ec21dca284bae0d1be008cafd855bcd2c 100644 (file)
@@ -3143,8 +3143,8 @@ haiku_read_socket (struct terminal *terminal, struct input_event *hold_quit)
            if (!f)
              continue;
 
-           int width = lrint (b->px_widthf);
-           int height = lrint (b->px_heightf);
+           int width = lrint (b->width);
+           int height = lrint (b->height);
 
            if (FRAME_OUTPUT_DATA (f)->wait_for_event_type
                == FRAME_RESIZED)