[cups.bugs] [LOW] STR #1245: fix for silencing misleading gcc

Alexander Stohr stohr at schwab-gft.de
Fri Aug 12 14:16:43 PDT 2005


[STR New]

Below text will silence a gcc warning about uninitialized vars
for cases where gcc does not yet get
that the given case value does have a range limit of zero to three.

-Alex.


diff -u -U 8 imagetops.c.orig imagetops.c               
--- imagetops.c.orig    2005-08-04 04:48:09.000000000 +0200
+++ imagetops.c 2005-08-12 16:17:47.000000000 +0200
@@ -754,16 +754,20 @@
          default :
              top = (PageRight + PageLeft + yprint * 72) / 2;
              break;
          case -1 :
              top = PageRight;
              break;
        }
        break;
+    default:
+       left = 0.0;
+       top = 0.0;
+       break;
   }
 
   fprintf(stderr, "DEBUG: left=%.2f, top=%.2f\n", left, top);
 
   for (page = 1; Copies > 0; Copies --)
     for (xpage = 0; xpage < xpages; xpage ++)
       for (ypage = 0; ypage < ypages; ypage ++, page ++)
       {

Link: http://www.cups.org/str.php?L1245
Version: 1.2-current





More information about the cups-devel mailing list