[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemacs-devel] [PATCH] Haiku: Fix warnings + cleanups
From: |
François Revol |
Subject: |
[Qemacs-devel] [PATCH] Haiku: Fix warnings + cleanups |
Date: |
Wed, 18 Dec 2013 13:07:07 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130630 Icedove/17.0.7 |
* remove unused variables/functions
* remove commented out debug output
* make haiku_dpy static; no need to memcpy() it
* Fix calling [un]init_appplication()
Index: haiku.cpp
===================================================================
RCS file: /sources/qemacs/qemacs/haiku.cpp,v
retrieving revision 1.3
diff -u -r1.3 haiku.cpp
--- haiku.cpp 17 Dec 2013 16:08:56 -0000 1.3
+++ haiku.cpp 18 Dec 2013 12:04:11 -0000
@@ -33,8 +33,6 @@
#include <View.h>
#include <Window.h>
-extern QEDisplay haiku_dpy;
-
static int force_tty = 0;
static int font_xsize;
@@ -185,9 +183,7 @@
void QEView::KeyUp(const char *bytes, int32 numBytes)
{
- uint32 mods;
BMessage *message = Window()->DetachCurrentMessage();
- //message->PrintToStream();
bmessage_input(NULL, this, message);
}
@@ -214,13 +210,6 @@
return 2;
}
-static int32 bapp_quit_thread(void *arg)
-{
- be_app->Lock();
- be_app->Quit();
- return 0;
-}
-
static int32 bapp_thread(void *arg)
{
be_app->Lock();
@@ -269,10 +258,7 @@
int xsize, ysize, font_ysize;
WindowState *ctx;
- if (!be_app)
- init_application();
-
- memcpy(&s->dpy, &haiku_dpy, sizeof(QEDisplay));
+ init_application();
ctx = (WindowState *)malloc(sizeof(WindowState));
if (ctx == NULL)
@@ -344,6 +330,7 @@
ctx->w->Lock();
ctx->w->Quit();
free(s->priv_data);
+ uninit_application();
}
static void haiku_flush(QEditScreen *s)
@@ -370,19 +357,14 @@
{
QEditScreen *s = (QEditScreen *)opaque;
WindowState *ctx = (WindowState *)s->priv_data;
- unsigned char buf[16];
bigtime_t timestamp_ms;
BMessage *event;
//fprintf(stderr, "%s()\n", __FUNCTION__);
- /*
- KeySym keysym;
- */
- int shift, ctrl, meta, len, key = 0;
+ int shift, ctrl, meta, key = 0;
QEEvent ev1, *ev = &ev1;
- if (read(ctx->events_rd, &event, sizeof(BMessage *)) <
sizeof(BMessage *))
+ if (read(ctx->events_rd, &event, sizeof(event)) <
(signed)sizeof(event))
return;
- //event->PrintToStream();
switch(event->what) {
case B_QUIT_REQUESTED:
@@ -411,14 +393,7 @@
case B_VIEW_RESIZED:
{
int32 width, height;
- int columns, rows;
- //event->PrintToStream();
-/*
- if (event->FindInt32("width", &width) < B_OK)
- break;
- if (event->FindInt32("height", &height) < B_OK)
- break;
-*/
+
ctx->v->LockLooper();
width = ctx->v->Bounds().IntegerWidth() + 1;
@@ -504,7 +479,6 @@
case B_KEY_DOWN:
{
- unsigned int mods = 0;
uint32 state;
//event->PrintToStream();
uint32 scancode;
@@ -643,7 +617,7 @@
key = utf8_decode(&p);
}
- got_key:
+ //got_key:
if (key) {
ev->key_event.type = QE_KEY_EVENT;
ev->key_event.key = key;
@@ -829,7 +803,7 @@
b->priv_data = NULL;
}
-extern QEDisplay haiku_dpy = {
+static QEDisplay haiku_dpy = {
"haiku",
haiku_probe,
haiku_init,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Qemacs-devel] [PATCH] Haiku: Fix warnings + cleanups,
François Revol <=