summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorNils Wallménius <nils@rockbox.org>2010-07-31 11:28:37 +0000
committerNils Wallménius <nils@rockbox.org>2010-07-31 11:28:37 +0000
commitc2529c341d4ecb8bea28f99f0f9e28e70c311487 (patch)
treeedd2e78df0ccd1cd9a8027899309c66a5951cce2 /lib
parentc9a3419b9e40d08cd93a536c1282348498a35b99 (diff)
downloadrockbox-c2529c341d4ecb8bea28f99f0f9e28e70c311487.tar.gz
rockbox-c2529c341d4ecb8bea28f99f0f9e28e70c311487.tar.bz2
rockbox-c2529c341d4ecb8bea28f99f0f9e28e70c311487.zip
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
Diffstat (limited to 'lib')
-rw-r--r--lib/skin_parser/skin_parser.c2
-rw-r--r--lib/skin_parser/skin_parser.h2
-rw-r--r--lib/skin_parser/tag_table.c10
-rw-r--r--lib/skin_parser/tag_table.h2
4 files changed, 8 insertions, 8 deletions
diff --git a/lib/skin_parser/skin_parser.c b/lib/skin_parser/skin_parser.c
index 13c7b55e5e..7f648cf0ae 100644
--- a/lib/skin_parser/skin_parser.c
+++ b/lib/skin_parser/skin_parser.c
@@ -466,7 +466,7 @@ static int skin_parse_tag(struct skin_element* element, char** document)
char tag_name[3];
char* tag_args;
- struct tag_info *tag;
+ const struct tag_info *tag;
int num_args = 1;
int i;
diff --git a/lib/skin_parser/skin_parser.h b/lib/skin_parser/skin_parser.h
index 8514dfdd0e..6ccf31a0e5 100644
--- a/lib/skin_parser/skin_parser.h
+++ b/lib/skin_parser/skin_parser.h
@@ -101,7 +101,7 @@ struct skin_element
void* data;
/* The tag or conditional name */
- struct tag_info *tag;
+ const struct tag_info *tag;
/* Pointer to and size of an array of parameters */
int params_count;
diff --git a/lib/skin_parser/tag_table.c b/lib/skin_parser/tag_table.c
index a7e3378d24..26c049b3dd 100644
--- a/lib/skin_parser/tag_table.c
+++ b/lib/skin_parser/tag_table.c
@@ -24,7 +24,7 @@
#include <string.h>
#define BAR_PARAMS "*|iiiis"
/* 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_LEFT, "al", "", 0 },
@@ -214,16 +214,16 @@ struct tag_info legal_tags[] =
};
/* 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
* 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
@@ -244,7 +244,7 @@ struct tag_info* find_tag(char* name)
/* Searches through the legal escape characters string */
int find_escape_character(char lookup)
{
- char* current = legal_escape_characters;
+ const char* current = legal_escape_characters;
while(*current != lookup && *current != '\0')
current++;
diff --git a/lib/skin_parser/tag_table.h b/lib/skin_parser/tag_table.h
index dde1487d13..0266c2f6b5 100644
--- a/lib/skin_parser/tag_table.h
+++ b/lib/skin_parser/tag_table.h
@@ -303,7 +303,7 @@ struct tag_info
* Finds a tag by name and returns its parameter list, or an empty
* 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