Compare commits

...

2 Commits

3 changed files with 7 additions and 10 deletions

7
.vscode/launch.json vendored
View File

@ -9,12 +9,11 @@
"program": "${workspaceFolder}\\Build\\SrcToA2L.exe", // "program": "${workspaceFolder}\\Build\\SrcToA2L.exe", //
"args": [ // "args": [ //
".\\Test\\typedef.h", ".\\Test\\typedef.h",
".\\Inc\\Type_Descriptions.hpp", ".\\Test\\source_code.c",
".\\Test\\input.c",
"-r", "-r",
".\\Test\\PVER.a2l", ".\\Test\\Minimal_A2L.a2l",
"-m", "-m",
".\\Test\\PVER.map", ".\\Test\\test_map.map",
], ],
"stopAtEntry": false, "stopAtEntry": false,
"cwd": "${workspaceFolder}", // "cwd": "${workspaceFolder}", //

View File

@ -14,10 +14,10 @@ extern "C"
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
printf("\n\n"); 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, "Auther: LuChiChick");
log_printf(LOG_SYS_INFO, "%s\n%s\n%s\n\n", "Open source links:", 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"); " └─Personal Git System: https://git.luchichick.cn/LuChiChick/SrcToA2L");
log_printf(LOG_SYS_INFO, "Start argument solve.\n\n"); 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'; info.element_count = info.element_count * 10 + buff[n] - '0';
else else
{ {
// 处理宏定义常量,暂时将不支持的量定义为1
// 提取宏字符串 // 提取宏字符串
char define_str[VARIABLE_NAME_STR_LENGTH_MAX] = {'\0'}; char define_str[VARIABLE_NAME_STR_LENGTH_MAX] = {'\0'};
for (int count = 0; count < VARIABLE_NAME_STR_LENGTH_MAX; count++) 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; target_define_node = target_define_node->p_next;
} }
// 遍历完成但没有找到 // 遍历完成但没有找到,元素长度设置为0
if (target_define_node == nullptr) if (target_define_node == nullptr)
{ {
// printf("\n"); // printf("\n");
@ -404,7 +402,7 @@ variable_info solve_variable_info(const char *code_line_str)
break; break;
} }
if (buff[count] == ' ' || buff[count] == '=' || buff[count] == ';') // 是单个变量 if (buff[count] == '\0' || buff[count] == '=' || buff[count] == ';') // 是单个变量
{ {
info.element_count = 1; info.element_count = 1;
break; break;