Fixes this error:
/builddir/build/BUILD/mp-34afbd381c72af810c4313e5f4ee182dec93682e/src/asl/aslbuilder.cc: In function ‘void mp::asl::internal::Convert(const mp::NLHeader&, Edaginfo&)’:
/builddir/build/BUILD/mp-34afbd381c72af810c4313e5f4ee182dec93682e/src/asl/aslbuilder.cc:83:54: error: invalid conversion from ‘int’ to ‘mp::arith::Kind’ [-fpermissive]
83 | arith::IsIEEE(arith_kind) && arith::IsIEEE(h.arith_kind)) {
| ~~^~~~~~~~~~
| |
| int
In file included from /builddir/build/BUILD/mp-34afbd381c72af810c4313e5f4ee182dec93682e/include/mp/common.h:30,
from /builddir/build/BUILD/mp-34afbd381c72af810c4313e5f4ee182dec93682e/include/mp/problem-builder.h:32,
from /builddir/build/BUILD/mp-34afbd381c72af810c4313e5f4ee182dec93682e/src/asl/aslbuilder.h:30:
/builddir/build/BUILD/mp-34afbd381c72af810c4313e5f4ee182dec93682e/include/mp/nl-header.h:122:32: note: initializing argument 1 of ‘bool mp::arith::IsIEEE(Kind)’
122 | inline bool IsIEEE(arith::Kind k) {
| ~~~~~~~~~~~~^
--- mp-34afbd381c72af810c4313e5f4ee182dec93682e/src/asl/aslbuilder.cc.orig 2024-02-06 20:09:02.731522049 -0700
+++ mp-34afbd381c72af810c4313e5f4ee182dec93682e/src/asl/aslbuilder.cc 2024-02-06 21:09:24.523829332 -0700
@@ -77,10 +77,11 @@ namespace internal {
void Convert(const NLHeader &h, Edaginfo &info) {
info.binary_nl_ = h.format;
- if (h.arith_kind != arith::UNKNOWN) {
+ arith::Kind h_kind = static_cast<arith::Kind>(h.arith_kind);
+ if (h_kind != arith::UNKNOWN) {
arith::Kind arith_kind = arith::GetKind();
- if (arith_kind != h.arith_kind &&
- arith::IsIEEE(arith_kind) && arith::IsIEEE(h.arith_kind)) {
+ if (arith_kind != h_kind &&
+ arith::IsIEEE(arith_kind) && arith::IsIEEE(h_kind)) {
info.binary_nl_ = h.arith_kind << 1;
info.iadjfcn = info.dadjfcn = bswap_ASL;
}