diff options
author | Thomas Jarosch <tomj@simonv.com> | 2015-01-05 18:44:36 +0100 |
---|---|---|
committer | Thomas Jarosch <tomj@simonv.com> | 2015-01-05 18:44:36 +0100 |
commit | fdd4aef34003587d7fd9ed754dd35ce901b639bf (patch) | |
tree | d129b8b8e587d4a1a7215c2226bfafe55f6dd643 /lib | |
parent | c907e127f8b1d267e91e82d28cdb210288852b82 (diff) | |
download | rockbox-fdd4aef34003587d7fd9ed754dd35ce901b639bf.tar.gz 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.c | 6 | ||||
-rw-r--r-- | lib/skin_parser/skin_parser.h | 6 | ||||
-rw-r--r-- | lib/skin_parser/skin_scan.c | 4 | ||||
-rw-r--r-- | lib/skin_parser/skin_scan.h | 4 |
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) | |||
1142 | } | 1142 | } |
1143 | 1143 | ||
1144 | /* Memory management */ | 1144 | /* Memory management */ |
1145 | struct skin_element* skin_alloc_element() | 1145 | static struct skin_element* skin_alloc_element() |
1146 | { | 1146 | { |
1147 | struct skin_element* retval = (struct skin_element*) | 1147 | struct skin_element* retval = (struct skin_element*) |
1148 | skin_buffer_alloc(sizeof(struct skin_element)); | 1148 | skin_buffer_alloc(sizeof(struct skin_element)); |
@@ -1164,7 +1164,7 @@ struct skin_element* skin_alloc_element() | |||
1164 | * enough for any tag. params should be used straight away by the callback | 1164 | * enough for any tag. params should be used straight away by the callback |
1165 | * so this is safe. | 1165 | * so this is safe. |
1166 | */ | 1166 | */ |
1167 | struct skin_tag_parameter* skin_alloc_params(int count) | 1167 | static struct skin_tag_parameter* skin_alloc_params(int count) |
1168 | { | 1168 | { |
1169 | size_t size = sizeof(struct skin_tag_parameter) * count; | 1169 | size_t size = sizeof(struct skin_tag_parameter) * count; |
1170 | return (struct skin_tag_parameter*)skin_buffer_alloc(size); | 1170 | return (struct skin_tag_parameter*)skin_buffer_alloc(size); |
@@ -1176,7 +1176,7 @@ char* skin_alloc_string(int length) | |||
1176 | return (char*)skin_buffer_alloc(sizeof(char) * (length + 1)); | 1176 | return (char*)skin_buffer_alloc(sizeof(char) * (length + 1)); |
1177 | } | 1177 | } |
1178 | 1178 | ||
1179 | OFFSETTYPE(struct skin_element*)* skin_alloc_children(int count) | 1179 | static OFFSETTYPE(struct skin_element*)* skin_alloc_children(int count) |
1180 | { | 1180 | { |
1181 | return (OFFSETTYPE(struct skin_element*)*) | 1181 | return (OFFSETTYPE(struct skin_element*)*) |
1182 | skin_buffer_alloc(sizeof(struct skin_element*) * count); | 1182 | 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, | |||
160 | struct skin_element* skin_parse(const char* document); | 160 | struct skin_element* skin_parse(const char* document); |
161 | #endif | 161 | #endif |
162 | /* Memory management functions */ | 162 | /* Memory management functions */ |
163 | struct skin_element* skin_alloc_element(void); | 163 | static struct skin_element* skin_alloc_element(void); |
164 | OFFSETTYPE(struct skin_element*)* skin_alloc_children(int count); | 164 | static OFFSETTYPE(struct skin_element*)* skin_alloc_children(int count); |
165 | struct skin_tag_parameter* skin_alloc_params(int count); | 165 | static struct skin_tag_parameter* skin_alloc_params(int count); |
166 | char* skin_alloc_string(int length); | 166 | char* skin_alloc_string(int length); |
167 | 167 | ||
168 | void skin_free_tree(struct skin_element* root); | 168 | 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) | |||
89 | skip_enumlist(document); | 89 | skip_enumlist(document); |
90 | } | 90 | } |
91 | 91 | ||
92 | void skip_arglist(const char** document) | 92 | static void skip_arglist(const char** document) |
93 | { | 93 | { |
94 | if(**document == ARGLISTOPENSYM) | 94 | if(**document == ARGLISTOPENSYM) |
95 | (*document)++; | 95 | (*document)++; |
@@ -106,7 +106,7 @@ void skip_arglist(const char** document) | |||
106 | (*document)++; | 106 | (*document)++; |
107 | } | 107 | } |
108 | 108 | ||
109 | void skip_enumlist(const char** document) | 109 | static void skip_enumlist(const char** document) |
110 | { | 110 | { |
111 | if(**document == ENUMLISTOPENSYM) | 111 | if(**document == ENUMLISTOPENSYM) |
112 | (*document)++; | 112 | (*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" | |||
31 | /* Scanning functions */ | 31 | /* Scanning functions */ |
32 | void skip_tag(const char** document); | 32 | void skip_tag(const char** document); |
33 | void skip_comment(const char** document); | 33 | void skip_comment(const char** document); |
34 | void skip_arglist(const char** document); | 34 | static void skip_arglist(const char** document); |
35 | void skip_enumlist(const char** document); | 35 | static void skip_enumlist(const char** document); |
36 | char* scan_string(const char** document); | 36 | char* scan_string(const char** document); |
37 | int scan_int(const char** document); | 37 | int scan_int(const char** document); |
38 | int check_viewport(const char* document); /* Checks for a viewport declaration */ | 38 | int check_viewport(const char* document); /* Checks for a viewport declaration */ |