Skip to content

Commit

Permalink
fix compile time errors
Browse files Browse the repository at this point in the history
  • Loading branch information
yeti0904 committed Aug 18, 2024
1 parent fe6cc70 commit 5a6b060
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion source/backends/arm64.d
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ class BackendARM64 : CompilerBackend {
if (!TypeExists(type)) {
Error(node.error, "Type '%s' doesn't exist", type);
}
if (type.isStruct) {
if (GetType(type).isStruct) {
Error(node.error, "Structures cannot be used in function parameters");
}
}
Expand Down
2 changes: 1 addition & 1 deletion source/backends/lua.d
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ class BackendLua : CompilerBackend {
if (!TypeExists(type)) {
Error(node.error, "Type '%s' doesn't exist", type);
}
if (type.isStruct) {
if (GetType(type).isStruct) {
Error(node.error, "Structures cannot be used in function parameters");
}
}
Expand Down
2 changes: 1 addition & 1 deletion source/backends/rm86.d
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ class BackendRM86 : CompilerBackend {
if (!TypeExists(type)) {
Error(node.error, "Type '%s' doesn't exist", type);
}
if (type.isStruct) {
if (GetType(type).isStruct) {
Error(node.error, "Structures cannot be used in function parameters");
}
}
Expand Down
7 changes: 4 additions & 3 deletions source/backends/uxn.d
Original file line number Diff line number Diff line change
Expand Up @@ -352,13 +352,14 @@ class BackendUXN : CompilerBackend {
output ~= format("@%s\n", symbol);

// allocate parameters
size_t paramSize;
size_t paramSize = node.params.length * 2;
foreach (ref type ; node.paramTypes) {
if (!TypeExists(type)) {
Error(node.error, "Type '%s' doesn't exist", type);
}

paramSize += GetType(type).size;
if (GetType(type).isStruct) {
Error(node.error, "Structures cannot be used in function parameters");
}
}
if (paramSize > 0) {
output ~= format(".vsp LDZ2 #%.4x SUB2 .vsp STZ2\n", paramSize);
Expand Down
2 changes: 1 addition & 1 deletion source/backends/x86_64.d
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ class BackendX86_64 : CompilerBackend {
if (!TypeExists(type)) {
Error(node.error, "Type '%s' doesn't exist", type);
}
if (type.isStruct) {
if (GetType(type).isStruct) {
Error(node.error, "Structures cannot be used in function parameters");
}
}
Expand Down

0 comments on commit 5a6b060

Please sign in to comment.