aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/utils.c
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@vmware.com>2011-02-26 18:53:44 +0000
committerMichael Snyder <msnyder@vmware.com>2011-02-26 18:53:44 +0000
commit238f1c7460fb0d30a5aea1bbae261d3aef1d75c0 (patch)
tree12799f9745645b8f69b3b33f13ff6de42c5dfe54 /gdb/gdbserver/utils.c
parent2279eaad98fbbc7c036796930e2ac839d581c18a (diff)
downloadgdb-238f1c7460fb0d30a5aea1bbae261d3aef1d75c0.zip
gdb-238f1c7460fb0d30a5aea1bbae261d3aef1d75c0.tar.gz
gdb-238f1c7460fb0d30a5aea1bbae261d3aef1d75c0.tar.bz2
2011-02-26 Michael Snyder <msnyder@vmware.com>
* utils.c (decimal2str): Eliminate dead code and dead param. (pulongest): Drop dead param from call to decimal2str. (plongest): Ditto.
Diffstat (limited to 'gdb/gdbserver/utils.c')
-rw-r--r--gdb/gdbserver/utils.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/gdb/gdbserver/utils.c b/gdb/gdbserver/utils.c
index 7e9000e..45d032c 100644
--- a/gdb/gdbserver/utils.c
+++ b/gdb/gdbserver/utils.c
@@ -256,14 +256,15 @@ xsnprintf (char *str, size_t size, const char *format, ...)
}
static char *
-decimal2str (char *sign, ULONGEST addr, int width)
+decimal2str (char *sign, ULONGEST addr)
{
/* Steal code from valprint.c:print_decimal(). Should this worry
about the real size of addr as the above does? */
unsigned long temp[3];
char *str = get_cell ();
-
int i = 0;
+ int width;
+
do
{
temp[i] = addr % (1000 * 1000 * 1000);
@@ -274,8 +275,6 @@ decimal2str (char *sign, ULONGEST addr, int width)
while (addr != 0 && i < (sizeof (temp) / sizeof (temp[0])));
width = 9;
- if (width < 0)
- width = 0;
switch (i)
{
@@ -304,7 +303,7 @@ decimal2str (char *sign, ULONGEST addr, int width)
char *
pulongest (ULONGEST u)
{
- return decimal2str ("", u, 0);
+ return decimal2str ("", u);
}
/* %d for LONGEST. The result is stored in a circular static buffer,
@@ -314,9 +313,9 @@ char *
plongest (LONGEST l)
{
if (l < 0)
- return decimal2str ("-", -l, 0);
+ return decimal2str ("-", -l);
else
- return decimal2str ("", l, 0);
+ return decimal2str ("", l);
}
/* Eliminate warning from compiler on 32-bit systems. */