summaryrefslogtreecommitdiff
path: root/src/parsing.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/parsing.h')
-rw-r--r--src/parsing.h42
1 files changed, 21 insertions, 21 deletions
diff --git a/src/parsing.h b/src/parsing.h
index d64236df3..a75e953b4 100644
--- a/src/parsing.h
+++ b/src/parsing.h
@@ -85,10 +85,10 @@ parseConst(cashew::IString s, Type type, MixedArena& allocator) {
if (type.isFloat()) {
if (s == _INFINITY) {
switch (type) {
- case f32:
+ case Type::f32:
ret->value = Literal(std::numeric_limits<float>::infinity());
break;
- case f64:
+ case Type::f64:
ret->value = Literal(std::numeric_limits<double>::infinity());
break;
default:
@@ -99,10 +99,10 @@ parseConst(cashew::IString s, Type type, MixedArena& allocator) {
}
if (s == NEG_INFINITY) {
switch (type) {
- case f32:
+ case Type::f32:
ret->value = Literal(-std::numeric_limits<float>::infinity());
break;
- case f64:
+ case Type::f64:
ret->value = Literal(-std::numeric_limits<double>::infinity());
break;
default:
@@ -113,10 +113,10 @@ parseConst(cashew::IString s, Type type, MixedArena& allocator) {
}
if (s == _NAN) {
switch (type) {
- case f32:
+ case Type::f32:
ret->value = Literal(float(std::nan("")));
break;
- case f64:
+ case Type::f64:
ret->value = Literal(double(std::nan("")));
break;
default:
@@ -138,7 +138,7 @@ parseConst(cashew::IString s, Type type, MixedArena& allocator) {
throw ParseException("bad nan input");
}
switch (type) {
- case f32: {
+ case Type::f32: {
uint32_t pattern;
if (modifier) {
std::istringstream istr(modifier);
@@ -159,7 +159,7 @@ parseConst(cashew::IString s, Type type, MixedArena& allocator) {
ret->value = Literal(pattern).castToF32();
break;
}
- case f64: {
+ case Type::f64: {
uint64_t pattern;
if (modifier) {
std::istringstream istr(modifier);
@@ -188,10 +188,10 @@ parseConst(cashew::IString s, Type type, MixedArena& allocator) {
}
if (s == NEG_NAN) {
switch (type) {
- case f32:
+ case Type::f32:
ret->value = Literal(float(-std::nan("")));
break;
- case f64:
+ case Type::f64:
ret->value = Literal(double(-std::nan("")));
break;
default:
@@ -202,7 +202,7 @@ parseConst(cashew::IString s, Type type, MixedArena& allocator) {
}
}
switch (type) {
- case i32: {
+ case Type::i32: {
if ((str[0] == '0' && str[1] == 'x') ||
(str[0] == '-' && str[1] == '0' && str[2] == 'x')) {
bool negative = str[0] == '-';
@@ -227,7 +227,7 @@ parseConst(cashew::IString s, Type type, MixedArena& allocator) {
}
break;
}
- case i64: {
+ case Type::i64: {
if ((str[0] == '0' && str[1] == 'x') ||
(str[0] == '-' && str[1] == '0' && str[2] == 'x')) {
bool negative = str[0] == '-';
@@ -252,24 +252,24 @@ parseConst(cashew::IString s, Type type, MixedArena& allocator) {
}
break;
}
- case f32: {
+ case Type::f32: {
char* end;
ret->value = Literal(strtof(str, &end));
break;
}
- case f64: {
+ case Type::f64: {
char* end;
ret->value = Literal(strtod(str, &end));
break;
}
- case v128:
- case funcref:
- case anyref:
- case nullref:
- case exnref:
+ case Type::v128:
+ case Type::funcref:
+ case Type::anyref:
+ case Type::nullref:
+ case Type::exnref:
WASM_UNREACHABLE("unexpected const type");
- case none:
- case unreachable: {
+ case Type::none:
+ case Type::unreachable: {
return nullptr;
}
}