code: cleanup lint and extra compile warnings

This commit is contained in:
Nick Peng
2022-07-10 10:32:01 +08:00
parent 4e2161c6fc
commit a83818c094
22 changed files with 695 additions and 574 deletions

View File

@@ -129,7 +129,7 @@ int conf_size(const char *item, void *data, int argc, char *argv[])
return 0;
}
void conf_getopt_reset(void)
static void conf_getopt_reset(void)
{
static struct option long_options[] = {{"-", 0, 0, 0}, {0, 0, 0, 0}};
int argc = 2;
@@ -144,7 +144,7 @@ void conf_getopt_reset(void)
optopt = 0;
}
int conf_parse_args(char *key, char *value, int *argc, char **argv)
static int conf_parse_args(char *key, char *value, int *argc, char **argv)
{
char *start = NULL;
char *ptr = value;
@@ -205,12 +205,9 @@ int conf_parse_args(char *key, char *value, int *argc, char **argv)
return 0;
}
void load_exit(void)
{
return;
}
void load_exit(void) {}
int load_conf_printf(const char *file, int lineno, int ret)
static int load_conf_printf(const char *file, int lineno, int ret)
{
if (ret != CONF_RET_OK) {
printf("process config file '%s' failed at line %d.", file, lineno);
@@ -224,15 +221,15 @@ int load_conf_printf(const char *file, int lineno, int ret)
return 0;
}
int load_conf_file(const char *file, struct config_item *items, conf_error_handler handler)
static int load_conf_file(const char *file, struct config_item *items, conf_error_handler handler)
{
FILE *fp = NULL;
char line[MAX_LINE_LEN];
char key[MAX_KEY_LEN];
char value[MAX_LINE_LEN];
int filed_num = 0;
int i;
int argc;
int i = 0;
int argc = 0;
char *argv[1024];
int ret = 0;
int call_ret = 0;