forked from len0rd/rockbox
skinparser lib: some const correctness and marking of local vars as 'static'
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27635 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
c9a3419b9e
commit
c2529c341d
4 changed files with 8 additions and 8 deletions
|
@ -466,7 +466,7 @@ static int skin_parse_tag(struct skin_element* element, char** document)
|
||||||
|
|
||||||
char tag_name[3];
|
char tag_name[3];
|
||||||
char* tag_args;
|
char* tag_args;
|
||||||
struct tag_info *tag;
|
const struct tag_info *tag;
|
||||||
|
|
||||||
int num_args = 1;
|
int num_args = 1;
|
||||||
int i;
|
int i;
|
||||||
|
|
|
@ -101,7 +101,7 @@ struct skin_element
|
||||||
void* data;
|
void* data;
|
||||||
|
|
||||||
/* The tag or conditional name */
|
/* The tag or conditional name */
|
||||||
struct tag_info *tag;
|
const struct tag_info *tag;
|
||||||
|
|
||||||
/* Pointer to and size of an array of parameters */
|
/* Pointer to and size of an array of parameters */
|
||||||
int params_count;
|
int params_count;
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#define BAR_PARAMS "*|iiiis"
|
#define BAR_PARAMS "*|iiiis"
|
||||||
/* The tag definition table */
|
/* The tag definition table */
|
||||||
struct tag_info legal_tags[] =
|
static const struct tag_info legal_tags[] =
|
||||||
{
|
{
|
||||||
{ SKIN_TOKEN_ALIGN_CENTER, "ac", "", 0 },
|
{ SKIN_TOKEN_ALIGN_CENTER, "ac", "", 0 },
|
||||||
{ SKIN_TOKEN_ALIGN_LEFT, "al", "", 0 },
|
{ SKIN_TOKEN_ALIGN_LEFT, "al", "", 0 },
|
||||||
|
@ -214,16 +214,16 @@ struct tag_info legal_tags[] =
|
||||||
};
|
};
|
||||||
|
|
||||||
/* A table of legal escapable characters */
|
/* A table of legal escapable characters */
|
||||||
char legal_escape_characters[] = "%(,);#<|>";
|
static const char legal_escape_characters[] = "%(,);#<|>";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Just does a straight search through the tag table to find one by
|
* Just does a straight search through the tag table to find one by
|
||||||
* the given name
|
* the given name
|
||||||
*/
|
*/
|
||||||
struct tag_info* find_tag(char* name)
|
const struct tag_info* find_tag(const char* name)
|
||||||
{
|
{
|
||||||
|
|
||||||
struct tag_info* current = legal_tags;
|
const struct tag_info* current = legal_tags;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Continue searching so long as we have a non-empty name string
|
* Continue searching so long as we have a non-empty name string
|
||||||
|
@ -244,7 +244,7 @@ struct tag_info* find_tag(char* name)
|
||||||
/* Searches through the legal escape characters string */
|
/* Searches through the legal escape characters string */
|
||||||
int find_escape_character(char lookup)
|
int find_escape_character(char lookup)
|
||||||
{
|
{
|
||||||
char* current = legal_escape_characters;
|
const char* current = legal_escape_characters;
|
||||||
while(*current != lookup && *current != '\0')
|
while(*current != lookup && *current != '\0')
|
||||||
current++;
|
current++;
|
||||||
|
|
||||||
|
|
|
@ -303,7 +303,7 @@ struct tag_info
|
||||||
* Finds a tag by name and returns its parameter list, or an empty
|
* Finds a tag by name and returns its parameter list, or an empty
|
||||||
* string if the tag is not found in the table
|
* string if the tag is not found in the table
|
||||||
*/
|
*/
|
||||||
struct tag_info* find_tag(char* name);
|
const struct tag_info* find_tag(const char* name);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Determines whether a character is legal to escape or not. If
|
* Determines whether a character is legal to escape or not. If
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue