提交 e252eb75 编写于 作者: B bernard.xiong

remove some warning in compiling.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@136 bbd45198-f89e-11dd-88c7-29a3b14d5316
上级 428b10bb
......@@ -13,6 +13,9 @@
*/
#include <rtgui/dc.h>
#include <rtgui/rtgui_system.h>
#include <string.h> /* for strlen */
#include <stdlib.h> /* fir qsort */
void rtgui_dc_destory(struct rtgui_dc* dc)
{
......@@ -408,7 +411,7 @@ void rtgui_dc_draw_text (struct rtgui_dc* dc, const rt_uint8_t* text, struct rtg
rtgui_font_derefer(gb2312_font);
#else
len = strlen(text);
len = strlen((const char*)text);
rtgui_font_draw(font, dc, text, len, &text_rect);
#endif
}
......
......@@ -302,7 +302,27 @@ rt_uint8_t* rtgui_filerw_mem_getdata(struct rtgui_filerw* context)
}
/* file read/write public interface */
#ifdef RT_USING_DFS_FILERW
#ifdef RT_USING_DFS_FILERW
static int parse_mode(const char *mode)
{
int f=0;
for (;;)
{
switch (*mode)
{
case 0: return f;
case 'b': break;
case 'r': f=O_RDONLY; break;
case 'w': f=O_WRONLY|O_CREAT|O_TRUNC; break;
case 'a': f=O_WRONLY|O_CREAT|O_APPEND; break;
case '+': f=(f&(~O_WRONLY))|O_RDWR; break;
}
++mode;
}
}
struct rtgui_filerw* rtgui_filerw_create_file(const char* filename, const char* mode)
{
int fd;
......@@ -311,7 +331,7 @@ struct rtgui_filerw* rtgui_filerw_create_file(const char* filename, const char*
RT_ASSERT(filename != RT_NULL);
rw = RT_NULL;
fd = open(filename, mode, 0);
fd = open(filename, parse_mode(mode), 0);
if ( fd >= 0 )
{
......
......@@ -12,11 +12,11 @@
* 2009-10-16 Bernard first version
*/
#include <rtthread.h>
#include <rtgui/image.h>
#include <rtgui/image.h>
#include <rtgui/image_xpm.h>
#include <rtgui/rtgui_system.h>
#include <rtgui/rtgui_system.h>
#include <string.h>
#ifdef RTGUI_IMAGE_BMP
......
......@@ -190,7 +190,9 @@ static rt_bool_t rtgui_image_png_load(struct rtgui_image* image, struct rtgui_fi
{
png->line_pixels = rtgui_malloc(image->w * sizeof(rtgui_color_t));
png->pixels = RT_NULL;
}
}
return RT_TRUE;
}
static void rtgui_image_png_unload(struct rtgui_image* image)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册