From 664c417af5d16e217557468ba747a369e8e1ab6b Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sun, 7 Feb 2021 17:19:44 -0600 Subject: Add lots of "static" annotations, make a couple things use FLAG() macros, etc. --- toys/posix/chgrp.c | 2 +- toys/posix/logger.c | 3 ++- toys/posix/patch.c | 2 +- toys/posix/ps.c | 2 +- toys/posix/test.c | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) (limited to 'toys/posix') diff --git a/toys/posix/chgrp.c b/toys/posix/chgrp.c index 1e56d973..807ac824 100644 --- a/toys/posix/chgrp.c +++ b/toys/posix/chgrp.c @@ -100,7 +100,7 @@ void chgrp_main(void) if (CFG_TOYBOX_FREE && ischown) free(own); } -void chown_main() +void chown_main(void) { chgrp_main(); } diff --git a/toys/posix/logger.c b/toys/posix/logger.c index fae3fddb..906d64f4 100644 --- a/toys/posix/logger.c +++ b/toys/posix/logger.c @@ -30,7 +30,8 @@ GLOBALS( // find str in names[], accepting unambiguous short matches // returns offset into array of match, or -1 if no match -int arrayfind(char *str, char *names[], int len) +// TODO: move to lib? +static int arrayfind(char *str, char *names[], int len) { int j, i, ll = 0, maybe = -1; diff --git a/toys/posix/patch.c b/toys/posix/patch.c index e0f13dd7..f0aad4ee 100644 --- a/toys/posix/patch.c +++ b/toys/posix/patch.c @@ -259,7 +259,7 @@ done: } // read a filename that has been quoted or escaped -char *unquote_file(char *filename) +static char *unquote_file(char *filename) { char *s = filename, *t; diff --git a/toys/posix/ps.c b/toys/posix/ps.c index 7013dc57..304fe006 100644 --- a/toys/posix/ps.c +++ b/toys/posix/ps.c @@ -1280,7 +1280,7 @@ static void default_ko(char *s, void *fields, char *err, struct arg_list *arg) if (x) help_help(); } -void common_setup(void) +static void common_setup(void) { char buf[128]; int i; diff --git a/toys/posix/test.c b/toys/posix/test.c index d1ea1663..3fadf3ad 100644 --- a/toys/posix/test.c +++ b/toys/posix/test.c @@ -49,7 +49,7 @@ config TEST_GLUE #include "toys.h" // Consume 3, 2, or 1 argument test, returning result and *count used. -int do_test(char **args, int *count) +static int do_test(char **args, int *count) { char c, *s; int i; -- cgit v1.2.3