SF.net SVN: gar:[23748] csw/mgar/pkg/coreutils/trunk/files/0005-src-df. c-Prevent-compiler-warning-by-removing-block.patch

bdwalton at users.sourceforge.net bdwalton at users.sourceforge.net
Sun Jun 1 22:10:41 CEST 2014


Revision: 23748
          http://sourceforge.net/p/gar/code/23748
Author:   bdwalton
Date:     2014-06-01 20:10:39 +0000 (Sun, 01 Jun 2014)
Log Message:
-----------
drop patch file that should not have been included yet - it is broken

Removed Paths:
-------------
    csw/mgar/pkg/coreutils/trunk/files/0005-src-df.c-Prevent-compiler-warning-by-removing-block.patch

Deleted: csw/mgar/pkg/coreutils/trunk/files/0005-src-df.c-Prevent-compiler-warning-by-removing-block.patch
===================================================================
--- csw/mgar/pkg/coreutils/trunk/files/0005-src-df.c-Prevent-compiler-warning-by-removing-block.patch	2014-06-01 20:04:28 UTC (rev 23747)
+++ csw/mgar/pkg/coreutils/trunk/files/0005-src-df.c-Prevent-compiler-warning-by-removing-block.patch	2014-06-01 20:10:39 UTC (rev 23748)
@@ -1,124 +0,0 @@
-From 947aa78883636ef8e2469d1a89e8e6cb7a142dff Mon Sep 17 00:00:00 2001
-From: Ben Walton <bwalton at opencsw.org>
-Date: Sun, 1 Jun 2014 19:55:24 +0200
-Subject: [PATCH] src/df.c: Prevent compiler warning by removing block
-
-gcc 4.9.0 thinks that v may be uninitialized due to the block around the options in a switch/case statement.
-
-Signed-off-by: Ben Walton <bwalton at opencsw.org>
----
- src/df.c | 98 +++++++++++++++++++++++++++++++---------------------------------
- 1 file changed, 48 insertions(+), 50 deletions(-)
-
-diff --git a/src/df.c b/src/df.c
-index 969670e..10541a8 100644
---- a/src/df.c
-+++ b/src/df.c
-@@ -967,56 +967,54 @@ get_dev (char const *disk, char const *mount_point, char const* file,
- 
-         case PCENT_FIELD:
-         case IPCENT_FIELD:
--          {
--            double pct = -1;
--            if (! known_value (v->used) || ! known_value (v->available))
--              ;
--            else if (!v->negate_used
--                     && v->used <= TYPE_MAXIMUM (uintmax_t) / 100
--                     && v->used + v->available != 0
--                     && (v->used + v->available < v->used)
--                     == v->negate_available)
--              {
--                uintmax_t u100 = v->used * 100;
--                uintmax_t nonroot_total = v->used + v->available;
--                pct = u100 / nonroot_total + (u100 % nonroot_total != 0);
--              }
--            else
--              {
--                /* The calculation cannot be done easily with integer
--                   arithmetic.  Fall back on floating point.  This can suffer
--                   from minor rounding errors, but doing it exactly requires
--                   multiple precision arithmetic, and it's not worth the
--                   aggravation.  */
--                double u = v->negate_used ? - (double) - v->used : v->used;
--                double a = v->negate_available
--                           ? - (double) - v->available : v->available;
--                double nonroot_total = u + a;
--                if (nonroot_total)
--                  {
--                    long int lipct = pct = u * 100 / nonroot_total;
--                    double ipct = lipct;
--
--                    /* Like 'pct = ceil (dpct);', but avoid ceil so that
--                       the math library needn't be linked.  */
--                    if (ipct - 1 < pct && pct <= ipct + 1)
--                      pct = ipct + (ipct < pct);
--                  }
--              }
--
--            if (0 <= pct)
--              {
--                if (asprintf (&cell, "%.0f%%", pct) == -1)
--                  cell = NULL;
--              }
--            else
--              cell = strdup ("-");
--
--            if (!cell)
--              xalloc_die ();
--
--            break;
--          }
-+	  double pct = -1;
-+	  if (! known_value (v->used) || ! known_value (v->available))
-+	    ;
-+	  else if (!v->negate_used
-+		   && v->used <= TYPE_MAXIMUM (uintmax_t) / 100
-+		   && v->used + v->available != 0
-+		   && (v->used + v->available < v->used)
-+		   == v->negate_available)
-+	    {
-+	      uintmax_t u100 = v->used * 100;
-+	      uintmax_t nonroot_total = v->used + v->available;
-+	      pct = u100 / nonroot_total + (u100 % nonroot_total != 0);
-+	    }
-+	  else
-+	    {
-+	      /* The calculation cannot be done easily with integer
-+		 arithmetic.  Fall back on floating point.  This can suffer
-+		 from minor rounding errors, but doing it exactly requires
-+		 multiple precision arithmetic, and it's not worth the
-+		 aggravation.  */
-+	      double u = v->negate_used ? - (double) - v->used : v->used;
-+	      double a = v->negate_available
-+		         ? - (double) - v->available : v->available;
-+	      double nonroot_total = u + a;
-+	      if (nonroot_total)
-+		{
-+		  long int lipct = pct = u * 100 / nonroot_total;
-+		  double ipct = lipct;
-+
-+		  /* Like 'pct = ceil (dpct);', but avoid ceil so that
-+		     the math library needn't be linked.  */
-+		  if (ipct - 1 < pct && pct <= ipct + 1)
-+		    pct = ipct + (ipct < pct);
-+		}
-+	    }
-+
-+	  if (0 <= pct)
-+	    {
-+	      if (asprintf (&cell, "%.0f%%", pct) == -1)
-+		cell = NULL;
-+	    }
-+	  else
-+	    cell = strdup ("-");
-+
-+	  if (!cell)
-+	    xalloc_die ();
-+
-+	  break;
- 
-         case FILE_FIELD:
-           cell = xstrdup (file);
--- 
-1.8.4.1
-

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list