From 0d5451c28f3f9efae28b235d8c80988ffd58a8c8 Mon Sep 17 00:00:00 2001 From: "bernard.xiong" Date: Sun, 16 May 2010 02:33:30 +0000 Subject: [PATCH] remove compiling warning. git-svn-id: https://rt-thread.googlecode.com/svn/trunk@714 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- components/rtgui/common/dc_hw.c | 5 ++--- components/rtgui/common/rtgui_xml.c | 7 +------ components/rtgui/include/rtgui/widgets/checkbox.h | 2 +- components/rtgui/widgets/checkbox.c | 2 +- 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/components/rtgui/common/dc_hw.c b/components/rtgui/common/dc_hw.c index 013a07d377..722ff64c57 100644 --- a/components/rtgui/common/dc_hw.c +++ b/components/rtgui/common/dc_hw.c @@ -158,7 +158,7 @@ static rt_bool_t rtgui_dc_hw_fini(struct rtgui_dc* dc) rtgui_toplevel_t* top = RTGUI_TOPLEVEL(hw->owner->toplevel); top->drawing --; - if (top->drawing == 0) + if ((top->drawing == 0) && (hw->visible == RT_TRUE)) { #ifdef __WIN32__ #ifdef RTGUI_USING_MOUSE_CURSOR @@ -186,7 +186,7 @@ static rt_bool_t rtgui_dc_hw_fini(struct rtgui_dc* dc) rtgui_toplevel_t* top = RTGUI_TOPLEVEL(hw->owner->toplevel); top->drawing --; - if (top->drawing == 0) + if ((top->drawing == 0) && (hw->visible == RT_TRUE)) { #ifdef __WIN32__ #ifdef RTGUI_USING_MOUSE_CURSOR @@ -208,7 +208,6 @@ static rt_bool_t rtgui_dc_hw_fini(struct rtgui_dc* dc) } } - return RT_TRUE; } diff --git a/components/rtgui/common/rtgui_xml.c b/components/rtgui/common/rtgui_xml.c index 66315eb8cf..eecb197d59 100644 --- a/components/rtgui/common/rtgui_xml.c +++ b/components/rtgui/common/rtgui_xml.c @@ -1,4 +1,5 @@ #include +#include /* Internal states that the parser can be in at any given time. */ enum { @@ -173,22 +174,16 @@ const char* rtgui_xml_event_str(rt_uint8_t event) { case EVENT_START: return "start tag"; - break; case EVENT_END: return "end tag"; - break; case EVENT_TEXT: return "text"; - break; case EVENT_NAME: return "attr name"; - break; case EVENT_VAL: return "attr val"; - break; case EVENT_END_DOC: return "end document"; - break; default: break; } diff --git a/components/rtgui/include/rtgui/widgets/checkbox.h b/components/rtgui/include/rtgui/widgets/checkbox.h index 9e9c325ab2..65ca03d29c 100644 --- a/components/rtgui/include/rtgui/widgets/checkbox.h +++ b/components/rtgui/include/rtgui/widgets/checkbox.h @@ -27,7 +27,7 @@ typedef struct rtgui_checkbox rtgui_checkbox_t; rtgui_type_t *rtgui_checkbox_type_get(void); -rtgui_checkbox_t* rtgui_checkbox_create(unsigned char* text, rt_bool_t checked); +rtgui_checkbox_t* rtgui_checkbox_create(const char* text, rt_bool_t checked); void rtgui_checkbox_destroy(rtgui_checkbox_t* checkbox); void rtgui_checkbox_set_checked(rtgui_checkbox_t* checkbox, rt_bool_t checked); diff --git a/components/rtgui/widgets/checkbox.c b/components/rtgui/widgets/checkbox.c index 46844eec23..f90ec249ba 100644 --- a/components/rtgui/widgets/checkbox.c +++ b/components/rtgui/widgets/checkbox.c @@ -87,7 +87,7 @@ rt_bool_t rtgui_checkbox_event_handler(struct rtgui_widget* widget, struct rtgui return RT_FALSE; } -struct rtgui_checkbox* rtgui_checkbox_create(unsigned char* text, rt_bool_t checked) +struct rtgui_checkbox* rtgui_checkbox_create(const char* text, rt_bool_t checked) { struct rtgui_checkbox* box;