From: Andrey Mazo Date: Wed, 25 Dec 2013 12:03:43 +0000 (+0400) Subject: Bring static and const to tests too X-Git-Tag: lxc-1.0.0.beta2~95 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0b98289ef95e83fcd493ba6688e57aa8b4fb53f7;p=thirdparty%2Flxc.git Bring static and const to tests too Signed-off-by: Andrey Mazo Signed-off-by: Serge Hallyn --- diff --git a/src/tests/attach.c b/src/tests/attach.c index b63c6339c..d02826555 100644 --- a/src/tests/attach.c +++ b/src/tests/attach.c @@ -332,7 +332,7 @@ out1: } -int test_attach(const char *lxcpath, const char *name, const char *template) +static int test_attach(const char *lxcpath, const char *name, const char *template) { int ret = -1; struct lxc_container *ct; diff --git a/src/tests/concurrent.c b/src/tests/concurrent.c index 7145d99c3..bcb5f2c02 100644 --- a/src/tests/concurrent.c +++ b/src/tests/concurrent.c @@ -33,7 +33,7 @@ static int quiet = 0; static int delay = 0; static const char *template = "busybox"; -static struct option options[] = { +static const struct option options[] = { { "threads", required_argument, NULL, 'j' }, { "iterations", required_argument, NULL, 'i' }, { "template", required_argument, NULL, 't' }, @@ -63,7 +63,7 @@ static void usage(void) { struct thread_args { int thread_id; int return_code; - char *mode; + const char *mode; }; static void do_function(void *arguments) diff --git a/src/tests/list.c b/src/tests/list.c index 9559c2318..9641dccbb 100644 --- a/src/tests/list.c +++ b/src/tests/list.c @@ -80,7 +80,7 @@ static void test_list_func(const char *lxcpath, const char *type, int main(int argc, char *argv[]) { - char *lxcpath = NULL; + const char *lxcpath = NULL; if (argc > 1) lxcpath = argv[1]; diff --git a/src/tests/locktests.c b/src/tests/locktests.c index 191414c06..c3f5352ce 100644 --- a/src/tests/locktests.c +++ b/src/tests/locktests.c @@ -27,7 +27,7 @@ #define mycontainername "lxctest.sem" #define TIMEOUT_SECS 3 -void test_two_locks(void) +static void test_two_locks(void) { struct lxc_lock *l; pid_t pid; diff --git a/src/tests/may_control.c b/src/tests/may_control.c index c1760875e..bb7000caa 100644 --- a/src/tests/may_control.c +++ b/src/tests/may_control.c @@ -21,7 +21,7 @@ #include #include -void usage(char *me) +static void usage(const char *me) { printf("Usage: %s name [lxcpath]\n", me); exit(0); @@ -29,7 +29,7 @@ void usage(char *me) int main(int argc, char *argv[]) { - char *lxcpath = NULL, *name; + const char *lxcpath = NULL, *name; bool may = false; struct lxc_container *c; diff --git a/src/tests/reboot.c b/src/tests/reboot.c index 3601e0dba..5583332ac 100644 --- a/src/tests/reboot.c +++ b/src/tests/reboot.c @@ -42,7 +42,7 @@ static int do_reboot(void *arg) return 0; } -int test_reboot(int cmd, int sig) +static int test_reboot(int cmd, int sig) { long stack_size = 4096; void *stack = alloca(stack_size) + stack_size; diff --git a/src/tests/snapshot.c b/src/tests/snapshot.c index 6e13932ed..da7b40927 100644 --- a/src/tests/snapshot.c +++ b/src/tests/snapshot.c @@ -28,7 +28,7 @@ #define MYNAME "snapxxx1" #define RESTNAME "snapxxx2" -void try_to_remove() +static void try_to_remove(void) { struct lxc_container *c; char snappath[1024];