Move from sentinel-terminated pointers to sentinel-terminated slices globally ([+:0] -> [:0]) (#203)

This commit is contained in:
Nikolas 2025-02-24 16:44:40 +01:00
parent 4d452b2bcd
commit bc82c6ebd7
Failed to generate hash of commit
6 changed files with 209 additions and 209 deletions

View file

@ -73,7 +73,7 @@ def ziggify_type(name: str, t: str, func_name) -> str:
string = False
if name == "text" and t == "[*c][*c]const u8":
return "[][*:0]const u8"
return "[][:0]const u8"
if t.startswith("[*c]") and name not in single and name not in multi:
if (t == "[*c]const u8" or t == "[*c]u8") and name not in NO_STRINGS: # Strings are multis.
@ -85,7 +85,7 @@ def ziggify_type(name: str, t: str, func_name) -> str:
while t.startswith("[*c]"):
t = t[4:]
if string and not t.startswith("[*c]"):
pre += "[*:0]"
pre += "[:0]"
elif name in single:
pre += "*"
else: