This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[commit] gdbserver/utils.c/decimal2str, eliminate dead parameter.


Analyzing two lines of dead code lead to the conclusion that the
parameter was not being used as a parameter at all.

Checking this in.

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.

Index: gdbserver/utils.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/utils.c,v
retrieving revision 1.29
diff -u -p -u -p -r1.29 utils.c
--- gdbserver/utils.c	6 Jan 2011 00:14:09 -0000	1.29
+++ gdbserver/utils.c	26 Feb 2011 18:40:29 -0000
@@ -256,14 +256,15 @@ xsnprintf (char *str, size_t size, const
 }
 
 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, 
   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, 
 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.  */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]