diff --git a/src/sdf/context.h b/src/sdf/context.h index dbf5090d7..b67e4d438 100644 --- a/src/sdf/context.h +++ b/src/sdf/context.h @@ -28,8 +28,8 @@ struct Operand { bool isConst() const { return id <= -4; } bool isResult() const { return id > 0; } bool isNone() const { return id == 0; } - int toConstIndex() const { return -(id + 4); } - int toInstIndex() const { return id - 1; } + size_t toConstIndex() const { return static_cast(-(id + 4)); } + size_t toInstIndex() const { return static_cast(id - 1); } bool operator==(const Operand& other) const { return id == other.id; } bool operator!=(const Operand& other) const { return id != other.id; } }; diff --git a/src/sdf/tape.h b/src/sdf/tape.h index 0f2aec70c..e80695b8a 100644 --- a/src/sdf/tape.h +++ b/src/sdf/tape.h @@ -115,11 +115,11 @@ struct EvalContext { Domain x = operand(tape[i + 2]); operand(tape[i + 1]) = handle_unary(current, x); i += 3; - // } else if (current == OpCode::CONST) { - // double x; - // std::memcpy(&x, tape.data() + i + 2, sizeof(x)); - // operand(tape[i + 1]) = x; - // i += 2 + sizeof(x); + // } else if (current == OpCode::CONST) { + // double x; + // std::memcpy(&x, tape.data() + i + 2, sizeof(x)); + // operand(tape[i + 1]) = x; + // i += 2 + sizeof(x); } else if (current == OpCode::RETURN) { return operand(tape[i + 1]); } else {