提交 032c3ecb 编写于 作者: G Geoff Thorpe

Protect against gcc's "warning: cast does not match function type".

上级 e703b465
......@@ -619,6 +619,7 @@ fmtfp(
int caps = 0;
long intpart;
long fracpart;
long max10;
if (max < 0)
max = 6;
......@@ -639,11 +640,12 @@ fmtfp(
/* we "cheat" by converting the fractional part to integer by
multiplying by a factor of 10 */
fracpart = roundv((pow10(max)) * (ufvalue - intpart));
max10 = roundv(pow10(max));
fracpart = roundv(pow10(max) * (ufvalue - intpart));
if (fracpart >= (long)pow10(max)) {
if (fracpart >= max10) {
intpart++;
fracpart -= (long)pow10(max);
fracpart -= max10;
}
/* convert integer part */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册