mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-31 08:49:15 +00:00
winedbg: Use an if instead of a switch in case some float types have the same size.
This commit is contained in:
parent
02aa14518b
commit
e2761ab075
3 changed files with 15 additions and 20 deletions
|
@ -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,
|
||||||
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,
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue