From a7efb231fe6836315016c08042e30477937635cd Mon Sep 17 00:00:00 2001 From: notaz Date: Fri, 25 Jul 2008 22:20:12 +0000 Subject: [PATCH] misv fixes git-svn-id: file:///home/notaz/opt/svn/PicoDrive@565 be3aeb3a-fb24-0410-a615-afba39da0efa --- Pico/cd/Area.c | 4 +++- platform/pandora/pandora.c | 14 +++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Pico/cd/Area.c b/Pico/cd/Area.c index c4bb2ed..164d272 100644 --- a/Pico/cd/Area.c +++ b/Pico/cd/Area.c @@ -174,7 +174,7 @@ static int g_read_offs = 0; // when is eof really set? #define CHECKED_READ(len,data) \ if (areaRead(data, 1, len, file) != len) { \ - if (len == 1 && areaEof(file)) return 0; \ + if (len == 1 && areaEof(file)) goto readend; \ R_ERROR_RETURN("areaRead: premature EOF\n"); \ return 1; \ } \ @@ -269,6 +269,7 @@ PICO_INTERNAL int PicoCdLoadState(void *file) breakswitch:; } +readend: if (PicoAHW & PAHW_MCD) { /* after load events */ @@ -324,6 +325,7 @@ int PicoCdLoadStateGfx(void *file) } } +readend: return 0; } diff --git a/platform/pandora/pandora.c b/platform/pandora/pandora.c index e6c92d9..9c4fc5c 100644 --- a/platform/pandora/pandora.c +++ b/platform/pandora/pandora.c @@ -217,6 +217,13 @@ void gp2x_init(void) exit(1); } */ + fbdev = open("/dev/fb0", O_RDWR); + if (fbdev == -1) + { + printf("open(\"/dev/fb0\") failed with %i\n", errno); + exit(1); + } + ret = ioctl(fbdev, FBIOGET_FSCREENINFO, &fbfix); if (ret == -1) { @@ -231,13 +238,6 @@ void gp2x_init(void) return; } - fbdev = open("/dev/fb0", O_RDWR); - if (fbdev == -1) - { - printf("open(\"/dev/fb0\") failed with %i\n", errno); - exit(1); - } - screen = mmap(0, SCREEN_MAP_SIZE, PROT_WRITE|PROT_READ, MAP_SHARED, fbdev, 0); if (screen == MAP_FAILED) { -- 2.39.2