diff options
| author | [email protected] <[email protected]> | 2012-04-16 04:58:50 +0000 |
|---|---|---|
| committer | [email protected] <[email protected]> | 2012-04-16 04:58:50 +0000 |
| commit | e86f34052123539439cb42cfdfc444432e6232f2 (patch) | |
| tree | 8a88de4bac30f248eefec758832e885cbf2a9bad /components | |
| parent | 016aeaf2ff538d96d4dfea2059403debd6b5ab40 (diff) | |
fixed RT-Thread/GUI building warning.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2079 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'components')
| -rw-r--r-- | components/rtgui/common/image.c | 30 | ||||
| -rw-r--r-- | components/rtgui/common/rtgui_system.c | 2 | ||||
| -rw-r--r-- | components/rtgui/include/rtgui/widgets/list_view.h | 2 | ||||
| -rw-r--r-- | components/rtgui/widgets/list_view.c | 4 |
4 files changed, 19 insertions, 19 deletions
diff --git a/components/rtgui/common/image.c b/components/rtgui/common/image.c index 0160c990ea..45a1013a69 100644 --- a/components/rtgui/common/image.c +++ b/components/rtgui/common/image.c @@ -64,47 +64,47 @@ void rtgui_system_image_init(void) #endif } -static struct rtgui_image_engine* rtgui_image_get_engine_by_filename(const char* fn) +static struct rtgui_image_engine* rtgui_image_get_engine(const char* type) { struct rtgui_list_node *node; struct rtgui_image_engine *engine; - const char* ext; - - ext = fn + rt_strlen(fn); - while (ext != fn) - { - if (*ext == '.') { ext ++; break; } - ext --; - } - if (ext == fn) return RT_NULL; /* no ext */ rtgui_list_foreach(node, &_rtgui_system_image_list) { engine = rtgui_list_entry(node, struct rtgui_image_engine, list); - if (strncasecmp(engine->name, ext, strlen(engine->name)) == 0) + + if (strncasecmp(engine->name, type, strlen(engine->name)) ==0) return engine; } return RT_NULL; } -static struct rtgui_image_engine* rtgui_image_get_engine(const char* type) +#if defined(RTGUI_USING_DFS_FILERW) || defined(RTGUI_USING_STDIO_FILERW)
+static struct rtgui_image_engine* rtgui_image_get_engine_by_filename(const char* fn) { struct rtgui_list_node *node; struct rtgui_image_engine *engine; + const char* ext; + + ext = fn + rt_strlen(fn); + while (ext != fn) + { + if (*ext == '.') { ext ++; break; } + ext --; + } + if (ext == fn) return RT_NULL; /* no ext */ rtgui_list_foreach(node, &_rtgui_system_image_list) { engine = rtgui_list_entry(node, struct rtgui_image_engine, list); - - if (strncasecmp(engine->name, type, strlen(engine->name)) ==0) + if (strncasecmp(engine->name, ext, strlen(engine->name)) == 0) return engine; } return RT_NULL; } -#if defined(RTGUI_USING_DFS_FILERW) || defined(RTGUI_USING_STDIO_FILERW) struct rtgui_image* rtgui_image_create_from_file(const char* type, const char* filename, rt_bool_t load) { struct rtgui_filerw* filerw; diff --git a/components/rtgui/common/rtgui_system.c b/components/rtgui/common/rtgui_system.c index 5005156ec5..3d9d48445c 100644 --- a/components/rtgui/common/rtgui_system.c +++ b/components/rtgui/common/rtgui_system.c @@ -21,7 +21,7 @@ #include <rtgui/widgets/window.h> #include <rtgui/rtgui_theme.h> -// #define RTGUI_EVENT_DEBUG +#define RTGUI_EVENT_DEBUG #ifdef _WIN32 #define RTGUI_EVENT_DEBUG diff --git a/components/rtgui/include/rtgui/widgets/list_view.h b/components/rtgui/include/rtgui/widgets/list_view.h index 09f6520b71..28792366c8 100644 --- a/components/rtgui/include/rtgui/widgets/list_view.h +++ b/components/rtgui/include/rtgui/widgets/list_view.h @@ -59,7 +59,7 @@ struct rtgui_list_view /* the number of item in a page */
rt_uint16_t page_items;
/* current item */
- rt_uint16_t current_item;
+ rt_int16_t current_item;
/* icon layout */
rt_uint8_t row_items, col_items;
diff --git a/components/rtgui/widgets/list_view.c b/components/rtgui/widgets/list_view.c index bc88062b87..99783f2cf3 100644 --- a/components/rtgui/widgets/list_view.c +++ b/components/rtgui/widgets/list_view.c @@ -96,7 +96,7 @@ static void rtgui_list_view_onicondraw(struct rtgui_list_view* view, struct rtgu }
}
-static void rtgui_list_view_update_icon(struct rtgui_list_view* view, rt_uint16_t old_item)
+static void rtgui_list_view_update_icon(struct rtgui_list_view* view, rt_int16_t old_item)
{
struct rtgui_rect rect, item_rect, drawing_rect;
rt_ubase_t c, r; /* col and row index */
@@ -230,7 +230,7 @@ static void rtgui_list_view_onlistdraw(struct rtgui_list_view* view, struct rtgu }
}
-void rtgui_list_view_update_list(struct rtgui_list_view* view, rt_uint16_t old_item)
+void rtgui_list_view_update_list(struct rtgui_list_view* view, rt_int16_t old_item)
{
struct rtgui_dc* dc;
const struct rtgui_list_item* item;
|
