Fix exportImageToMemory (#232)

* fix exportImageToMemory

* update make_return_cast
This commit is contained in:
Tommy D. Rossi 2025-03-30 18:00:07 +02:00 committed by GitHub
parent e072ff119b
commit a00552ea79
Failed to generate hash of commit
2 changed files with 3 additions and 1 deletions

View file

@ -122,6 +122,8 @@ def add_namespace_to_type(t: str) -> str:
def make_return_cast(source_type: str, dest_type: str, inner: str) -> str:
if source_type == dest_type:
return inner
if "ExportImageToMemory" in inner:
return f"{inner}[0..@as(usize, @intCast(fileSize.*))]"
if source_type in ["[*c]const u8", "[*c]u8"]:
return f"std.mem.span({inner})"