diff --git a/libs/argparse/src/argparse.c b/libs/argparse/src/argparse.c index dc3f22e..c85d309 100644 --- a/libs/argparse/src/argparse.c +++ b/libs/argparse/src/argparse.c @@ -221,7 +221,7 @@ static int handle_positional_arg(scc_argparse_context_t *ctx, return SCC_ARGPARSE_ERR_NONE; } - if (ctx->positional_index < scc_vec_size(ctx->current_cmd->args)) { + if (ctx->positional_index < (int)scc_vec_size(ctx->current_cmd->args)) { scc_argparse_arg_t *arg = &scc_vec_at(ctx->current_cmd->args, ctx->positional_index); *arg->spec.store.str_store = ctx->result.value; diff --git a/libs/pproc/src/pproc_expand.c b/libs/pproc/src/pproc_expand.c index 913869a..2746e7e 100644 --- a/libs/pproc/src/pproc_expand.c +++ b/libs/pproc/src/pproc_expand.c @@ -146,7 +146,8 @@ split_arguments(scc_pproc_macro_extened_params_t *splited_params, depth--; } if (depth != 0 || raw_arg->type != SCC_TOK_COMMA || - (is_variadic && scc_vec_size(*splited_params) == named_count - 1)) { + (is_variadic && + (int)scc_vec_size(*splited_params) == named_count - 1)) { if (scc_vec_size(arg) == 0 && raw_arg->type == SCC_TOK_BLANK) { scc_lexer_tok_drop(raw_arg); } else { @@ -169,7 +170,7 @@ split_arguments(scc_pproc_macro_extened_params_t *splited_params, } scc_vec_push(*splited_params, arg); - if (is_variadic && scc_vec_size(*splited_params) == named_count - 1) { + if (is_variadic && (int)scc_vec_size(*splited_params) == named_count - 1) { scc_vec_init(arg); scc_vec_push(*splited_params, arg); } @@ -318,10 +319,11 @@ static inline void expand_function_macro(scc_pproc_expand_t *expand_ctx, int left_idx = got_left_non_blank(i, ¯o->replaces); int right_idx = got_right_non_blank(i, ¯o->replaces); - if (left_idx < 0 || right_idx >= (int)macro->replaces.size) { + if (left_idx < 0 || + right_idx >= (int)scc_vec_size(macro->replaces)) { LOG_FATAL("Invalid ## operator"); } - while (i++ < right_idx) { + while ((int)i++ < right_idx) { scc_lexer_tok_drop(&scc_vec_pop(tok_buffer)); } @@ -448,7 +450,7 @@ static inline void expand_object_macro(scc_pproc_expand_t *expand_ctx, scc_lexer_tok_t *right = &scc_vec_at(macro->replaces, right_idx); scc_lexer_tok_t concate_tok = concatenate_tokens(left, right); - while (i++ < right_idx) { + while ((int)i++ < right_idx) { scc_lexer_tok_drop(&scc_vec_pop(tok_buffer)); } if (concate_tok.type == SCC_TOK_UNKNOWN) { diff --git a/libs/pproc/src/pproc_include.c b/libs/pproc/src/pproc_include.c index 6831245..3a9f6ae 100644 --- a/libs/pproc/src/pproc_include.c +++ b/libs/pproc/src/pproc_include.c @@ -36,7 +36,7 @@ static int switch_file_stack(scc_pproc_t *pp, scc_cstring_t *fname, SCC_ERROR(*pos, "include file '%s' not found", scc_cstring_as_cstr(fname)); return -1; FOPEN: - if (scc_vec_size(pp->file_stack) >= pp->config.max_include_depth) { + if ((int)scc_vec_size(pp->file_stack) >= pp->config.max_include_depth) { SCC_FATAL(*pos, "include depth exceeds maximum (%d)", pp->config.max_include_depth); LOG_FATAL("Include depth is too deep..."); diff --git a/libs/sstream/src/scc_pos_log.c b/libs/sstream/src/scc_pos_log.c index 38941e1..044f395 100644 --- a/libs/sstream/src/scc_pos_log.c +++ b/libs/sstream/src/scc_pos_log.c @@ -5,7 +5,7 @@ static int user_log_handler(logger_t *module, log_level_t level, const char *fmt, ...) { /* clang-format off */ - (void)file; (void)line; (void)func; // 不再使用 + (void) module, (void)file, (void)line, (void)func; // 不再使用 const char *level_str = null; switch (level) {