mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
Don't reinvent ctype.h functions
Remove ctype.h functions in text_editor and rockboy, fix #define name clash in mpegplayer. Change-Id: Icb40cf45e27b793c62cb095197757a27f508f344
This commit is contained in:
parent
3f61caa0cd
commit
7803f31c53
4 changed files with 19 additions and 26 deletions
|
@ -34,6 +34,7 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include "string-extra.h"
|
||||
#include "gcc_extensions.h"
|
||||
|
||||
|
|
|
@ -526,15 +526,15 @@ static struct fps fps NOCACHEBSS_ATTR; /* Accessed on other processor */
|
|||
static void osd_show(unsigned show);
|
||||
|
||||
#ifdef LCD_LANDSCAPE
|
||||
#define _X (x + osd.x)
|
||||
#define _Y (y + osd.y)
|
||||
#define _W width
|
||||
#define _H height
|
||||
#define __X (x + osd.x)
|
||||
#define __Y (y + osd.y)
|
||||
#define __W width
|
||||
#define __H height
|
||||
#else
|
||||
#define _X (LCD_WIDTH - (y + osd.y) - height)
|
||||
#define _Y (x + osd.x)
|
||||
#define _W height
|
||||
#define _H width
|
||||
#define __X (LCD_WIDTH - (y + osd.y) - height)
|
||||
#define __Y (x + osd.x)
|
||||
#define __W height
|
||||
#define __H width
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LCD_COLOR
|
||||
|
@ -560,17 +560,17 @@ static unsigned draw_blendcolor(unsigned c1, unsigned c2, unsigned char amount)
|
|||
* The origin is the upper-left corner of the OSD area */
|
||||
static void draw_update_rect(int x, int y, int width, int height)
|
||||
{
|
||||
mylcd_update_rect(_X, _Y, _W, _H);
|
||||
mylcd_update_rect(__X, __Y, __W, __H);
|
||||
}
|
||||
|
||||
static void draw_clear_area(int x, int y, int width, int height)
|
||||
{
|
||||
#ifdef HAVE_LCD_COLOR
|
||||
rb->screen_clear_area(rb->screens[SCREEN_MAIN], _X, _Y, _W, _H);
|
||||
rb->screen_clear_area(rb->screens[SCREEN_MAIN], __X, __Y, __W, __H);
|
||||
#else
|
||||
int oldmode = grey_get_drawmode();
|
||||
grey_set_drawmode(DRMODE_SOLID | DRMODE_INVERSEVID);
|
||||
grey_fillrect(_X, _Y, _W, _H);
|
||||
grey_fillrect(__X, __Y, __W, __H);
|
||||
grey_set_drawmode(oldmode);
|
||||
#endif
|
||||
}
|
||||
|
@ -582,7 +582,7 @@ static void draw_clear_area_rect(const struct vo_rect *rc)
|
|||
|
||||
static void draw_fillrect(int x, int y, int width, int height)
|
||||
{
|
||||
mylcd_fillrect(_X, _Y, _W, _H);
|
||||
mylcd_fillrect(__X, __Y, __W, __H);
|
||||
}
|
||||
|
||||
static void draw_hline(int x1, int x2, int y)
|
||||
|
@ -967,10 +967,10 @@ static void fps_update_post_frame_callback(void)
|
|||
int height = cliprect.b - cliprect.t;
|
||||
|
||||
/* OSD coordinates -> framebuffer coordinates */
|
||||
fps.pf_x = _X;
|
||||
fps.pf_y = _Y;
|
||||
fps.pf_width = _W;
|
||||
fps.pf_height = _H;
|
||||
fps.pf_x = __X;
|
||||
fps.pf_y = __Y;
|
||||
fps.pf_width = __W;
|
||||
fps.pf_height = __H;
|
||||
|
||||
cb = fps_post_frame_callback;
|
||||
}
|
||||
|
|
|
@ -52,11 +52,6 @@ void dynamic_recompile (struct dynarec_block *newblock);
|
|||
#define IBSS_ATTR
|
||||
#endif
|
||||
|
||||
/* libc functions */
|
||||
#define isdigit(c) ((c) >= '0' && (c) <= '9')
|
||||
#define isalpha(c) (((c) >= 'a' && (c) <= 'z') || ((c) >= 'A' && ((c) <= 'Z')))
|
||||
#define isalnum(c) (isdigit(c) || (isalpha(c)))
|
||||
|
||||
/* only 1 fixed argument for open, since variadic macros don't except empty
|
||||
* variable parameters */
|
||||
#define open(a, ...) rb->open((a), __VA_ARGS__)
|
||||
|
@ -79,7 +74,6 @@ void dynamic_recompile (struct dynarec_block *newblock);
|
|||
#define strcat(a,b) rb->strcat((a),(b))
|
||||
#define snprintf(...) rb->snprintf(__VA_ARGS__)
|
||||
#define fdprintf(...) rb->fdprintf(__VA_ARGS__)
|
||||
#define tolower(_A_) (isupper(_A_) ? (_A_ - 'A' + 'a') : _A_)
|
||||
|
||||
/* Using #define isn't enough with GCC 4.0.1 */
|
||||
void* memcpy(void* dst, const void* src, size_t size) ICODE_ATTR;
|
||||
|
|
|
@ -287,12 +287,10 @@ static int do_item_menu(int cur_sel)
|
|||
}
|
||||
|
||||
#ifdef HAVE_LCD_COLOR
|
||||
/* in misc.h but no need to polute the api */
|
||||
#define toupper(c) (((c >= 'a') && (c <= 'z'))?c+'A':c)
|
||||
#define isxdigit(c) ((c>='a' && c<= 'f') || (c>='A' && c<= 'F') \
|
||||
|| (c>='0' && c<= '9'))
|
||||
|
||||
#define hex2dec(c) (((c) >= '0' && ((c) <= '9')) ? (toupper(c)) - '0' : \
|
||||
(toupper(c)) - 'A' + 10)
|
||||
|
||||
static int my_hex_to_rgb(const char* hex, int* color)
|
||||
{ int ok = 1;
|
||||
int i;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue