remove some warning in compiling.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@136 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
parent
428b10bb91
commit
e252eb75eb
@ -13,6 +13,9 @@
|
|||||||
*/
|
*/
|
||||||
#include <rtgui/dc.h>
|
#include <rtgui/dc.h>
|
||||||
#include <rtgui/rtgui_system.h>
|
#include <rtgui/rtgui_system.h>
|
||||||
|
|
||||||
|
#include <string.h> /* for strlen */
|
||||||
|
#include <stdlib.h> /* fir qsort */
|
||||||
|
|
||||||
void rtgui_dc_destory(struct rtgui_dc* dc)
|
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);
|
rtgui_font_derefer(gb2312_font);
|
||||||
#else
|
#else
|
||||||
len = strlen(text);
|
len = strlen((const char*)text);
|
||||||
rtgui_font_draw(font, dc, text, len, &text_rect);
|
rtgui_font_draw(font, dc, text, len, &text_rect);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -302,7 +302,27 @@ rt_uint8_t* rtgui_filerw_mem_getdata(struct rtgui_filerw* context)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* file read/write public interface */
|
/* 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)
|
struct rtgui_filerw* rtgui_filerw_create_file(const char* filename, const char* mode)
|
||||||
{
|
{
|
||||||
int fd;
|
int fd;
|
||||||
@ -311,7 +331,7 @@ struct rtgui_filerw* rtgui_filerw_create_file(const char* filename, const char*
|
|||||||
RT_ASSERT(filename != RT_NULL);
|
RT_ASSERT(filename != RT_NULL);
|
||||||
|
|
||||||
rw = RT_NULL;
|
rw = RT_NULL;
|
||||||
fd = open(filename, mode, 0);
|
fd = open(filename, parse_mode(mode), 0);
|
||||||
|
|
||||||
if ( fd >= 0 )
|
if ( fd >= 0 )
|
||||||
{
|
{
|
||||||
|
@ -12,11 +12,11 @@
|
|||||||
* 2009-10-16 Bernard first version
|
* 2009-10-16 Bernard first version
|
||||||
*/
|
*/
|
||||||
#include <rtthread.h>
|
#include <rtthread.h>
|
||||||
#include <rtgui/image.h>
|
#include <rtgui/image.h>
|
||||||
|
|
||||||
#include <rtgui/image_xpm.h>
|
#include <rtgui/image_xpm.h>
|
||||||
#include <rtgui/rtgui_system.h>
|
#include <rtgui/rtgui_system.h>
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#ifdef RTGUI_IMAGE_BMP
|
#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->line_pixels = rtgui_malloc(image->w * sizeof(rtgui_color_t));
|
||||||
png->pixels = RT_NULL;
|
png->pixels = RT_NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return RT_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rtgui_image_png_unload(struct rtgui_image* image)
|
static void rtgui_image_png_unload(struct rtgui_image* image)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user