]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix compiler warning from newer GCC (Issue #5533)
authorMichael R Sweet <michael.r.sweet@gmail.com>
Mon, 25 Feb 2019 16:58:34 +0000 (11:58 -0500)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Mon, 25 Feb 2019 16:58:34 +0000 (11:58 -0500)
CHANGES.md
ppdc/ppdc-array.cxx
ppdc/ppdc.h
ppdc/testcatalog.cxx
scheduler/cups-driverd.cxx

index 234dc5a9cdaeb211969134f81248bdfdc2498021..9aa1d5b2af799bacc6efe797013e37e28cebab03 100644 (file)
@@ -1,4 +1,4 @@
-CHANGES - 2.2.11 - 2019-02-21
+CHANGES - 2.2.11 - 2019-02-25
 =============================
 
 
@@ -27,6 +27,7 @@ Changes in CUPS v2.2.11
 - Added a USB quirks rule for Xerox printers (Issue #5523)
 - The scheduler's self-signed certificate did not include all of the alternate
   names for the server when using GNU TLS (Issue #5525)
+- Fixed a compiler warning with newer versions of GCC (Issue #5533)
 - Media size matching now uses a tolerance of 0.5mm (rdar://33822024)
 - The lpadmin command would hang with a bad PPD file (rdar://41495016)
 - Fixed a potential crash bug in cups-driverd (rdar://46625579)
index 2dd494490b387db42ad38fb63bf45476524dd2fc..acd1e222e02cc0c203f85569ba08d139ee302eb7 100644 (file)
@@ -1,7 +1,7 @@
 //
 // Array class for the CUPS PPD Compiler.
 //
-// Copyright 2007-2014 by Apple Inc.
+// Copyright 2007-2019 by Apple Inc.
 // Copyright 2002-2005 by Easy Software Products.
 //
 // These coded instructions, statements, and computer programs are the
@@ -64,7 +64,7 @@ ppdcArray::~ppdcArray()
 {
   PPDC_DELETE;
 
-  for (int i = 0; i < count; i ++)
+  for (size_t i = 0; i < count; i ++)
     data[i]->release();
 
   if (alloc)
@@ -134,7 +134,7 @@ ppdcArray::next()
 void
 ppdcArray::remove(ppdcShared *d)               // I - Data element
 {
-  int  i;                                      // Looping var
+  size_t       i;                              // Looping var
 
 
   for (i = 0; i < count; i ++)
index 6a69c6eb2466d4d61ec38871b92409dafa19cc1e..a5e1de953a56cfbf0c48e4e774658d4aa3b167bd 100644 (file)
@@ -1,7 +1,7 @@
 //
 // Definitions for the CUPS PPD Compiler.
 //
-// Copyright 2007-2009 by Apple Inc.
+// Copyright 2007-2019 by Apple Inc.
 // Copyright 2002-2007 by Easy Software Products.
 //
 // These coded instructions, statements, and computer programs are the
@@ -109,7 +109,7 @@ class ppdcArray                             //// Shared Array
 {
   public:
 
-  int          count,                  // Number of elements
+  size_t       count,                  // Number of elements
                alloc,                  // Allocated elements
                current;                // Current element
   ppdcShared   **data;                 // Elements
index 71cbc36305ce777c8692d9d395f83ae101845f48..5836010675196ef86586257071bad776b52c6b6e 100644 (file)
@@ -1,7 +1,7 @@
 //
 // Test program for message catalog class.
 //
-// Copyright 2008 by Apple Inc.
+// Copyright © 2008-2019 by Apple Inc.
 //
 // These coded instructions, statements, and computer programs are the
 // property of Apple Inc. and are protected by Federal copyright
@@ -38,7 +38,7 @@ main(int  argc,                               // I - Number of command-line arguments
   // Scan the command-line...
   catalog = new ppdcCatalog(NULL, argv[1]);
 
-  printf("%s: %d messages\n", argv[1], catalog->messages->count);
+  printf("%s: %u messages\n", argv[1], (unsigned)catalog->messages->count);
 
   for (m = (ppdcMessage *)catalog->messages->first();
        m;
index c13fab48beaa92fafd97ed4cef11143459271c1a..81c447ad8e44e132475e0b69e9fc1a65761f7cde 100644 (file)
@@ -5,8 +5,8 @@
  * created from driver information files, and dynamically generated PPD files
  * using driver helper programs.
  *
- * Copyright 2007-2018 by Apple Inc.
- * Copyright 1997-2007 by Easy Software Products.
+ * Copyright Â 2007-2019 by Apple Inc.
+ * Copyright Â 1997-2007 by Easy Software Products.
  *
  * These coded instructions, statements, and computer programs are the
  * property of Apple Inc. and are protected by Federal copyright
@@ -369,8 +369,7 @@ cat_drv(const char *name,           /* I - PPD name */
     ppdcCatalog        *catalog;               // Message catalog in .drv file
 
 
-    fprintf(stderr, "DEBUG2: [cups-driverd] %d locales defined in \"%s\"...\n",
-            src->po_files->count, filename);
+    fprintf(stderr, "DEBUG2: [cups-driverd] %u locales defined in \"%s\"...\n", (unsigned)src->po_files->count, filename);
 
     locales = new ppdcArray();
     for (catalog = (ppdcCatalog *)src->po_files->first();