]> git.proxmox.com Git - qemu.git/blobdiff - hw/baum.c
Add pci_ne2000_{save/load} functions, then remove pci_dev NE2000State field
[qemu.git] / hw / baum.c
index f47456a881d1ccce40775eb14d7d6ff97f7902b7..b47ea34c4ddc415065d5bb73ce0fcf027b167244 100644 (file)
--- a/hw/baum.c
+++ b/hw/baum.c
 #include "qemu-char.h"
 #include "qemu-timer.h"
 #include "usb.h"
-#include <assert.h>
+#include "baum.h"
 #include <brlapi.h>
 #include <brlapi_constants.h>
 #include <brlapi_keycodes.h>
 #ifdef CONFIG_SDL
-#include <SDL/SDL_syswm.h>
+#include <SDL_syswm.h>
 #endif
 
 #if 0
@@ -90,7 +90,7 @@ typedef struct {
 
     brlapi_handle_t *brlapi;
     int brlapi_fd;
-    int x, y;
+    unsigned int x, y;
 
     uint8_t in_buf[BUF_SIZE];
     uint8_t in_buf_used;
@@ -356,12 +356,12 @@ static int baum_eat_packet(BaumDriverState *baum, const uint8_t *buf, int len)
             .displayNumber = BRLAPI_DISPLAY_DEFAULT,
             .regionBegin = 1,
             .regionSize = baum->x * baum->y,
-            .text = text,
+            .text = (char *)text,
             .textSize = baum->x * baum->y,
             .andMask = zero,
             .orMask = cells,
             .cursor = cursor,
-            .charset = "ISO-8859-1",
+            .charset = (char *)"ISO-8859-1",
         };
 
         if (brlapi__write(baum->brlapi, &wa) == -1)
@@ -574,12 +574,7 @@ CharDriverState *chr_baum_init(void)
     int tty;
 
     baum = qemu_mallocz(sizeof(BaumDriverState));
-    if (!baum)
-        return NULL;
-
     baum->chr = chr = qemu_mallocz(sizeof(CharDriverState));
-    if (!chr)
-        goto fail_baum;
 
     chr->opaque = baum;
     chr->chr_write = baum_write;
@@ -587,8 +582,6 @@ CharDriverState *chr_baum_init(void)
     chr->chr_accept_input = baum_accept_input;
 
     handle = qemu_mallocz(brlapi_getHandleSize());
-    if (!handle)
-        goto fail_chr;
     baum->brlapi = handle;
 
     baum->brlapi_fd = brlapi__openConnection(handle, NULL, NULL);
@@ -629,9 +622,7 @@ fail:
     brlapi__closeConnection(handle);
 fail_handle:
     free(handle);
-fail_chr:
     free(chr);
-fail_baum:
     free(baum);
     return NULL;
 }