Code cleanup.

This commit is contained in:
2022-11-09 13:53:53 +08:00
parent 1f621082c6
commit 55efc7a428
4 changed files with 9 additions and 16 deletions

View File

@@ -70,7 +70,7 @@ namespace Cryville.Crtr {
}
else if (sig.Name == _op_sep) {
result = new op_arr(sig.ParamCount);
_shortops.Add(new PdtOperatorSignature(",", sig.ParamCount), result);
_shortops.Add(new PdtOperatorSignature(_op_sep, sig.ParamCount), result);
return result;
}
else if (_longops.TryGetValue(sig.Name, out result)) {
@@ -234,13 +234,13 @@ namespace Cryville.Crtr {
int type = o0.Type;
int len = o0.Length;
bool blit = !IsBlittable(type);
for (var i = 1; i < ParamCount; i++) {
for (var i = 1; i < LoadedOperandCount; i++) {
var o = GetOperand(i);
if (o.Type != type) throw new InvalidOperationException("Cannot create variant type array");
else if (!IsBlittable(o.Type)) blit = true;
len += o.Length;
}
if (blit) GetReturnFrame(PdtInternalType.Array, len + 2 * sizeof(int)).SetArraySuffix(type, ParamCount);
if (blit) GetReturnFrame(PdtInternalType.Array, len + 2 * sizeof(int)).SetArraySuffix(type, LoadedOperandCount);
else GetReturnFrame(PdtInternalType.Vector, len + sizeof(int)).SetArraySuffix(type);
}
bool IsBlittable(int type) {