From: Michael Snyder Date: Sat, 26 Feb 2011 18:53:44 +0000 (+0000) Subject: 2011-02-26 Michael Snyder X-Git-Tag: sid-snapshot-20110301~66 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=238f1c7460fb0d30a5aea1bbae261d3aef1d75c0;p=external%2Fbinutils.git 2011-02-26 Michael Snyder * utils.c (decimal2str): Eliminate dead code and dead param. (pulongest): Drop dead param from call to decimal2str. (plongest): Ditto. --- diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 1f42a8e..ed1bf12 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,9 @@ +2011-02-26 Michael Snyder + + * utils.c (decimal2str): Eliminate dead code and dead param. + (pulongest): Drop dead param from call to decimal2str. + (plongest): Ditto. + 2011-02-24 Joel Brobecker Revert the following patch (not approved yet): 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. */