This commit is contained in:
Vasilii Rogin 2023-05-14 23:19:05 +03:00
parent 7a0e537560
commit 4321e55b4d
1 changed files with 5 additions and 5 deletions

View File

@ -135,15 +135,15 @@ public:
case VALUE_TYPE_INT: case VALUE_TYPE_INT:
type = ArrayElementType::INT; type = ArrayElementType::INT;
integerValue = programValue.integerValue; integerValue = programValue.integerValue;
return; break;
case VALUE_TYPE_FLOAT: case VALUE_TYPE_FLOAT:
type = ArrayElementType::FLOAT; type = ArrayElementType::FLOAT;
floatValue = programValue.floatValue; floatValue = programValue.floatValue;
return; break;
case VALUE_TYPE_PTR: case VALUE_TYPE_PTR:
type = ArrayElementType::POINTER; type = ArrayElementType::POINTER;
pointerValue = programValue.pointerValue; pointerValue = programValue.pointerValue;
return; break;
case VALUE_TYPE_STRING: case VALUE_TYPE_STRING:
case VALUE_TYPE_DYNAMIC_STRING: case VALUE_TYPE_DYNAMIC_STRING:
type = ArrayElementType::STRING; type = ArrayElementType::STRING;
@ -152,7 +152,7 @@ public:
auto buf = (char*)malloc(len + 1); auto buf = (char*)malloc(len + 1);
strcpy(buf, str); strcpy(buf, str);
stringValue = buf; stringValue = buf;
return; break;
} }
} }
ProgramValue toValue(Program* program) const ProgramValue toValue(Program* program) const
@ -282,7 +282,7 @@ public:
if (key.isInt()) { if (key.isInt()) {
auto index = key.asInt(); auto index = key.asInt();
if (index >= 0 && index < size()) { if (index >= 0 && index < size()) {
values[index] = ArrayElement { key, program }; values[index] = ArrayElement { val, program };
} }
} }
} }