summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThomas Jarosch <tomj@simonv.com>2015-01-05 18:44:36 +0100
committerThomas Jarosch <tomj@simonv.com>2015-01-05 18:44:36 +0100
commitfdd4aef34003587d7fd9ed754dd35ce901b639bf (patch)
treed129b8b8e587d4a1a7215c2226bfafe55f6dd643 /lib
parentc907e127f8b1d267e91e82d28cdb210288852b82 (diff)
downloadrockbox-fdd4aef34003587d7fd9ed754dd35ce901b639bf.tar.gz
rockbox-fdd4aef34003587d7fd9ed754dd35ce901b639bf.tar.bz2
rockbox-fdd4aef34003587d7fd9ed754dd35ce901b639bf.zip
Make thirty functions static to reduce binary size
If any of those functions should be (unused) API functions, they can easily be turned back once really needed. Detected using a new cppcheck check that uses the internal symbol database to catch functions that are only used in the current file. Change-Id: Ic2b1e5b8020b76397f11cefc4e205f3b7ac1f184
Diffstat (limited to 'lib')
-rw-r--r--lib/skin_parser/skin_parser.c6
-rw-r--r--lib/skin_parser/skin_parser.h6
-rw-r--r--lib/skin_parser/skin_scan.c4
-rw-r--r--lib/skin_parser/skin_scan.h4
4 files changed, 10 insertions, 10 deletions
diff --git a/lib/skin_parser/skin_parser.c b/lib/skin_parser/skin_parser.c
index a26e6ce474..b5ad023d0a 100644
--- a/lib/skin_parser/skin_parser.c
+++ b/lib/skin_parser/skin_parser.c
@@ -1142,7 +1142,7 @@ static struct skin_element* skin_parse_code_as_arg(const char** document)
}
/* Memory management */
-struct skin_element* skin_alloc_element()
+static struct skin_element* skin_alloc_element()
{
struct skin_element* retval = (struct skin_element*)
skin_buffer_alloc(sizeof(struct skin_element));
@@ -1164,7 +1164,7 @@ struct skin_element* skin_alloc_element()
* enough for any tag. params should be used straight away by the callback
* so this is safe.
*/
-struct skin_tag_parameter* skin_alloc_params(int count)
+static struct skin_tag_parameter* skin_alloc_params(int count)
{
size_t size = sizeof(struct skin_tag_parameter) * count;
return (struct skin_tag_parameter*)skin_buffer_alloc(size);
@@ -1176,7 +1176,7 @@ char* skin_alloc_string(int length)
return (char*)skin_buffer_alloc(sizeof(char) * (length + 1));
}
-OFFSETTYPE(struct skin_element*)* skin_alloc_children(int count)
+static OFFSETTYPE(struct skin_element*)* skin_alloc_children(int count)
{
return (OFFSETTYPE(struct skin_element*)*)
skin_buffer_alloc(sizeof(struct skin_element*) * count);
diff --git a/lib/skin_parser/skin_parser.h b/lib/skin_parser/skin_parser.h
index c53896ca30..c59072594f 100644
--- a/lib/skin_parser/skin_parser.h
+++ b/lib/skin_parser/skin_parser.h
@@ -160,9 +160,9 @@ struct skin_element* skin_parse(const char* document,
struct skin_element* skin_parse(const char* document);
#endif
/* Memory management functions */
-struct skin_element* skin_alloc_element(void);
-OFFSETTYPE(struct skin_element*)* skin_alloc_children(int count);
-struct skin_tag_parameter* skin_alloc_params(int count);
+static struct skin_element* skin_alloc_element(void);
+static OFFSETTYPE(struct skin_element*)* skin_alloc_children(int count);
+static struct skin_tag_parameter* skin_alloc_params(int count);
char* skin_alloc_string(int length);
void skin_free_tree(struct skin_element* root);
diff --git a/lib/skin_parser/skin_scan.c b/lib/skin_parser/skin_scan.c
index f93606d54d..c5ce595ddd 100644
--- a/lib/skin_parser/skin_scan.c
+++ b/lib/skin_parser/skin_scan.c
@@ -89,7 +89,7 @@ void skip_tag(const char** document)
skip_enumlist(document);
}
-void skip_arglist(const char** document)
+static void skip_arglist(const char** document)
{
if(**document == ARGLISTOPENSYM)
(*document)++;
@@ -106,7 +106,7 @@ void skip_arglist(const char** document)
(*document)++;
}
-void skip_enumlist(const char** document)
+static void skip_enumlist(const char** document)
{
if(**document == ENUMLISTOPENSYM)
(*document)++;
diff --git a/lib/skin_parser/skin_scan.h b/lib/skin_parser/skin_scan.h
index 6281582b88..b1f842b8ce 100644
--- a/lib/skin_parser/skin_scan.h
+++ b/lib/skin_parser/skin_scan.h
@@ -31,8 +31,8 @@ extern "C"
/* Scanning functions */
void skip_tag(const char** document);
void skip_comment(const char** document);
-void skip_arglist(const char** document);
-void skip_enumlist(const char** document);
+static void skip_arglist(const char** document);
+static void skip_enumlist(const char** document);
char* scan_string(const char** document);
int scan_int(const char** document);
int check_viewport(const char* document); /* Checks for a viewport declaration */