From: Michael R Sweet Date: Mon, 25 Feb 2019 16:58:34 +0000 (-0500) Subject: Fix compiler warning from newer GCC (Issue #5533) X-Git-Tag: v2.2.11~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=17675b0d739db78df0119bc100fe5990e158adc6;p=thirdparty%2Fcups.git Fix compiler warning from newer GCC (Issue #5533) --- diff --git a/CHANGES.md b/CHANGES.md index 234dc5a9cd..9aa1d5b2af 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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) diff --git a/ppdc/ppdc-array.cxx b/ppdc/ppdc-array.cxx index 2dd494490b..acd1e222e0 100644 --- a/ppdc/ppdc-array.cxx +++ b/ppdc/ppdc-array.cxx @@ -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 ++) diff --git a/ppdc/ppdc.h b/ppdc/ppdc.h index 6a69c6eb24..a5e1de953a 100644 --- a/ppdc/ppdc.h +++ b/ppdc/ppdc.h @@ -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 diff --git a/ppdc/testcatalog.cxx b/ppdc/testcatalog.cxx index 71cbc36305..5836010675 100644 --- a/ppdc/testcatalog.cxx +++ b/ppdc/testcatalog.cxx @@ -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; diff --git a/scheduler/cups-driverd.cxx b/scheduler/cups-driverd.cxx index c13fab48be..81c447ad8e 100644 --- a/scheduler/cups-driverd.cxx +++ b/scheduler/cups-driverd.cxx @@ -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();