]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix some clang warnings.
authorMichael R Sweet <msweet@msweet.org>
Thu, 26 Mar 2026 18:51:59 +0000 (14:51 -0400)
committerMichael R Sweet <msweet@msweet.org>
Thu, 26 Mar 2026 18:52:07 +0000 (14:52 -0400)
21 files changed:
backend/lpd.c
backend/snmp.c
cups/backchannel.c
cups/clock.c
cups/jwt.c
cups/raster-interpret.c
cups/raster-stream.c
cups/rasterbench.c
cups/testarray.c
cups/testppd.c
cups/thread.c
filter/pstops.c
filter/rastertoepson.c
filter/rastertopwg.c
scheduler/cups-deviced.c
scheduler/printers.c
scheduler/testspeed.c
systemv/cupstestppd.c
tools/ippeveprinter.c
tools/ippeveps.c
xcode/CUPS.xcodeproj/project.pbxproj

index fe59911265afb383eede8d8e11bf2c7955f061c0..cc2a3b924e28b541e6b85b09fb7eb2bdda0e5afe 100644 (file)
@@ -1109,7 +1109,7 @@ lpd_queue(const char      *hostname,      /* I - Host to connect to */
        {
          _cupsLangPrintFilter(stderr, "INFO",
                               _("Spooling job, %.0f%% complete."),
-                              100.0 * tbytes / filestats.st_size);
+                              100.0 * (double)tbytes / (double)filestats.st_size);
 
          if (lpd_write(fd, buffer, (size_t)nbytes) < nbytes)
          {
index 1e7f0005b0c6ea3957476de74916b5bb303f55dd..4a17952ca0cd363715f80a28b7da3bb8aa35bacf 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * SNMP discovery backend for CUPS.
  *
- * Copyright © 2020-2024 by OpenPrinting.
+ * Copyright © 2020-2026 by OpenPrinting.
  * Copyright © 2007-2014 by Apple Inc.
  * Copyright © 2006-2007 by Easy Software Products, all rights reserved.
  *
@@ -1142,8 +1142,8 @@ run_time(void)
 
   gettimeofday(&curtime, NULL);
 
-  return (curtime.tv_sec - StartTime.tv_sec +
-          0.000001 * (curtime.tv_usec - StartTime.tv_usec));
+  return ((double)(curtime.tv_sec - StartTime.tv_sec) +
+          0.000001 * (double)(curtime.tv_usec - StartTime.tv_usec));
 }
 
 
index 05c96881843b83ae5b62592607f01651455b27b5..7eeea0bb2b7b8e6e8981339220ce5ca5ca8c674c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Backchannel functions for CUPS.
  *
- * Copyright © 2020-2025 by OpenPrinting.
+ * Copyright © 2020-2026 by OpenPrinting.
  * Copyright © 2007-2014 by Apple Inc.
  * Copyright © 1997-2007 by Easy Software Products.
  *
@@ -170,8 +170,8 @@ cups_setup(fd_set         *set,             /* I - Set for select() */
            struct timeval *tval,       /* I - Timer value */
           double         timeout)      /* I - Timeout in seconds */
 {
-  tval->tv_sec = (time_t)timeout;
-  tval->tv_usec = (suseconds_t)(1000000.0 * (timeout - tval->tv_sec));
+  tval->tv_sec  = (time_t)timeout;
+  tval->tv_usec = (suseconds_t)(1000000.0 * (timeout - (double)tval->tv_sec));
 
   FD_ZERO(set);
   FD_SET(3, set);
index 4981d4751bdf9300c8852c39990db728dc4d1258..d7e83af4bc944e314fcee6a3673219df69bb1194 100644 (file)
@@ -1,7 +1,7 @@
 //
 // Monotonic clock API for CUPS.
 //
-// Copyright © 2024-2025 by OpenPrinting.
+// Copyright © 2024-2026 by OpenPrinting.
 //
 // Licensed under Apache License v2.0.  See the file "LICENSE" for more
 // information.
@@ -89,7 +89,7 @@ cupsGetClock(void)
     }
 
     // Convert clock value to seconds...
-    if ((secs = curclock.tv_sec - cups_first_clock.tv_sec + 0.000000001 * (curclock.tv_nsec - cups_first_clock.tv_nsec)) < 0.0)
+    if ((secs = (double)(curclock.tv_sec - cups_first_clock.tv_sec) + 0.000000001 * (double)(curclock.tv_nsec - cups_first_clock.tv_nsec)) < 0.0)
       secs = 0.0;
   }
   else
@@ -105,7 +105,7 @@ cupsGetClock(void)
     }
 
     // Convert time value to seconds...
-    if ((secs = curtime.tv_sec - cups_first_time.tv_sec + 0.000001 * (curtime.tv_usec - cups_first_time.tv_usec)) < 0.0)
+    if ((secs = (double)(curtime.tv_sec - cups_first_time.tv_sec) + 0.000001 * (double)(curtime.tv_usec - cups_first_time.tv_usec)) < 0.0)
       secs = 0.0;
   }
 #endif // _WIN32
index ec390f134e374d158c95598d8748464fa5cb1882..b39447a324a2a0c6dd65b9b07f7ed63c82692b8a 100644 (file)
@@ -780,7 +780,7 @@ cupsJWTLoadCredentials(
                qi[1024],               // First CRT coefficient
                x[1024],                // X coordinate
                y[1024];                // Y coordinate
-  const char   *crv;                   // Curve value
+  const char   *crv = NULL;            // Curve value
 
 
 
index 7cc7b9b73c6b5ba11a0af5d365f0126caf9011a6..69d7858e864f2852807e4e4f5904f59bc93d8e07 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * PPD command interpreter for CUPS.
  *
- * Copyright © 2020-2025 by OpenPrinting.
+ * Copyright © 2020-2026 by OpenPrinting.
  * Copyright © 2007-2018 by Apple Inc.
  * Copyright © 1993-2007 by Easy Software Products.
  *
@@ -386,9 +386,9 @@ _cupsRasterInterpretPPD(
   */
 
   h->cupsWidth  = (unsigned)((right - left) * h->cupsBorderlessScalingFactor *
-                        h->HWResolution[0] / 72.0f + 0.5f);
+                        (double)h->HWResolution[0] / 72.0f + 0.5f);
   h->cupsHeight = (unsigned)((top - bottom) * h->cupsBorderlessScalingFactor *
-                        h->HWResolution[1] / 72.0f + 0.5f);
+                        (double)h->HWResolution[1] / 72.0f + 0.5f);
 
   switch (h->cupsColorSpace)
   {
@@ -1312,7 +1312,7 @@ scan_ps(_cups_ps_stack_t *st,             /* I  - Stack */
          if (base < 2 || base > 36)
            return (NULL);
 
-         obj.value.number = strtol(cur + 1, &cur, base);
+         obj.value.number = (double)strtol(cur + 1, &cur, base);
          break;
        }
        else if (strchr(".Ee()<>[]{}/%", *cur) || isspace(*cur & 255))
index 96500c754edf262c8c7ae133e13ca278fb00d68a..04a9b19c765d6d30b5cd0f6b50748b31dfd05fdd 100644 (file)
@@ -345,8 +345,8 @@ cupsRasterInitHeader(
   h->PageSize[1] = (unsigned)(72 * media->length / 2540);
 
   // This never gets written but is needed for some applications
-  h->cupsPageSize[0] = 72.0f * media->width / 2540.0f;
-  h->cupsPageSize[1] = 72.0f * media->length / 2540.0f;
+  h->cupsPageSize[0] = 72.0f * (float)media->width / 2540.0f;
+  h->cupsPageSize[1] = 72.0f * (float)media->length / 2540.0f;
 
   h->ImagingBoundingBox[0] = (unsigned)(72 * media->left / 2540);
   h->ImagingBoundingBox[1] = (unsigned)(72 * media->bottom / 2540);
@@ -568,8 +568,8 @@ _cupsRasterInitPWGHeader(
   h->PageSize[1] = (unsigned)(72 * media->length / 2540);
 
   // This never gets written but is needed for some applications
-  h->cupsPageSize[0] = 72.0f * media->width / 2540.0f;
-  h->cupsPageSize[1] = 72.0f * media->length / 2540.0f;
+  h->cupsPageSize[0] = 72.0f * (float)media->width / 2540.0f;
+  h->cupsPageSize[1] = 72.0f * (float)media->length / 2540.0f;
 
   h->ImagingBoundingBox[2] = h->PageSize[0];
   h->ImagingBoundingBox[3] = h->PageSize[1];
@@ -1322,10 +1322,10 @@ _cupsRasterWriteHeader(
     fh.cupsInteger[0]        = htonl(r->header.cupsInteger[0]);
     fh.cupsInteger[1]        = htonl(r->header.cupsInteger[1]);
     fh.cupsInteger[2]        = htonl(r->header.cupsInteger[2]);
-    fh.cupsInteger[3]        = htonl((unsigned)(r->header.cupsImagingBBox[0] * r->header.HWResolution[0] / 72.0));
-    fh.cupsInteger[4]        = htonl((unsigned)(r->header.cupsImagingBBox[1] * r->header.HWResolution[1] / 72.0));
-    fh.cupsInteger[5]        = htonl((unsigned)(r->header.cupsImagingBBox[2] * r->header.HWResolution[0] / 72.0));
-    fh.cupsInteger[6]        = htonl((unsigned)(r->header.cupsImagingBBox[3] * r->header.HWResolution[1] / 72.0));
+    fh.cupsInteger[3]        = htonl((unsigned)(r->header.cupsImagingBBox[0] * (double)r->header.HWResolution[0] / 72.0));
+    fh.cupsInteger[4]        = htonl((unsigned)(r->header.cupsImagingBBox[1] * (double)r->header.HWResolution[1] / 72.0));
+    fh.cupsInteger[5]        = htonl((unsigned)(r->header.cupsImagingBBox[2] * (double)r->header.HWResolution[0] / 72.0));
+    fh.cupsInteger[6]        = htonl((unsigned)(r->header.cupsImagingBBox[3] * (double)r->header.HWResolution[1] / 72.0));
     fh.cupsInteger[7]        = htonl(0xffffff);
 
     return (cups_raster_io(r, (unsigned char *)&fh, sizeof(fh)) == sizeof(fh));
index 22dc735bc16bd4e3a7de3bcf30ea6289149032e5..69814c1fcde9acb09151c0baab1337b6dbc80943 100644 (file)
@@ -1,11 +1,12 @@
 /*
  * Raster benchmark program for CUPS.
  *
- * Copyright © 2020-2024 by OpenPrinting.
- * Copyright 2007-2016 by Apple Inc.
- * Copyright 1997-2006 by Easy Software Products.
+ * Copyright © 2020-2026 by OpenPrinting.
+ * Copyright © 2007-2016 by Apple Inc.
+ * Copyright © 1997-2006 by Easy Software Products.
  *
- * Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
+ * Licensed under Apache License v2.0.  See the file "LICENSE" for more
+ * information.
  */
 
 /*
@@ -157,7 +158,7 @@ get_time(void)
 
 
   gettimeofday(&curtime, NULL);
-  return (curtime.tv_sec + 0.000001 * curtime.tv_usec);
+  return ((double)curtime.tv_sec + 0.000001 * (double)curtime.tv_usec);
 }
 
 
index d5270b2769c8a3f3bc9de3293d8750eb14fa0bc2..76f5fe4c3d094d380a7b899c3e620579e88b5a43 100644 (file)
@@ -1,7 +1,7 @@
 //
 // Array test program for CUPS.
 //
-// Copyright © 2020-2024 by OpenPrinting.
+// Copyright © 2020-2026 by OpenPrinting.
 // Copyright © 2007-2014 by Apple Inc.
 // Copyright © 1997-2006 by Easy Software Products.
 //
@@ -480,7 +480,7 @@ get_seconds(void)
 
 
   gettimeofday(&curtime, NULL);
-  return (curtime.tv_sec + 0.000001 * curtime.tv_usec);
+  return ((double)curtime.tv_sec + 0.000001 * (double)curtime.tv_usec);
 }
 #endif // _WIN32
 
index 9da66cb748b223acd505e0997f650d183c0009e7..32804c63dbdc5ea0778096eb4e8d0ed7c8f05bc6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * PPD test program for CUPS.
  *
- * Copyright © 2020-2025 by OpenPrinting.
+ * Copyright © 2020-2026 by OpenPrinting.
  * Copyright © 2007-2018 by Apple Inc.
  * Copyright © 1997-2006 by Easy Software Products.
  *
@@ -1204,7 +1204,6 @@ main(int  argc,                           /* I - Number of command-line arguments */
       ppd_option_t     *option;        /* Option */
       ppd_coption_t    *coption;       /* Custom option */
       ppd_cparam_t     *cparam;        /* Custom parameter */
-      ppd_size_t       *size;          /* Default paper size */
       ppd_const_t      *c;             /* UIConstraints */
       char             lang[255],      /* LANG environment variable */
                        lc_all[255],    /* LC_ALL environment variable */
index 497900ba66d718412eab833a9a80194c126166de..dbb105d0e8334d983b3098a23d81853874a9515b 100644 (file)
@@ -1,7 +1,7 @@
 //
 // Threading primitives for CUPS.
 //
-// Copyright © 2020-2024 by OpenPrinting.
+// Copyright © 2020-2026 by OpenPrinting.
 // Copyright © 2009-2018 by Apple Inc.
 //
 // Licensed under Apache License v2.0.  See the file "LICENSE" for more
@@ -459,7 +459,7 @@ cupsCondWait(cups_cond_t  *cond,    // I - Condition
     clock_gettime(CLOCK_REALTIME, &abstime);
 
     abstime.tv_sec  += (long)timeout;
-    abstime.tv_nsec += (long)(1000000000 * (timeout - (long)timeout));
+    abstime.tv_nsec += (long)(1000000000.0 * (timeout - (double)abstime.tv_sec));
 
     while (abstime.tv_nsec >= 1000000000)
     {
index dfc5557547adfe022fab1eddabc8fe9a39b98e9f..987ecc9c800089aa4c380ea194a15fee9c40d859 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * PostScript filter for CUPS.
  *
- * Copyright © 2020-2024 by OpenPrinting.
+ * Copyright © 2020-2026 by OpenPrinting.
  * Copyright © 2007-2018 by Apple Inc.
  * Copyright © 1993-2007 by Easy Software Products.
  *
@@ -1359,24 +1359,24 @@ copy_page(cups_file_t  *fp,             /* I - File to read from */
         switch (Orientation)
        {
          case 1 : /* Landscape */
-             bounding_box[0] = (int)(PageLength - temp_bbox[3]);
+             bounding_box[0] = (int)PageLength - temp_bbox[3];
              bounding_box[1] = temp_bbox[0];
-             bounding_box[2] = (int)(PageLength - temp_bbox[1]);
+             bounding_box[2] = (int)PageLength - temp_bbox[1];
              bounding_box[3] = temp_bbox[2];
               break;
 
          case 2 : /* Reverse Portrait */
-             bounding_box[0] = (int)(PageWidth - temp_bbox[2]);
-             bounding_box[1] = (int)(PageLength - temp_bbox[3]);
-             bounding_box[2] = (int)(PageWidth - temp_bbox[0]);
-             bounding_box[3] = (int)(PageLength - temp_bbox[1]);
+             bounding_box[0] = (int)PageWidth - temp_bbox[2];
+             bounding_box[1] = (int)PageLength - temp_bbox[3];
+             bounding_box[2] = (int)PageWidth - temp_bbox[0];
+             bounding_box[3] = (int)PageLength - temp_bbox[1];
               break;
 
          case 3 : /* Reverse Landscape */
              bounding_box[0] = temp_bbox[1];
-             bounding_box[1] = (int)(PageWidth - temp_bbox[2]);
+             bounding_box[1] = (int)PageWidth - temp_bbox[2];
              bounding_box[2] = temp_bbox[3];
-             bounding_box[3] = (int)(PageWidth - temp_bbox[0]);
+             bounding_box[3] = (int)PageWidth - temp_bbox[0];
               break;
        }
 
index 9de398693556314b1d500e0eca656447497f86d1..ea092f612f544e41ca6d097fa7dc03adb341e33a 100644 (file)
@@ -1,9 +1,9 @@
 /*
  * EPSON ESC/P and ESC/P2 filter for CUPS.
  *
- * Copyright © 2020-2024 by OpenPrinting.
- * Copyright 2007-2018 by Apple Inc.
- * Copyright 1993-2007 by Easy Software Products.
+ * Copyright © 2020-2026 by OpenPrinting.
+ * Copyright © 2007-2018 by Apple Inc.
+ * Copyright © 1993-2007 by Easy Software Products.
  *
  * Licensed under Apache License v2.0.  See the file "LICENSE" for more
  * information.
@@ -238,7 +238,7 @@ StartPage(
        putchar(n >> 8);
 
         if (ppd)
-         t = (int)((ppd->sizes[1].length - ppd->sizes[1].top) * header->HWResolution[1] / 72.0);
+         t = (int)((ppd->sizes[1].length - ppd->sizes[1].top) * (double)header->HWResolution[1] / 72.0);
         else
          t = 0;
 
index 6ef0975d257b2c11a8d9370fb1e30c3a35ba8b7c..b5fa2ad96b1239e2e7dc710809f6770f25cfbac0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * CUPS raster to PWG raster format filter for CUPS.
  *
- * Copyright © 2020-2025 by OpenPrinting.
+ * Copyright © 2020-2026 by OpenPrinting.
  * Copyright © 2011, 2014-2017 Apple Inc.
  *
  * Licensed under Apache License v2.0.  See the file "LICENSE" for more
@@ -118,16 +118,16 @@ main(int  argc,                           /* I - Number of command-line args */
 
     fprintf(stderr, "PAGE: %d %d\n", page, inheader.NumCopies);
 
-    page_width  = (unsigned)(inheader.cupsPageSize[0] * inheader.HWResolution[0] / 72.0);
+    page_width  = (unsigned)(inheader.cupsPageSize[0] * (double)inheader.HWResolution[0] / 72.0);
     if (page_width < inheader.cupsWidth &&
        page_width >= inheader.cupsWidth - 1)
       page_width = (unsigned)inheader.cupsWidth;
-    page_height = (unsigned)(inheader.cupsPageSize[1] * inheader.HWResolution[1] / 72.0);
+    page_height = (unsigned)(inheader.cupsPageSize[1] * (double)inheader.HWResolution[1] / 72.0);
     if (page_height < inheader.cupsHeight &&
        page_height >= inheader.cupsHeight - 1)
       page_height = (unsigned)inheader.cupsHeight;
-    page_left   = (unsigned)(inheader.cupsImagingBBox[0] * inheader.HWResolution[0] / 72.0);
-    page_bottom = (unsigned)(inheader.cupsImagingBBox[1] * inheader.HWResolution[1] / 72.0);
+    page_left   = (unsigned)(inheader.cupsImagingBBox[0] * (double)inheader.HWResolution[0] / 72.0);
+    page_bottom = (unsigned)(inheader.cupsImagingBBox[1] * (double)inheader.HWResolution[1] / 72.0);
     tmp        = (int)(page_height - page_bottom - inheader.cupsHeight);
     if (tmp < 0 && tmp >= -1) /* Rounding error */
       page_top = 0;
index 2960d65ff26040814fe6512483122986f30c5bfb..b28efb2a7ecf4fe17b333b38810868d13a0e6c67 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Device scanning mini-daemon for CUPS.
  *
- * Copyright © 2020-2024 by OpenPrinting.
+ * Copyright © 2020-2026 by OpenPrinting.
  * Copyright © 2007-2018 by Apple Inc.
  * Copyright © 1997-2006 by Easy Software Products.
  *
@@ -451,7 +451,7 @@ get_current_time(void)
 
   gettimeofday(&curtime, NULL);
 
-  return (curtime.tv_sec + 0.000001 * curtime.tv_usec);
+  return ((double)curtime.tv_sec + 0.000001 * (double)curtime.tv_usec);
 }
 
 
index 16f16f99478734f0fa0a5230dec926d6b9032a14..93310f26bd82fa77201ebb6eb8d1b3abb9f2bb74 100644 (file)
@@ -3507,7 +3507,7 @@ add_ppd_defaults_to_ipp(
       for (ipp_ptr = ipp_name; *ipp_ptr; ipp_ptr ++)
       {
         if (isupper(*ipp_ptr & 255))
-          *ipp_ptr = tolower(*ipp_ptr & 255);
+          *ipp_ptr = (char)tolower(*ipp_ptr & 255);
         else if (*ipp_ptr == '_')
           *ipp_ptr = '-';
       }
index 2b153f23d7e37ea6c7b7daedb15341a099e34872..abe12452fce75625afaf69722ca7e19c5b3f2a3b 100644 (file)
@@ -1,11 +1,12 @@
 /*
  * Scheduler speed test for CUPS.
  *
- * Copyright © 2020-2024 by OpenPrinting.
- * Copyright 2007-2014 by Apple Inc.
- * Copyright 1997-2005 by Easy Software Products.
+ * Copyright © 2020-2026 by OpenPrinting.
+ * Copyright © 2007-2014 by Apple Inc.
+ * Copyright © 1997-2005 by Easy Software Products.
  *
- * Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
+ * Licensed under Apache License v2.0.  See the file "LICENSE" for more
+ * information.
  */
 
 /*
@@ -217,7 +218,7 @@ main(int  argc,                             /* I - Number of command-line arguments */
   if (good_children > 0)
   {
     end     = time(NULL);
-    elapsed = end - start;
+    elapsed = (double)(end - start);
     i       = good_children * requests;
 
     printf("testspeed: %dx%d=%d requests in %.1fs (%.3fs/r, %.1fr/s)\n",
@@ -321,8 +322,8 @@ do_test(const char        *server,  /* I - Server to use */
 
     gettimeofday(&end, NULL);
 
-    reqtime = (end.tv_sec - start.tv_sec) +
-              0.000001 * (end.tv_usec - start.tv_usec);
+    reqtime = (double)(end.tv_sec - start.tv_sec) +
+              0.000001 * (double)(end.tv_usec - start.tv_usec);
     elapsed += reqtime;
 
     switch (cupsGetError())
index 1e46445b5481d8844b7917b381ba0fa2e5fa5bdb..df16a1a455a6084ee40c6ea40db3eaabd394dfc4 100644 (file)
@@ -3,7 +3,7 @@
  *
  * THIS PROGRAM IS DEPRECATED AND WILL BE REMOVED IN A FUTURE VERSION OF CUPS.
  *
- * Copyright © 2020-2024 by OpenPrinting.
+ * Copyright © 2020-2026 by OpenPrinting.
  * Copyright © 2007-2018 by Apple Inc.
  * Copyright © 1997-2007 by Easy Software Products, all rights reserved.
  *
@@ -1358,7 +1358,7 @@ main(int  argc,                           /* I - Number of command-line args */
           _cupsLangPrintf(stdout,
                          _("        WARN    Obsolete PPD version %.1f.\n"
                            "                REF: Page 42, section 5.2."),
-                         0.1f * ppdversion);
+                         0.1 * (double)ppdversion);
        }
 
         if (!ppd->lang_encoding && ppdversion < 41)
@@ -3190,8 +3190,8 @@ check_sizes(ppd_file_t *ppd,              /* I - PPD file */
       * length...
       */
 
-      if (fabs(width - size->width) >= 1.0 ||
-          fabs(length - size->length) >= 1.0)
+      if (fabs((double)width - size->width) >= 1.0 ||
+          fabs((double)length - size->length) >= 1.0)
       {
        if (!warn && !errors && !verbose)
          _cupsLangPuts(stdout, _(" FAIL"));
index 82ece6fdc184c6ab67dd69d185d2ceaed8cdaf46..eae83e30f95c837dbfec2bc5d273e976625a226a 100644 (file)
@@ -6557,7 +6557,7 @@ process_job(ippeve_job_t *job)            // I - Job
     // Report the total processing time...
     gettimeofday(&end, NULL);
 
-    fprintf(stderr, "[Job %d] Processing time was %.3f seconds.\n", job->id, end.tv_sec - start.tv_sec + 0.000001 * (end.tv_usec - start.tv_usec));
+    fprintf(stderr, "[Job %d] Processing time was %.3f seconds.\n", job->id, (double)(end.tv_sec - start.tv_sec) + 0.000001 * (double)(end.tv_usec - start.tv_usec));
   }
   else
   {
index 9822696c6ea66ae6754f8692ef7c699f5b8bffa5..1584c2c28053460c7b758589712e82a2bb4ec203 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Generic Adobe PostScript printer command for ippeveprinter/CUPS.
  *
- * Copyright © 2020-2024 by OpenPrinting.
+ * Copyright © 2020-2026 by OpenPrinting.
  * Copyright © 2019 by Apple Inc.
  *
  * Licensed under Apache License v2.0.  See the file "LICENSE" for more
@@ -539,7 +539,7 @@ jpeg_to_ps(const char    *filename, /* I - Filename */
   int          width = 0,              /* Width */
                height = 0,             /* Height */
                depth = 0;              /* Number of colors */
-       ssize_t         length;                 /* Length of marker */
+  ssize_t      length;                 /* Length of marker */
   unsigned char        buffer[65536],          /* Copy buffer */
                *bufptr,                /* Pointer info buffer */
                *bufend;                /* End of buffer */
@@ -718,15 +718,15 @@ jpeg_to_ps(const char    *filename,       /* I - Filename */
   fprintf(stderr, "DEBUG: page_left=%.2f, page_top=%.2f, page_width=%.2f, page_height=%.2f\n", page_left, page_top, page_width, page_height);
 
   /* TODO: Support orientation/rotation, different print-scaling modes */
-  x_factor = page_width / width;
-  y_factor = page_height / height;
+  x_factor = page_width / (float)width;
+  y_factor = page_height / (float)height;
 
-  if (x_factor > y_factor && (height * x_factor) <= page_height)
+  if (x_factor > y_factor && ((float)height * x_factor) <= page_height)
     page_scaling = x_factor;
   else
     page_scaling = y_factor;
 
-  fprintf(stderr, "DEBUG: Scaled dimensions are %.2fx%.2f\n", width * page_scaling, height * page_scaling);
+  fprintf(stderr, "DEBUG: Scaled dimensions are %.2fx%.2f\n", (float)width * page_scaling, (float)height * page_scaling);
 
  /*
   * Write pages...
@@ -754,7 +754,7 @@ jpeg_to_ps(const char    *filename, /* I - Filename */
       decode = "0 1 0 1 0 1 0 1";
     }
 
-    printf("gsave %.3f %.3f translate %.3f %.3f scale\n", page_left + 0.5f * (page_width - width * page_scaling), page_top - 0.5f * (page_height - height * page_scaling), page_scaling, page_scaling);
+    printf("gsave %.3f %.3f translate %.3f %.3f scale\n", page_left + 0.5f * (page_width - (float)width * page_scaling), page_top - 0.5f * (page_height - (float)height * page_scaling), page_scaling, page_scaling);
     printf("<</ImageType 1/Width %d/Height %d/BitsPerComponent 8/ImageMatrix[1 0 0 -1 0 1]/Decode[%s]/DataSource currentfile/ASCII85Decode filter/DCTDecode filter/Interpolate true>>image\n", width, height, decode);
 
     if (fd > 0)
@@ -1100,7 +1100,7 @@ raster_to_ps(const char *filename)        /* I - Filename */
     dsc_page(page);
 
     puts("gsave");
-    printf("%.6f %.6f scale\n", 72.0f / header.HWResolution[0], 72.0f / header.HWResolution[1]);
+    printf("%.6f %.6f scale\n", 72.0 / (double)header.HWResolution[0], 72.0 / (double)header.HWResolution[1]);
 
     switch (header.cupsColorSpace)
     {
index e3bfcb257a4d3f90334a04c365915643a6c5da91..9e6d2e33d89456f4689b98743498e9e02c87b4e1 100644 (file)
@@ -23,7 +23,6 @@
                                726AD704135E8AA1002C930D /* PBXTargetDependency */,
                                2767FC5419267469000F61D3 /* PBXTargetDependency */,
                                729181C12011560E005E7560 /* PBXTargetDependency */,
-                               271286DE1CC13EF400E517C7 /* PBXTargetDependency */,
                                2712849B1CC11FA500E517C7 /* PBXTargetDependency */,
                                2712849D1CC11FA500E517C7 /* PBXTargetDependency */,
                                2712849F1CC11FA500E517C7 /* PBXTargetDependency */,
                274FF6971333B1C400317ECB /* encode.c in Sources */ = {isa = PBXBuildFile; fileRef = 72220ED6133305BB00FCA411 /* encode.c */; };
                274FF6981333B1C400317ECB /* file.c in Sources */ = {isa = PBXBuildFile; fileRef = 72220ED8133305BB00FCA411 /* file.c */; };
                274FF6991333B1C400317ECB /* getdevices.c in Sources */ = {isa = PBXBuildFile; fileRef = 72220EDA133305BB00FCA411 /* getdevices.c */; };
-               274FF69A1333B1C400317ECB /* getifaddrs.c in Sources */ = {isa = PBXBuildFile; fileRef = 72220EDB133305BB00FCA411 /* getifaddrs.c */; };
                274FF69B1333B1C400317ECB /* getputfile.c in Sources */ = {isa = PBXBuildFile; fileRef = 72220EDC133305BB00FCA411 /* getputfile.c */; };
                274FF69C1333B1C400317ECB /* globals.c in Sources */ = {isa = PBXBuildFile; fileRef = 72220EDD133305BB00FCA411 /* globals.c */; };
                274FF69D1333B1C400317ECB /* http-addr.c in Sources */ = {isa = PBXBuildFile; fileRef = 72220EDE133305BB00FCA411 /* http-addr.c */; };
                27865DCB2C8FC051003D5606 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2767FC5D1926750C000F61D3 /* Security.framework */; };
                27865DCC2C8FC051003D5606 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2767FC5E1926750C000F61D3 /* SystemConfiguration.framework */; };
                27865DCD2C8FC051003D5606 /* libcups_static.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 72A4332F155844CF002E172D /* libcups_static.a */; };
-               27865DCE2C8FC051003D5606 /* libcrypto.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 275125DF2AB7480D001F69F2 /* libcrypto.a */; };
-               27865DCF2C8FC051003D5606 /* libssl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 275125E02AB7480D001F69F2 /* libssl.a */; };
-               27865DD02C8FC051003D5606 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2767FC591926750C000F61D3 /* CoreFoundation.framework */; };
-               27865DD12C8FC051003D5606 /* libiconv.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 2767FC5A1926750C000F61D3 /* libiconv.dylib */; };
-               27865DD22C8FC051003D5606 /* libresolv.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 2767FC5B1926750C000F61D3 /* libresolv.dylib */; };
-               27865DD32C8FC051003D5606 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 2767FC5C1926750C000F61D3 /* libz.dylib */; };
-               27865DD42C8FC051003D5606 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2767FC5D1926750C000F61D3 /* Security.framework */; };
-               27865DD52C8FC051003D5606 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2767FC5E1926750C000F61D3 /* SystemConfiguration.framework */; };
-               27865DD62C8FC051003D5606 /* libcups_static.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 72A4332F155844CF002E172D /* libcups_static.a */; };
                27865DD72C8FC051003D5606 /* libcrypto.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 275125DF2AB7480D001F69F2 /* libcrypto.a */; };
                27865DD82C8FC051003D5606 /* libssl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 275125E02AB7480D001F69F2 /* libssl.a */; };
                27865DD92C8FC051003D5606 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2767FC591926750C000F61D3 /* CoreFoundation.framework */; };
                72220F12133305BB00FCA411 /* file.c in Sources */ = {isa = PBXBuildFile; fileRef = 72220ED8133305BB00FCA411 /* file.c */; };
                72220F13133305BB00FCA411 /* file.h in Headers */ = {isa = PBXBuildFile; fileRef = 72220ED9133305BB00FCA411 /* file.h */; settings = {ATTRIBUTES = (Public, ); }; };
                72220F14133305BB00FCA411 /* getdevices.c in Sources */ = {isa = PBXBuildFile; fileRef = 72220EDA133305BB00FCA411 /* getdevices.c */; };
-               72220F15133305BB00FCA411 /* getifaddrs.c in Sources */ = {isa = PBXBuildFile; fileRef = 72220EDB133305BB00FCA411 /* getifaddrs.c */; };
                72220F16133305BB00FCA411 /* getputfile.c in Sources */ = {isa = PBXBuildFile; fileRef = 72220EDC133305BB00FCA411 /* getputfile.c */; };
                72220F17133305BB00FCA411 /* globals.c in Sources */ = {isa = PBXBuildFile; fileRef = 72220EDD133305BB00FCA411 /* globals.c */; };
                72220F18133305BB00FCA411 /* http-addr.c in Sources */ = {isa = PBXBuildFile; fileRef = 72220EDE133305BB00FCA411 /* http-addr.c */; };
                        remoteGlobalIDString = 274FF6891333B1C400317ECB;
                        remoteInfo = libcups_static;
                };
-               271286AB1CC13DFF00E517C7 /* PBXContainerItemProxy */ = {
-                       isa = PBXContainerItemProxy;
-                       containerPortal = 72BF96371333042100B1EAD7 /* Project object */;
-                       proxyType = 1;
-                       remoteGlobalIDString = 274FF6891333B1C400317ECB;
-                       remoteInfo = libcups_static;
-               };
                271286BC1CC13E2100E517C7 /* PBXContainerItemProxy */ = {
                        isa = PBXContainerItemProxy;
                        containerPortal = 72BF96371333042100B1EAD7 /* Project object */;
                        remoteGlobalIDString = 72220EAD1333047D00FCA411;
                        remoteInfo = libcups;
                };
-               271286DD1CC13EF400E517C7 /* PBXContainerItemProxy */ = {
-                       isa = PBXContainerItemProxy;
-                       containerPortal = 72BF96371333042100B1EAD7 /* Project object */;
-                       proxyType = 1;
-                       remoteGlobalIDString = 271286A91CC13DFF00E517C7;
-                       remoteInfo = strings2po;
-               };
                271286DF1CC13EF400E517C7 /* PBXContainerItemProxy */ = {
                        isa = PBXContainerItemProxy;
                        containerPortal = 72BF96371333042100B1EAD7 /* Project object */;
                        );
                        runOnlyForDeploymentPostprocessing = 1;
                };
-               271286B41CC13DFF00E517C7 /* CopyFiles */ = {
-                       isa = PBXCopyFilesBuildPhase;
-                       buildActionMask = 2147483647;
-                       dstPath = /usr/share/man/man1/;
-                       dstSubfolderSpec = 0;
-                       files = (
-                       );
-                       runOnlyForDeploymentPostprocessing = 1;
-               };
                271286C51CC13E2100E517C7 /* CopyFiles */ = {
                        isa = PBXCopyFilesBuildPhase;
                        buildActionMask = 2147483647;
                271286831CC13D9600E517C7 /* checkpo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = checkpo.c; path = ../locale/checkpo.c; sourceTree = "<group>"; };
                271286841CC13D9600E517C7 /* cups.pot */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = cups.pot; path = ../locale/cups.pot; sourceTree = "<group>"; };
                271286961CC13DC000E517C7 /* checkpo */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = checkpo; sourceTree = BUILT_PRODUCTS_DIR; };
