Ver1.5 && fixed a bug caused by incorrect single-variable condition judgment && github link added

This commit is contained in:
LuChiChick 2025-08-12 22:34:51 +08:00
parent 4909a1836a
commit 2af81a043c
2 changed files with 4 additions and 6 deletions

View File

@ -14,10 +14,10 @@ extern "C"
int main(int argc, char *argv[])
{
printf("\n\n");
log_printf(LOG_SYS_INFO, "SrcToA2L Ver1.4");
log_printf(LOG_SYS_INFO, "SrcToA2L Ver1.5");
log_printf(LOG_SYS_INFO, "Auther: LuChiChick");
log_printf(LOG_SYS_INFO, "%s\n%s\n%s\n\n", "Open source links:",
" ├─Github: https://git.luchichick.cn/LuChiChick/SrcToA2L",
" ├─Github: https://github.com/LuChiChick/SrcToA2L",
" └─Personal Git System: https://git.luchichick.cn/LuChiChick/SrcToA2L");
log_printf(LOG_SYS_INFO, "Start argument solve.\n\n");

View File

@ -367,8 +367,6 @@ variable_info solve_variable_info(const char *code_line_str)
info.element_count = info.element_count * 10 + buff[n] - '0';
else
{
// 处理宏定义常量,暂时将不支持的量定义为1
// 提取宏字符串
char define_str[VARIABLE_NAME_STR_LENGTH_MAX] = {'\0'};
for (int count = 0; count < VARIABLE_NAME_STR_LENGTH_MAX; count++)
@ -389,7 +387,7 @@ variable_info solve_variable_info(const char *code_line_str)
}
target_define_node = target_define_node->p_next;
}
// 遍历完成但没有找到
// 遍历完成但没有找到,元素长度设置为0
if (target_define_node == nullptr)
{
// printf("\n");
@ -404,7 +402,7 @@ variable_info solve_variable_info(const char *code_line_str)
break;
}
if (buff[count] == ' ' || buff[count] == '=' || buff[count] == ';') // 是单个变量
if (buff[count] == '\0' || buff[count] == '=' || buff[count] == ';') // 是单个变量
{
info.element_count = 1;
break;