mirror of
https://github.com/Rockbox/rockbox.git
synced 2026-07-10 13:29:52 -04:00
skin_parser: Fix build warnings when included in the theme editor
skin_buffer_to_offset() call can never return a "negative" pointer (since it just returns the pointer as-is) so don't bother to check. Change-Id: Id86d53abd7ab1fb071ca54421ebe3b5ff2981c02
This commit is contained in:
parent
8e89f8a5d6
commit
0d5afa6d66
2 changed files with 9 additions and 0 deletions
|
|
@ -465,8 +465,10 @@ static struct skin_element* skin_parse_sublines_optional(const char** document,
|
||||||
for(i = 0; i < sublines; i++)
|
for(i = 0; i < sublines; i++)
|
||||||
{
|
{
|
||||||
children[i] = skin_buffer_to_offset(skin_parse_line_optional(&cursor, conditional));
|
children[i] = skin_buffer_to_offset(skin_parse_line_optional(&cursor, conditional));
|
||||||
|
#ifdef OFFSETYYPE_OFFSET
|
||||||
if (children[i] < 0)
|
if (children[i] < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
#endif
|
||||||
skip_whitespace(&cursor);
|
skip_whitespace(&cursor);
|
||||||
|
|
||||||
if(*cursor != MULTILINESYM && i != sublines - 1)
|
if(*cursor != MULTILINESYM && i != sublines - 1)
|
||||||
|
|
@ -755,8 +757,10 @@ static int skin_parse_tag(struct skin_element* element, const char** document)
|
||||||
/* Recursively parsing a code argument */
|
/* Recursively parsing a code argument */
|
||||||
params[i].type = CODE;
|
params[i].type = CODE;
|
||||||
params[i].data.code = skin_buffer_to_offset(skin_parse_code_as_arg(&cursor));
|
params[i].data.code = skin_buffer_to_offset(skin_parse_code_as_arg(&cursor));
|
||||||
|
#ifdef OFFSETTYPE_OFFSET
|
||||||
if(params[i].data.code < 0)
|
if(params[i].data.code < 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else if (tolower(type_code) == 't')
|
else if (tolower(type_code) == 't')
|
||||||
{
|
{
|
||||||
|
|
@ -874,8 +878,10 @@ static int skin_parse_text(struct skin_element* element, const char** document,
|
||||||
element->next = skin_buffer_to_offset(NULL);
|
element->next = skin_buffer_to_offset(NULL);
|
||||||
text = skin_alloc_string(length);
|
text = skin_alloc_string(length);
|
||||||
element->data = skin_buffer_to_offset(text);
|
element->data = skin_buffer_to_offset(text);
|
||||||
|
#ifdef OFFSETTYPE_OFFSET
|
||||||
if (element->data < 0)
|
if (element->data < 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
for(dest = 0; dest < length; dest++)
|
for(dest = 0; dest < length; dest++)
|
||||||
{
|
{
|
||||||
|
|
@ -1026,8 +1032,10 @@ static int skin_parse_conditional(struct skin_element* element, const char** doc
|
||||||
cursor++;
|
cursor++;
|
||||||
}
|
}
|
||||||
children_array[i] = skin_buffer_to_offset(skin_parse_code_as_arg(&cursor));
|
children_array[i] = skin_buffer_to_offset(skin_parse_code_as_arg(&cursor));
|
||||||
|
#ifdef OFFSETTYPE_OFFSET
|
||||||
if (children_array[i] < 0)
|
if (children_array[i] < 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
#endif
|
||||||
skip_whitespace(&cursor);
|
skip_whitespace(&cursor);
|
||||||
#ifdef ROCKBOX
|
#ifdef ROCKBOX
|
||||||
if ((element->tag->flags&FEATURE_TAG) && feature_available)
|
if ((element->tag->flags&FEATURE_TAG) && feature_available)
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,7 @@ typedef long skinoffset_t;
|
||||||
* do what you expect.
|
* do what you expect.
|
||||||
*/
|
*/
|
||||||
#define OFFSETTYPE(type) skinoffset_t
|
#define OFFSETTYPE(type) skinoffset_t
|
||||||
|
#define OFFSETTYPE_OFFSET
|
||||||
#else
|
#else
|
||||||
#define SKINOFFSETTOPTR(base, offset) offset
|
#define SKINOFFSETTOPTR(base, offset) offset
|
||||||
#define PTRTOSKINOFFSET(base, pointer) pointer
|
#define PTRTOSKINOFFSET(base, pointer) pointer
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue