From 85f1df1b1ac4571ac81b505d10bce8ad4e19ec5b Mon Sep 17 00:00:00 2001 From: Teruaki Kawashima Date: Tue, 5 Oct 2010 13:17:02 +0000 Subject: [PATCH] fix crash after unplugging USB while in image viewer plugin. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28211 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/imageviewer/imageviewer.c | 3 --- apps/plugins/imageviewer/imageviewer.h | 11 ++++++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/apps/plugins/imageviewer/imageviewer.c b/apps/plugins/imageviewer/imageviewer.c index eb1ce498a1..e3c72ae291 100644 --- a/apps/plugins/imageviewer/imageviewer.c +++ b/apps/plugins/imageviewer/imageviewer.c @@ -403,9 +403,6 @@ void cb_progress(int current, int total) #define VSCROLL (LCD_HEIGHT/8) #define HSCROLL (LCD_WIDTH/10) -#define ZOOM_IN 100 /* return codes for below function */ -#define ZOOM_OUT 101 - /* Pan the viewing window right - move image to the left and fill in the right-hand side */ static void pan_view_right(struct image_info *info) diff --git a/apps/plugins/imageviewer/imageviewer.h b/apps/plugins/imageviewer/imageviewer.h index 79ac5ed9f1..6c137cc47f 100644 --- a/apps/plugins/imageviewer/imageviewer.h +++ b/apps/plugins/imageviewer/imageviewer.h @@ -382,9 +382,14 @@ #define MIN_MEM 120000 /* State code for output with return. */ -#define PLUGIN_OTHER 10 -#define PLUGIN_ABORT 11 -#define PLUGIN_OUTOFMEM 12 +enum { + PLUGIN_OTHER = 0x200, + PLUGIN_ABORT, + PLUGIN_OUTOFMEM, + + ZOOM_IN, + ZOOM_OUT, +}; #if (CONFIG_PLATFORM & PLATFORM_NATIVE) && defined(HAVE_DISK_STORAGE) #define DISK_SPINDOWN