From: Michael R Sweet Date: Thu, 26 Mar 2026 18:51:59 +0000 (-0400) Subject: Fix some clang warnings. X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=538ebf4ff6ff5f1194357c0cdd308595cc057fa1;p=thirdparty%2Fcups.git Fix some clang warnings. --- diff --git a/backend/lpd.c b/backend/lpd.c index fe59911265..cc2a3b924e 100644 --- a/backend/lpd.c +++ b/backend/lpd.c @@ -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) { diff --git a/backend/snmp.c b/backend/snmp.c index 1e7f0005b0..4a17952ca0 100644 --- a/backend/snmp.c +++ b/backend/snmp.c @@ -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)); } diff --git a/cups/backchannel.c b/cups/backchannel.c index 05c9688184..7eeea0bb2b 100644 --- a/cups/backchannel.c +++ b/cups/backchannel.c @@ -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); diff --git a/cups/clock.c b/cups/clock.c index 4981d4751b..d7e83af4bc 100644 --- a/cups/clock.c +++ b/cups/clock.c @@ -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 diff --git a/cups/jwt.c b/cups/jwt.c index ec390f134e..b39447a324 100644 --- a/cups/jwt.c +++ b/cups/jwt.c @@ -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 diff --git a/cups/raster-interpret.c b/cups/raster-interpret.c index 7cc7b9b73c..69d7858e86 100644 --- a/cups/raster-interpret.c +++ b/cups/raster-interpret.c @@ -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)) diff --git a/cups/raster-stream.c b/cups/raster-stream.c index 96500c754e..04a9b19c76 100644 --- a/cups/raster-stream.c +++ b/cups/raster-stream.c @@ -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)); diff --git a/cups/rasterbench.c b/cups/rasterbench.c index 22dc735bc1..69814c1fcd 100644 --- a/cups/rasterbench.c +++ b/cups/rasterbench.c @@ -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); } diff --git a/cups/testarray.c b/cups/testarray.c index d5270b2769..76f5fe4c3d 100644 --- a/cups/testarray.c +++ b/cups/testarray.c @@ -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 diff --git a/cups/testppd.c b/cups/testppd.c index 9da66cb748..32804c63db 100644 --- a/cups/testppd.c +++ b/cups/testppd.c @@ -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 */ diff --git a/cups/thread.c b/cups/thread.c index 497900ba66..dbb105d0e8 100644 --- a/cups/thread.c +++ b/cups/thread.c @@ -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) { diff --git a/filter/pstops.c b/filter/pstops.c index dfc5557547..987ecc9c80 100644 --- a/filter/pstops.c +++ b/filter/pstops.c @@ -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; } diff --git a/filter/rastertoepson.c b/filter/rastertoepson.c index 9de3986935..ea092f612f 100644 --- a/filter/rastertoepson.c +++ b/filter/rastertoepson.c @@ -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; diff --git a/filter/rastertopwg.c b/filter/rastertopwg.c index 6ef0975d25..b5fa2ad96b 100644 --- a/filter/rastertopwg.c +++ b/filter/rastertopwg.c @@ -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; diff --git a/scheduler/cups-deviced.c b/scheduler/cups-deviced.c index 2960d65ff2..b28efb2a7e 100644 --- a/scheduler/cups-deviced.c +++ b/scheduler/cups-deviced.c @@ -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); } diff --git a/scheduler/printers.c b/scheduler/printers.c index 16f16f9947..93310f26bd 100644 --- a/scheduler/printers.c +++ b/scheduler/printers.c @@ -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 = '-'; } diff --git a/scheduler/testspeed.c b/scheduler/testspeed.c index 2b153f23d7..abe12452fc 100644 --- a/scheduler/testspeed.c +++ b/scheduler/testspeed.c @@ -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()) diff --git a/systemv/cupstestppd.c b/systemv/cupstestppd.c index 1e46445b54..df16a1a455 100644 --- a/systemv/cupstestppd.c +++ b/systemv/cupstestppd.c @@ -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")); diff --git a/tools/ippeveprinter.c b/tools/ippeveprinter.c index 82ece6fdc1..eae83e30f9 100644 --- a/tools/ippeveprinter.c +++ b/tools/ippeveprinter.c @@ -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 { diff --git a/tools/ippeveps.c b/tools/ippeveps.c index 9822696c6e..1584c2c280 100644 --- a/tools/ippeveps.c +++ b/tools/ippeveps.c @@ -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("<>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) { diff --git a/xcode/CUPS.xcodeproj/project.pbxproj b/xcode/CUPS.xcodeproj/project.pbxproj index e3bfcb257a..9e6d2e33d8 100644 --- a/xcode/CUPS.xcodeproj/project.pbxproj +++ b/xcode/CUPS.xcodeproj/project.pbxproj @@ -23,7 +23,6 @@ 726AD704135E8AA1002C930D /* PBXTargetDependency */, 2767FC5419267469000F61D3 /* PBXTargetDependency */, 729181C12011560E005E7560 /* PBXTargetDependency */, - 271286DE1CC13EF400E517C7 /* PBXTargetDependency */, 2712849B1CC11FA500E517C7 /* PBXTargetDependency */, 2712849D1CC11FA500E517C7 /* PBXTargetDependency */, 2712849F1CC11FA500E517C7 /* PBXTargetDependency */, @@ -336,7 +335,6 @@ 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 */; }; @@ -455,15 +453,6 @@ 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 */; }; @@ -888,7 +877,6 @@ 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 */; }; @@ -1728,13 +1716,6 @@ 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 */; @@ -1749,13 +1730,6 @@ 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 */; @@ -2828,15 +2802,6 @@ ); runOnlyForDeploymentPostprocessing = 1; }; - 271286B41CC13DFF00E517C7 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = /usr/share/man/man1/; - dstSubfolderSpec = 0; - files = ( - ); - runOnlyForDeploymentPostprocessing = 1; - }; 271286C51CC13E2100E517C7 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; @@ -3494,7 +3459,6 @@ 271286831CC13D9600E517C7 /* checkpo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = checkpo.c; path = ../locale/checkpo.c; sourceTree = ""; }; 271286841CC13D9600E517C7 /* cups.pot */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = cups.pot; path = ../locale/cups.pot; sourceTree = ""; }; 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; }; @@ -3658,7 +3622,6 @@ 72220ED8133305BB00FCA411 /* file.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = file.c; path = ../cups/file.c; sourceTree = ""; }; 72220ED9133305BB00FCA411 /* file.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = file.h; path = ../cups/file.h; sourceTree = ""; }; 72220EDA133305BB00FCA411 /* getdevices.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = getdevices.c; path = ../cups/getdevices.c; sourceTree = ""; }; - 72220EDB133305BB00FCA411 /* getifaddrs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = getifaddrs.c; path = ../cups/getifaddrs.c; sourceTree = ""; }; 72220EDC133305BB00FCA411 /* getputfile.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = getputfile.c; path = ../cups/getputfile.c; sourceTree = ""; }; 72220EDD133305BB00FCA411 /* globals.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = globals.c; path = ../cups/globals.c; sourceTree = ""; }; 72220EDE133305BB00FCA411 /* http-addr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "http-addr.c"; path = "../cups/http-addr.c"; sourceTree = ""; }; @@ -4210,22 +4173,6 @@ ); 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; @@ -5464,7 +5411,6 @@ 271286671CC1309000E517C7 /* tlscheck */, 2712867D1CC1310E00E517C7 /* rasterbench */, 271286961CC13DC000E517C7 /* checkpo */, - 271286B81CC13DFF00E517C7 /* strings2po */, 271286C91CC13E2100E517C7 /* bcp */, 271286D91CC13E5B00E517C7 /* tbcp */, 271286F31CC13F2000E517C7 /* mailto */, @@ -5509,7 +5455,6 @@ 72220ED8133305BB00FCA411 /* file.c */, 27F515572AB1F7440045EE21 /* form.c */, 72220EDA133305BB00FCA411 /* getdevices.c */, - 72220EDB133305BB00FCA411 /* getifaddrs.c */, 72220EDC133305BB00FCA411 /* getputfile.c */, 72220EDD133305BB00FCA411 /* globals.c */, 7284F9EF1BFCCD940026F886 /* hash.c */, @@ -6541,24 +6486,6 @@ 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" */; @@ -8004,7 +7931,6 @@ 271286F51CC13F3F00E517C7 /* rss */, 720DD6C11358FD5F0064AA82 /* snmp */, 7243792F1333FB85009631B9 /* socket */, - 271286A91CC13DFF00E517C7 /* strings2po */, 271286CB1CC13E5B00E517C7 /* tbcp */, 724FA65E1CC038A50092477B /* test1284 */, 724FA5241CC0370C0092477B /* testadmin */, @@ -8318,13 +8244,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 271286AC1CC13DFF00E517C7 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; 271286BD1CC13E2100E517C7 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -8471,7 +8390,6 @@ 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 */, @@ -8686,7 +8604,6 @@ 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 */, @@ -9545,11 +9462,6 @@ 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 */; @@ -9560,11 +9472,6 @@ target = 72220EAD1333047D00FCA411 /* libcups2 */; targetProxy = 271286CD1CC13E5B00E517C7 /* PBXContainerItemProxy */; }; - 271286DE1CC13EF400E517C7 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 271286A91CC13DFF00E517C7 /* strings2po */; - targetProxy = 271286DD1CC13EF400E517C7 /* PBXContainerItemProxy */; - }; 271286E01CC13EF400E517C7 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 271286571CC1309000E517C7 /* tlscheck */; @@ -10850,28 +10757,6 @@ }; 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 = { @@ -13143,15 +13028,6 @@ 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 = (