OSDN Git Service
(root)
/
pf3gnuchains
/
pf3gnuchains3x.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
29d0a50
)
print_percentage: Use floating point to avoid incorrect results when
author
hilfingr
<hilfingr>
Sat, 20 Mar 2004 09:53:03 +0000
(09:53 +0000)
committer
hilfingr
<hilfingr>
Sat, 20 Mar 2004 09:53:03 +0000
(09:53 +0000)
portion*100 overflows.
gdb/ChangeLog
patch
|
blob
|
history
gdb/bcache.c
patch
|
blob
|
history
diff --git
a/gdb/ChangeLog
b/gdb/ChangeLog
index
442af68
..
53824f1
100644
(file)
--- a/
gdb/ChangeLog
+++ b/
gdb/ChangeLog
@@
-1,3
+1,8
@@
+2004-03-20 Paul Hilfinger <hilfingr@nile.gnat.com>
+
+ * bcache.c (print_percentage): Use floating point to avoid
+ incorrect results when portion*100 overflows.
+
2004-03-19 Kevin Buettner <kevinb@redhat.com>
* ppc_tdep.h (ppc_linux_frame_saved_pc)
diff --git
a/gdb/bcache.c
b/gdb/bcache.c
index
cadadb5
..
0bc533e
100644
(file)
--- a/
gdb/bcache.c
+++ b/
gdb/bcache.c
@@
-303,7
+303,7
@@
print_percentage (int portion, int total)
if (total == 0)
printf_filtered ("(not applicable)\n");
else
- printf_filtered ("%3d%%\n",
portion * 100 / total
);
+ printf_filtered ("%3d%%\n",
(int) (portion * 100.0 / total)
);
}