refactor: 全量迁移 includes 到新规范语法
按根目录 新规范 迁移 R1/R2/R3/R4/R6/R7/R8/R9:指针 T* 后缀、内建类型短别名、c.Addr/c.Deref 单目化、c.Asm 改 __asm__、t.CDefine 改 define 软关键字、t.CEnum 改 enum。R4 对内建 cast 多参实参保留 c.Deref 原写法(单目化会致 TPC 类型退化)。验证:includes 52/52 编译通过,TransPyV 自举产物顺序回归 77/77 全通过。
This commit is contained in:
1 parent
aecdf27132
commit
e80284a6d5
88 files changed
+4474
-4474
No files matched your search
@@ -191,8 +191,8 @@ def _align():
|
||||
_g_bitcnt = 0
|
||||
|
||||
|
||||
def _decode(count: int | t.CPtr, first: int | t.CPtr,
|
||||
off: int | t.CPtr, sorted: int | t.CPtr) -> int:
|
||||
def _decode(count: int*, first: int*,
|
||||
off: int*, sorted: int*) -> int:
|
||||
code: int = 0
|
||||
ln: int = 1
|
||||
while ln <= 15:
|
||||
@@ -208,8 +208,8 @@ def _decode(count: int | t.CPtr, first: int | t.CPtr,
|
||||
return -1
|
||||
|
||||
|
||||
def _build(first: int | t.CPtr, off: int | t.CPtr,
|
||||
count: int | t.CPtr) -> int:
|
||||
def _build(first: int*, off: int*,
|
||||
count: int*) -> int:
|
||||
anylen: int = 0
|
||||
l1: int = 1
|
||||
while l1 <= 15:
|
||||
@@ -241,9 +241,9 @@ def _build(first: int | t.CPtr, off: int | t.CPtr,
|
||||
return 0
|
||||
|
||||
|
||||
def _collect(len_arr: int | t.CPtr, cnt: int | t.CPtr,
|
||||
sorted_arr: int | t.CPtr, nsym: int,
|
||||
pos: int | t.CPtr):
|
||||
def _collect(len_arr: int*, cnt: int*,
|
||||
sorted_arr: int*, nsym: int,
|
||||
pos: int*):
|
||||
string.memset(cnt, 0, 17 * 4)
|
||||
s1: int = 0
|
||||
while s1 < nsym:
|
||||
@@ -312,7 +312,7 @@ def _dist_base(code: int) -> int:
|
||||
return f + (1 << e)
|
||||
|
||||
|
||||
def _cl_order_set(arr: int | t.CPtr, idx: int, val: int):
|
||||
def _cl_order_set(arr: int*, idx: int, val: int):
|
||||
arr[idx] = val
|
||||
|
||||
|
||||
@@ -350,23 +350,23 @@ def _gzip_decode(src: t.CPtr, src_len: sizet,
|
||||
dout: uchar* = dst
|
||||
wpos: sizet = 0
|
||||
|
||||
lit_len: int | t.CPtr = stdlib.malloc(288 * 4)
|
||||
lit_cnt: int | t.CPtr = stdlib.malloc(17 * 4)
|
||||
lit_first: int | t.CPtr = stdlib.malloc(17 * 4)
|
||||
lit_off: int | t.CPtr = stdlib.malloc(17 * 4)
|
||||
lit_sorted: int | t.CPtr = stdlib.malloc(288 * 4)
|
||||
dst_len: int | t.CPtr = stdlib.malloc(32 * 4)
|
||||
dst_cnt: int | t.CPtr = stdlib.malloc(17 * 4)
|
||||
dst_first: int | t.CPtr = stdlib.malloc(17 * 4)
|
||||
dst_off: int | t.CPtr = stdlib.malloc(17 * 4)
|
||||
dst_sorted: int | t.CPtr = stdlib.malloc(32 * 4)
|
||||
cl_len: int | t.CPtr = stdlib.malloc(19 * 4)
|
||||
cl_order: int | t.CPtr = stdlib.malloc(19 * 4)
|
||||
cl_cnt: int | t.CPtr = stdlib.malloc(17 * 4)
|
||||
cl_first: int | t.CPtr = stdlib.malloc(17 * 4)
|
||||
cl_off: int | t.CPtr = stdlib.malloc(17 * 4)
|
||||
cl_sorted: int | t.CPtr = stdlib.malloc(19 * 4)
|
||||
pos_tmp: int | t.CPtr = stdlib.malloc(17 * 4)
|
||||
lit_len: int* = stdlib.malloc(288 * 4)
|
||||
lit_cnt: int* = stdlib.malloc(17 * 4)
|
||||
lit_first: int* = stdlib.malloc(17 * 4)
|
||||
lit_off: int* = stdlib.malloc(17 * 4)
|
||||
lit_sorted: int* = stdlib.malloc(288 * 4)
|
||||
dst_len: int* = stdlib.malloc(32 * 4)
|
||||
dst_cnt: int* = stdlib.malloc(17 * 4)
|
||||
dst_first: int* = stdlib.malloc(17 * 4)
|
||||
dst_off: int* = stdlib.malloc(17 * 4)
|
||||
dst_sorted: int* = stdlib.malloc(32 * 4)
|
||||
cl_len: int* = stdlib.malloc(19 * 4)
|
||||
cl_order: int* = stdlib.malloc(19 * 4)
|
||||
cl_cnt: int* = stdlib.malloc(17 * 4)
|
||||
cl_first: int* = stdlib.malloc(17 * 4)
|
||||
cl_off: int* = stdlib.malloc(17 * 4)
|
||||
cl_sorted: int* = stdlib.malloc(19 * 4)
|
||||
pos_tmp: int* = stdlib.malloc(17 * 4)
|
||||
if lit_len is None or lit_cnt is None or lit_first is None \
|
||||
or lit_off is None or lit_sorted is None or dst_len is None \
|
||||
or dst_cnt is None or dst_first is None or dst_off is None \
|
||||
@@ -443,7 +443,7 @@ def _gzip_decode(src: t.CPtr, src_len: sizet,
|
||||
if wpos >= dst_cap:
|
||||
err = -9
|
||||
break
|
||||
dout[wpos] = t.CUnsignedChar(ch)
|
||||
dout[wpos] = uchar(ch)
|
||||
wpos += 1
|
||||
i += 1
|
||||
if err != 0:
|
||||
@@ -562,7 +562,7 @@ def _gzip_decode(src: t.CPtr, src_len: sizet,
|
||||
if wpos >= dst_cap:
|
||||
err = -18
|
||||
break
|
||||
dout[wpos] = t.CUnsignedChar(sym)
|
||||
dout[wpos] = uchar(sym)
|
||||
wpos += 1
|
||||
elif sym == 256:
|
||||
run = 0
|
||||
|
||||
Reference in new issue
Block a user