Commit e2761ab0 authored by Alexandre Julliard's avatar Alexandre Julliard

winedbg: Use an if instead of a switch in case some float types have the same size.

parent 02aa1451
...@@ -1875,12 +1875,11 @@ static int be_arm_fetch_float(const struct dbg_lvalue* lvalue, unsigned size, ...@@ -1875,12 +1875,11 @@ static int be_arm_fetch_float(const struct dbg_lvalue* lvalue, unsigned size,
*/ */
if (!memory_read_value(lvalue, size, tmp)) return FALSE; if (!memory_read_value(lvalue, size, tmp)) return FALSE;
switch (size) if (size == sizeof(float)) *ret = *(float*)tmp;
{ else if (size == sizeof(double)) *ret = *(double*)tmp;
case sizeof(float): *ret = *(float*)tmp; break; else if (size == sizeof(long double)) *ret = *(long double*)tmp;
case sizeof(double): *ret = *(double*)tmp; break; else return FALSE;
default: return FALSE;
}
return TRUE; return TRUE;
} }
......
...@@ -767,13 +767,11 @@ static int be_i386_fetch_float(const struct dbg_lvalue* lvalue, unsigned size, ...@@ -767,13 +767,11 @@ static int be_i386_fetch_float(const struct dbg_lvalue* lvalue, unsigned size,
if (!memory_read_value(lvalue, size, tmp)) return FALSE; if (!memory_read_value(lvalue, size, tmp)) return FALSE;
/* float & double types have to be promoted to a long double */ /* float & double types have to be promoted to a long double */
switch (size) if (size == sizeof(float)) *ret = *(float*)tmp;
{ else if (size == sizeof(double)) *ret = *(double*)tmp;
case sizeof(float): *ret = *(float*)tmp; break; else if (size == sizeof(long double)) *ret = *(long double*)tmp;
case sizeof(double): *ret = *(double*)tmp; break; else return FALSE;
case sizeof(long double): *ret = *(long double*)tmp; break;
default: return FALSE;
}
return TRUE; return TRUE;
} }
......
...@@ -631,13 +631,11 @@ static int be_x86_64_fetch_float(const struct dbg_lvalue* lvalue, unsigned size, ...@@ -631,13 +631,11 @@ static int be_x86_64_fetch_float(const struct dbg_lvalue* lvalue, unsigned size,
if (!memory_read_value(lvalue, size, tmp)) return FALSE; if (!memory_read_value(lvalue, size, tmp)) return FALSE;
/* float & double types have to be promoted to a long double */ /* float & double types have to be promoted to a long double */
switch (size) if (size == sizeof(float)) *ret = *(float*)tmp;
{ else if (size == sizeof(double)) *ret = *(double*)tmp;
case sizeof(float): *ret = *(float*)tmp; break; else if (size == sizeof(long double)) *ret = *(long double*)tmp;
case sizeof(double): *ret = *(double*)tmp; break; else return FALSE;
case sizeof(long double): *ret = *(long double*)tmp; break;
default: return FALSE;
}
return TRUE; return TRUE;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment