Apply clang-format code style to all source files
This commit is contained in:
+22
-13
@@ -11,8 +11,8 @@
|
||||
#include "util/log.h"
|
||||
#include "util/str.h"
|
||||
|
||||
static void cconfig_cmd_usage_print(enum cconfig_cmd_usage_out output,
|
||||
const char* fmt, ...)
|
||||
static void
|
||||
cconfig_cmd_usage_print(enum cconfig_cmd_usage_out output, const char *fmt, ...)
|
||||
{
|
||||
char buffer[32768];
|
||||
va_list ap;
|
||||
@@ -46,15 +46,19 @@ static void cconfig_cmd_usage_print(enum cconfig_cmd_usage_out output,
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
bool cconfig_cmd_parse(struct cconfig* config, const char* key_ident, int argc,
|
||||
char** argv, bool add_params_if_absent)
|
||||
bool cconfig_cmd_parse(
|
||||
struct cconfig *config,
|
||||
const char *key_ident,
|
||||
int argc,
|
||||
char **argv,
|
||||
bool add_params_if_absent)
|
||||
{
|
||||
bool no_error;
|
||||
struct cconfig_entry* entry;
|
||||
char* tmp;
|
||||
char* cur_tok;
|
||||
struct cconfig_entry *entry;
|
||||
char *tmp;
|
||||
char *cur_tok;
|
||||
int ntok;
|
||||
char* toks[2];
|
||||
char *toks[2];
|
||||
|
||||
no_error = true;
|
||||
|
||||
@@ -105,8 +109,10 @@ bool cconfig_cmd_parse(struct cconfig* config, const char* key_ident, int argc,
|
||||
cconfig_set2(config, toks[0], toks[1]);
|
||||
} else {
|
||||
/* Ignore cmd params that are not found in config */
|
||||
log_warning("Could not find cmd parameter with key '%s' in "
|
||||
"config, ignored", toks[0]);
|
||||
log_warning(
|
||||
"Could not find cmd parameter with key '%s' in "
|
||||
"config, ignored",
|
||||
toks[0]);
|
||||
}
|
||||
|
||||
free(tmp);
|
||||
@@ -116,13 +122,16 @@ bool cconfig_cmd_parse(struct cconfig* config, const char* key_ident, int argc,
|
||||
return no_error;
|
||||
}
|
||||
|
||||
void cconfig_cmd_print_usage(struct cconfig* config, const char* usage_header,
|
||||
enum cconfig_cmd_usage_out output)
|
||||
void cconfig_cmd_print_usage(
|
||||
struct cconfig *config,
|
||||
const char *usage_header,
|
||||
enum cconfig_cmd_usage_out output)
|
||||
{
|
||||
cconfig_cmd_usage_print(output, "%s\n", usage_header);
|
||||
|
||||
for (uint32_t i = 0; i < config->nentries; i++) {
|
||||
cconfig_cmd_usage_print(output,
|
||||
cconfig_cmd_usage_print(
|
||||
output,
|
||||
" %s: %s\n"
|
||||
" default: %s\n",
|
||||
config->entries[i].key,
|
||||
|
||||
Reference in New Issue
Block a user