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; 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;
} }

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; 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;
} }

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; 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;
} }