From 4b4a4f200343099c34530cfe8627f7d371ffe137 Mon Sep 17 00:00:00 2001 From: "bernard.xiong" Date: Tue, 3 Aug 2010 08:48:57 +0000 Subject: [PATCH] fix compiling warning. git-svn-id: https://rt-thread.googlecode.com/svn/trunk@825 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- examples/gui/demo_view_dc.c | 4 ++-- examples/gui/demo_view_image.c | 1 + examples/gui/demo_view_window.c | 5 +++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/examples/gui/demo_view_dc.c b/examples/gui/demo_view_dc.c index 233258c258..c49fde03c8 100644 --- a/examples/gui/demo_view_dc.c +++ b/examples/gui/demo_view_dc.c @@ -26,8 +26,8 @@ rt_bool_t dc_event_handler(rtgui_widget_t* widget, rtgui_event_t *event) { struct rtgui_dc* dc; rtgui_rect_t rect; - rt_uint32_t vx[] = {20, 50, 60, 45, 60, 20}; - rt_uint32_t vy[] = {150, 50, 90, 60, 45, 50}; + const int vx[] = {20, 50, 60, 45, 60, 20}; + const int vy[] = {150, 50, 90, 60, 45, 50}; /* * 因为用的是demo view,上面本身有一部分控件,所以在绘图时先要让demo view diff --git a/examples/gui/demo_view_image.c b/examples/gui/demo_view_image.c index a98a624aec..dd4f895211 100644 --- a/examples/gui/demo_view_image.c +++ b/examples/gui/demo_view_image.c @@ -7,6 +7,7 @@ #include "demo_view.h" #include #include +#include static rtgui_image_t* image = RT_NULL; static rtgui_view_t* _view = RT_NULL; diff --git a/examples/gui/demo_view_window.c b/examples/gui/demo_view_window.c index 8445d1b8ec..0c96f3be54 100644 --- a/examples/gui/demo_view_window.c +++ b/examples/gui/demo_view_window.c @@ -10,6 +10,7 @@ #include #include #include "demo_view.h" +#include static struct rtgui_timer *timer; static struct rtgui_label* label; @@ -43,7 +44,7 @@ void window_demo_close(struct rtgui_widget* widget, rtgui_event_t *even) void diag_close(struct rtgui_timer* timer, void* parameter) { cnt --; - sprintf(label_text, "closed then %d second!", cnt); + rt_sprintf(label_text, "closed then %d second!", cnt); /* 设置标签文本并更新控件 */ rtgui_label_set_text(label, label_text); @@ -105,7 +106,7 @@ static void demo_autowin_onbutton(struct rtgui_widget* widget, rtgui_event_t* ev if (msgbox != RT_NULL) { cnt = 5; - sprintf(label_text, "closed then %d second!", cnt); + rt_sprintf(label_text, "closed then %d second!", cnt); label = rtgui_label_create(label_text); rect.x1 += 5; rect.x2 -= 5;