From 6f4b3b7cd8b6541d3ae948f4bab5b06304608cc6 Mon Sep 17 00:00:00 2001 From: YuQing <384681@qq.com> Date: Sat, 9 Aug 2025 15:21:08 +0800 Subject: [PATCH] rename fc_combine_two_string to fc_combine_two_strings --- src/array_allocator.c | 2 +- src/fast_task_queue.c | 2 +- src/ini_file_reader.c | 2 +- src/logger.c | 8 ++++---- src/shared_func.c | 2 +- src/shared_func.h | 40 ++++++++++++++++++++++++++++++++-------- 6 files changed, 40 insertions(+), 16 deletions(-) diff --git a/src/array_allocator.c b/src/array_allocator.c index 0387e7d..92d99dd 100644 --- a/src/array_allocator.c +++ b/src/array_allocator.c @@ -47,7 +47,7 @@ int array_allocator_init_ex(ArrayAllocatorContext *ctx, start = end; } - fc_combine_two_string(name_prefix, "array", '-', name); + fc_combine_two_strings(name_prefix, "array", '-', name); return fast_allocator_init_ex(&ctx->allocator, name, obj_size, NULL, regions, region - regions, 0, 0.9999, reclaim_interval, need_lock); diff --git a/src/fast_task_queue.c b/src/fast_task_queue.c index 56bd17b..101ad59 100644 --- a/src/fast_task_queue.c +++ b/src/fast_task_queue.c @@ -142,7 +142,7 @@ int free_queue_init_ex2(struct fast_task_queue *queue, const char *name, (int64_t)max_data_size); */ - fc_combine_two_string(name, "task", '-', aname); + fc_combine_two_strings(name, "task", '-', aname); return fast_mblock_init_ex1(&queue->allocator, aname, queue->block_size, alloc_once, max_connections, (fast_mblock_object_init_func)task_alloc_init, diff --git a/src/ini_file_reader.c b/src/ini_file_reader.c index c10476b..31cc033 100644 --- a/src/ini_file_reader.c +++ b/src/ini_file_reader.c @@ -912,7 +912,7 @@ static int iniAddAnnotation(char *params) return EFAULT; } - fc_combine_two_string(func_name, "init_annotation", '_', symbol); + fc_combine_two_strings(func_name, "init_annotation", '_', symbol); init_func = dlsym(dlhandle, symbol); if (init_func == NULL) { diff --git a/src/logger.c b/src/logger.c index 837083f..3f13872 100644 --- a/src/logger.c +++ b/src/logger.c @@ -385,7 +385,7 @@ static int log_delete_old_file(LogContext *pContext, char full_filename[MAX_PATH_SIZE + 128]; if (NEED_COMPRESS_LOG(pContext->compress_log_flags)) { - fc_concat_two_string(old_filename, GZIP_EXT_NAME_STR, full_filename); + fc_concat_two_strings(old_filename, GZIP_EXT_NAME_STR, full_filename); } else { @@ -652,7 +652,7 @@ static int log_delete_matched_old_files(LogContext *pContext, log_get_file_path(pContext, log_filepath); for (i=0; i> 4) & 0x0F]; + *p++ = g_upper_hex_chars[subdir_index & 0x0F]; + *p = '\0'; + } else { + if (subdir_index <= UINT16_MAX) { + p += short2HEX(subdir_index, p, padding_len); + } else { + p += int2HEX(subdir_index, p, padding_len); + } + } + + return p - file_path; +} + /** get gzip command full filename * return: the gzip command full filename */