-               271286B81CC13DFF00E517C7 /* strings2po */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = strings2po; sourceTree = BUILT_PRODUCTS_DIR; };
                271286C91CC13E2100E517C7 /* bcp */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = bcp; sourceTree = BUILT_PRODUCTS_DIR; };
                271286D91CC13E5B00E517C7 /* tbcp */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = tbcp; sourceTree = BUILT_PRODUCTS_DIR; };
                271286F31CC13F2000E517C7 /* mailto */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = mailto; sourceTree = BUILT_PRODUCTS_DIR; };
                72220ED8133305BB00FCA411 /* file.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = file.c; path = ../cups/file.c; sourceTree = "<group>"; };
                72220ED9133305BB00FCA411 /* file.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = file.h; path = ../cups/file.h; sourceTree = "<group>"; };
                72220EDA133305BB00FCA411 /* getdevices.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = getdevices.c; path = ../cups/getdevices.c; sourceTree = "<group>"; };
-               72220EDB133305BB00FCA411 /* getifaddrs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = getifaddrs.c; path = ../cups/getifaddrs.c; sourceTree = "<group>"; };
                72220EDC133305BB00FCA411 /* getputfile.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = getputfile.c; path = ../cups/getputfile.c; sourceTree = "<group>"; };
                72220EDD133305BB00FCA411 /* globals.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = globals.c; path = ../cups/globals.c; sourceTree = "<group>"; };
                72220EDE133305BB00FCA411 /* http-addr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "http-addr.c"; path = "../cups/http-addr.c"; sourceTree = "<group>"; };
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
-               271286AE1CC13DFF00E517C7 /* Frameworks */ = {
-                       isa = PBXFrameworksBuildPhase;
-                       buildActionMask = 2147483647;
-                       files = (
-                               27865DCE2C8FC051003D5606 /* libcrypto.a in Frameworks */,
-                               27865DCF2C8FC051003D5606 /* libssl.a in Frameworks */,
-                               27865DD02C8FC051003D5606 /* CoreFoundation.framework in Frameworks */,
-                               27865DD12C8FC051003D5606 /* libiconv.dylib in Frameworks */,
-                               27865DD22C8FC051003D5606 /* libresolv.dylib in Frameworks */,
-                               27865DD32C8FC051003D5606 /* libz.dylib in Frameworks */,
-                               27865DD42C8FC051003D5606 /* Security.framework in Frameworks */,
-                               27865DD52C8FC051003D5606 /* SystemConfiguration.framework in Frameworks */,
-                               27865DD62C8FC051003D5606 /* libcups_static.a in Frameworks */,
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
                271286C01CC13E2100E517C7 /* Frameworks */ = {
                        isa = PBXFrameworksBuildPhase;
                        buildActionMask = 2147483647;
                                271286671CC1309000E517C7 /* tlscheck */,
                                2712867D1CC1310E00E517C7 /* rasterbench */,
                                271286961CC13DC000E517C7 /* checkpo */,
-                               271286B81CC13DFF00E517C7 /* strings2po */,
                                271286C91CC13E2100E517C7 /* bcp */,
                                271286D91CC13E5B00E517C7 /* tbcp */,
                                271286F31CC13F2000E517C7 /* mailto */,
                                72220ED8133305BB00FCA411 /* file.c */,
                                27F515572AB1F7440045EE21 /* form.c */,
                                72220EDA133305BB00FCA411 /* getdevices.c */,
-                               72220EDB133305BB00FCA411 /* getifaddrs.c */,
                                72220EDC133305BB00FCA411 /* getputfile.c */,
                                72220EDD133305BB00FCA411 /* globals.c */,
                                7284F9EF1BFCCD940026F886 /* hash.c */,
                        productReference = 271286961CC13DC000E517C7 /* checkpo */;
                        productType = "com.apple.product-type.tool";
                };
-               271286A91CC13DFF00E517C7 /* strings2po */ = {
-                       isa = PBXNativeTarget;
-                       buildConfigurationList = 271286B51CC13DFF00E517C7 /* Build configuration list for PBXNativeTarget "strings2po" */;
-                       buildPhases = (
-                               271286AC1CC13DFF00E517C7 /* Sources */,
-                               271286AE1CC13DFF00E517C7 /* Frameworks */,
-                               271286B41CC13DFF00E517C7 /* CopyFiles */,
-                       );
-                       buildRules = (
-                       );
-                       dependencies = (
-                               271286AA1CC13DFF00E517C7 /* PBXTargetDependency */,
-                       );
-                       name = strings2po;
-                       productName = testmime;
-                       productReference = 271286B81CC13DFF00E517C7 /* strings2po */;
-                       productType = "com.apple.product-type.tool";
-               };
                271286BA1CC13E2100E517C7 /* bcp */ = {
                        isa = PBXNativeTarget;
                        buildConfigurationList = 271286C61CC13E2100E517C7 /* Build configuration list for PBXNativeTarget "bcp" */;
                                271286F51CC13F3F00E517C7 /* rss */,
                                720DD6C11358FD5F0064AA82 /* snmp */,
                                7243792F1333FB85009631B9 /* socket */,
-                               271286A91CC13DFF00E517C7 /* strings2po */,
                                271286CB1CC13E5B00E517C7 /* tbcp */,
                                724FA65E1CC038A50092477B /* test1284 */,
                                724FA5241CC0370C0092477B /* testadmin */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
-               271286AC1CC13DFF00E517C7 /* Sources */ = {
-                       isa = PBXSourcesBuildPhase;
-                       buildActionMask = 2147483647;
-                       files = (
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
                271286BD1CC13E2100E517C7 /* Sources */ = {
                        isa = PBXSourcesBuildPhase;
                        buildActionMask = 2147483647;
                                274FF6991333B1C400317ECB /* getdevices.c in Sources */,
                                720E854420164E7B00C6C411 /* ipp-file.c in Sources */,
                                2758FDC02C8F9B9C0078480C /* oauth.c in Sources */,
-                               274FF69A1333B1C400317ECB /* getifaddrs.c in Sources */,
                                274FF69B1333B1C400317ECB /* getputfile.c in Sources */,
                                274FF69C1333B1C400317ECB /* globals.c in Sources */,
                                274FF69D1333B1C400317ECB /* http-addr.c in Sources */,
                                72220F12133305BB00FCA411 /* file.c in Sources */,
                                720E854320164E7B00C6C411 /* ipp-file.c in Sources */,
                                72220F14133305BB00FCA411 /* getdevices.c in Sources */,
-                               72220F15133305BB00FCA411 /* getifaddrs.c in Sources */,
                                72220F16133305BB00FCA411 /* getputfile.c in Sources */,
                                72220F17133305BB00FCA411 /* globals.c in Sources */,
                                72220F18133305BB00FCA411 /* http-addr.c in Sources */,
                        target = 274FF6891333B1C400317ECB /* libcups2_static */;
                        targetProxy = 271286891CC13DC000E517C7 /* PBXContainerItemProxy */;
                };
-               271286AA1CC13DFF00E517C7 /* PBXTargetDependency */ = {
-                       isa = PBXTargetDependency;
-                       target = 274FF6891333B1C400317ECB /* libcups2_static */;
-                       targetProxy = 271286AB1CC13DFF00E517C7 /* PBXContainerItemProxy */;
-               };
                271286BB1CC13E2100E517C7 /* PBXTargetDependency */ = {
                        isa = PBXTargetDependency;
                        target = 72220EAD1333047D00FCA411 /* libcups2 */;
                        target = 72220EAD1333047D00FCA411 /* libcups2 */;
                        targetProxy = 271286CD1CC13E5B00E517C7 /* PBXContainerItemProxy */;
                };
-               271286DE1CC13EF400E517C7 /* PBXTargetDependency */ = {
-                       isa = PBXTargetDependency;
-                       target = 271286A91CC13DFF00E517C7 /* strings2po */;
-                       targetProxy = 271286DD1CC13EF400E517C7 /* PBXContainerItemProxy */;
-               };
                271286E01CC13EF400E517C7 /* PBXTargetDependency */ = {
                        isa = PBXTargetDependency;
                        target = 271286571CC1309000E517C7 /* tlscheck */;
                        };
                        name = Release;
                };
-               271286B61CC13DFF00E517C7 /* Debug */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               CLANG_ENABLE_OBJC_WEAK = YES;
-                               CODE_SIGN_IDENTITY = "-";
-                               DEAD_CODE_STRIPPING = YES;
-                               GCC_C_LANGUAGE_STANDARD = c99;
-                               PRODUCT_NAME = "$(TARGET_NAME)";
-                       };
-                       name = Debug;
-               };
-               271286B71CC13DFF00E517C7 /* Release */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               CLANG_ENABLE_OBJC_WEAK = YES;
-                               CODE_SIGN_IDENTITY = "-";
-                               DEAD_CODE_STRIPPING = YES;
-                               GCC_C_LANGUAGE_STANDARD = c99;
-                               PRODUCT_NAME = "$(TARGET_NAME)";
-                       };
-                       name = Release;
-               };
                271286C71CC13E2100E517C7 /* Debug */ = {
                        isa = XCBuildConfiguration;
                        buildSettings = {
                        defaultConfigurationIsVisible = 0;
                        defaultConfigurationName = Release;
                };
-               271286B51CC13DFF00E517C7 /* Build configuration list for PBXNativeTarget "strings2po" */ = {
-                       isa = XCConfigurationList;
-                       buildConfigurations = (
-                               271286B61CC13DFF00E517C7 /* Debug */,
-                               271286B71CC13DFF00E517C7 /* Release */,
-                       );
-                       defaultConfigurationIsVisible = 0;
-                       defaultConfigurationName = Release;
-               };
                271286C61CC13E2100E517C7 /* Build configuration list for PBXNativeTarget "bcp" */ = {
                        isa = XCConfigurationList;
                        buildConfigurations = (