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

This commit is contained in:
Alexandre Julliard 2013-01-08 13:28:05 +01:00
parent 02aa14518b
commit e2761ab075
3 changed files with 15 additions and 20 deletions

View File

@ -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;
switch (size)
{
case sizeof(float): *ret = *(float*)tmp; break;
case sizeof(double): *ret = *(double*)tmp; break;
default: return FALSE;
}
if (size == sizeof(float)) *ret = *(float*)tmp;
else if (size == sizeof(double)) *ret = *(double*)tmp;
else if (size == sizeof(long double)) *ret = *(long double*)tmp;
else return FALSE;
return TRUE;
}

View File

@ -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;
/* float & double types have to be promoted to a long double */
switch (size)
{
case sizeof(float): *ret = *(float*)tmp; break;
case sizeof(double): *ret = *(double*)tmp; break;
case sizeof(long double): *ret = *(long double*)tmp; break;
default: return FALSE;
}
if (size == sizeof(float)) *ret = *(float*)tmp;
else if (size == sizeof(double)) *ret = *(double*)tmp;
else if (size == sizeof(long double)) *ret = *(long double*)tmp;
else return FALSE;
return TRUE;
}

View File

@ -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;
/* float & double types have to be promoted to a long double */
switch (size)
{
case sizeof(float): *ret = *(float*)tmp; break;
case sizeof(double): *ret = *(double*)tmp; break;
case sizeof(long double): *ret = *(long double*)tmp; break;
default: return FALSE;
}
if (size == sizeof(float)) *ret = *(float*)tmp;
else if (size == sizeof(double)) *ret = *(double*)tmp;
else if (size == sizeof(long double)) *ret = *(long double*)tmp;
else return FALSE;
return TRUE;
}