fix(narrow): BuildPipeline.ensure_dir 消除隐式窄化(int(path_len) / char(saved))

buf[i] 元素为 i8,saved 由 int 改为 char 并用 char(ch) 显式收窄;plen 由 sizet 显式 int(path_len) 收窄
This commit is contained in:
TermiNexus committed 2026-10-11 09:42:39 +08:00
1 parent 77f4a25055
commit 966fc3b8f5
1 file changed
+2 -2
+2 -2
View File
@@ -290,11 +290,11 @@ def ensure_dir(path: str) -> int:
# Temporarily truncate at each separator and create every directory level.
# CreateDirectoryA returns 0 when the dir exists (failure); ignore it.
plen: int = path_len
plen: int = int(path_len)
for i in range(plen):
ch: int = buf[i]
if ch == 47 or ch == 92: # '/' = 47, '\\' = 92
saved: int = ch
saved: char = char(ch)
buf[i] = '\0'
win32.win32file.CreateDirectoryA(buf, None)
buf[i] = saved