1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Thomas Jarosch 2015-01-05 18:44:36 +01:00
parent c907e127f8
commit fdd4aef340
10 changed files with 30 additions and 30 deletions

View file

@ -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);

View file

@ -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);

View file

@ -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)++;

View file

@ -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 */