Преглед изворни кода

refactor: freeCode函数调整为内部函数

SongZihuan пре 3 година
родитељ
комит
b77b4c8ab6
2 измењених фајлова са 2 додато и 2 уклоњено
  1. 0 1
      include/code.h
  2. 2 1
      src/core/code.c

+ 0 - 1
include/code.h

@@ -17,7 +17,6 @@ af_Code *makeVariableCode(char *var, char prefix, FileLine line, FilePath path);
 af_Code *makeBlockCode(enum af_BlockType type, af_Code *element, char prefix, FileLine line, FilePath path, af_Code **next);
 
 /* 代码块释放函数 */
-af_Code *freeCode(af_Code *bt);
 bool freeCodeWithElement(af_Code *bt, af_Code **next);
 void freeAllCode(af_Code *bt);
 

+ 2 - 1
src/core/code.c

@@ -10,6 +10,7 @@
 
 /* Code 创建函数 */
 static af_Code *makeCode(char prefix, FileLine line, FilePath path);
+static af_Code *freeCode(af_Code *bt);
 
 /* Code 操作函数 */
 static void countElement(af_Code *element, CodeUint *elements, CodeUint *count, af_Code **next);
@@ -130,7 +131,7 @@ af_Code *copyCode(af_Code *base, FilePath *path) {
     return dest;
 }
 
-af_Code *freeCode(af_Code *bt) {
+static af_Code *freeCode(af_Code *bt) {
     if (bt == NULL)
         return NULL;