mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 832788. Part 4: PrimitiveConversions should avoid implicit narrowing casts to avoid compiler warnings; make them explicit. r=bzbarsky
--HG-- extra : rebase_source : 276f7834714ded347bd9d368258bc049f24787c4
This commit is contained in:
parent
2532cb1a6a
commit
f181913ea5
@ -273,7 +273,7 @@ PrimitiveConversionTraits_Clamp(JSContext* cx, const double& d, T* retval)
|
||||
// the correct result. If N is even, plus or minus N is the correct result.
|
||||
double toTruncate = (d < 0) ? d - 0.5 : d + 0.5;
|
||||
|
||||
T truncated(toTruncate);
|
||||
T truncated = static_cast<T>(toTruncate);
|
||||
|
||||
if (truncated == toTruncate) {
|
||||
/*
|
||||
@ -339,8 +339,8 @@ bool ValueToPrimitive(JSContext* cx, JS::Value v, T* retval)
|
||||
if (!PrimitiveConversionTraits<T, B>::converter(cx, v, &t))
|
||||
return false;
|
||||
|
||||
*retval =
|
||||
static_cast<typename PrimitiveConversionTraits<T, B>::intermediateType>(t);
|
||||
*retval = static_cast<T>(
|
||||
static_cast<typename PrimitiveConversionTraits<T, B>::intermediateType>(t));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user