diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2015-02-10 08:40:41 +0100 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2015-02-10 08:40:41 +0100 |
commit | 38ad35fd7729d9492aa5ae7b5186d4a4676d5df2 (patch) | |
tree | 82ebe90a2e808cc11ef4cab509936e2768f1c0cd /src/systemcmds | |
parent | a7580a1eae5a5fe8f2a7e70a1447009fed91645e (diff) | |
download | px4-firmware-38ad35fd7729d9492aa5ae7b5186d4a4676d5df2.tar.gz px4-firmware-38ad35fd7729d9492aa5ae7b5186d4a4676d5df2.tar.bz2 px4-firmware-38ad35fd7729d9492aa5ae7b5186d4a4676d5df2.zip |
param tool: Fix code style
Diffstat (limited to 'src/systemcmds')
-rw-r--r-- | src/systemcmds/param/param.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/systemcmds/param/param.c b/src/systemcmds/param/param.c index 7273c4148..c15e042a7 100644 --- a/src/systemcmds/param/param.c +++ b/src/systemcmds/param/param.c @@ -63,10 +63,10 @@ static void do_load(const char *param_file_name); static void do_import(const char *param_file_name); static void do_show(const char *search_string); static void do_show_print(void *arg, param_t param); -static void do_set(const char* name, const char* val, bool fail_on_not_found); -static void do_compare(const char* name, char* vals[], unsigned comparisons); -static void do_reset(const char* excludes[], int num_excludes); -static void do_reset_nostart(const char* excludes[], int num_excludes); +static void do_set(const char *name, const char *val, bool fail_on_not_found); +static void do_compare(const char *name, char *vals[], unsigned comparisons); +static void do_reset(const char *excludes[], int num_excludes); +static void do_reset_nostart(const char *excludes[], int num_excludes); int param_main(int argc, char *argv[]) @@ -153,7 +153,8 @@ param_main(int argc, char *argv[]) if (!strcmp(argv[1], "reset")) { if (argc >= 3) { - do_reset((const char**) &argv[2], argc - 2); + do_reset((const char **) &argv[2], argc - 2); + } else { do_reset(NULL, 0); } @@ -161,7 +162,8 @@ param_main(int argc, char *argv[]) if (!strcmp(argv[1], "reset_nostart")) { if (argc >= 3) { - do_reset_nostart((const char**) &argv[2], argc - 2); + do_reset_nostart((const char **) &argv[2], argc - 2); + } else { do_reset_nostart(NULL, 0); } @@ -461,14 +463,15 @@ do_compare(const char *name, char *vals[], unsigned comparisons) } static void -do_reset(const char* excludes[], int num_excludes) +do_reset(const char *excludes[], int num_excludes) { if (num_excludes > 0) { param_reset_excludes(excludes, num_excludes); + } else { param_reset_all(); } - + if (param_save_default()) { warnx("Param export failed."); exit(1); @@ -479,7 +482,7 @@ do_reset(const char* excludes[], int num_excludes) } static void -do_reset_nostart(const char* excludes[], int num_excludes) +do_reset_nostart(const char *excludes[], int num_excludes) { int32_t autostart; @@ -490,6 +493,7 @@ do_reset_nostart(const char* excludes[], int num_excludes) if (num_excludes > 0) { param_reset_excludes(excludes, num_excludes); + } else { param_reset_all(); } |