summaryrefslogtreecommitdiff
path: root/tests/test-jsonrpc.c
diff options
context:
space:
mode:
authorGurucharan Shetty <gshetty@nicira.com>2014-04-03 16:07:43 -0700
committerGurucharan Shetty <gshetty@nicira.com>2014-04-04 07:34:10 -0700
commitd2586fce485240801bdfdd73ad4679b9c88bc659 (patch)
tree311de835773f595dc9e1a624649adc99a0609ff8 /tests/test-jsonrpc.c
parent79bda8258b5365438a70d08c74fab903f1dc0a29 (diff)
downloadopenvswitch-d2586fce485240801bdfdd73ad4679b9c88bc659.tar.gz
Avoid static declarations of arrays with unknown size.
Visual studio does not like it. This commit is similar to commit 3815d6c2c (Avoid designated initializers and static decls of arrays of unknown size.) but touches more files. Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'tests/test-jsonrpc.c')
-rw-r--r--tests/test-jsonrpc.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/test-jsonrpc.c b/tests/test-jsonrpc.c
index 4ace6dc63..7251265fe 100644
--- a/tests/test-jsonrpc.c
+++ b/tests/test-jsonrpc.c
@@ -35,10 +35,9 @@
#include "vlog.h"
#include "ovstest.h"
-static struct command all_commands[];
-
static void usage(void) NO_RETURN;
static void parse_options(int argc, char *argv[]);
+static struct command *get_all_commands(void);
static void
test_jsonrpc_main(int argc, char *argv[])
@@ -46,7 +45,7 @@ test_jsonrpc_main(int argc, char *argv[])
proctitle_init(argc, argv);
set_program_name(argv[0]);
parse_options(argc, argv);
- run_command(argc - optind, argv + optind, all_commands);
+ run_command(argc - optind, argv + optind, get_all_commands());
}
static void
@@ -337,4 +336,10 @@ static struct command all_commands[] = {
{ NULL, 0, 0, NULL },
};
+static struct command *
+get_all_commands(void)
+{
+ return all_commands;
+}
+
OVSTEST_REGISTER("test-jsonrpc", test_jsonrpc_main);