]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Remove pointless casts 567/head
authorRose <83477269+AtariDreams@users.noreply.github.com>
Thu, 1 Dec 2022 16:58:17 +0000 (11:58 -0500)
committerRose <83477269+AtariDreams@users.noreply.github.com>
Fri, 2 Dec 2022 00:31:32 +0000 (19:31 -0500)
These variables were already in the target type anyway, or implicitly converted to void *.

cups/file.c
cups/http.c
cups/ipp-file.c
cups/raster-interpret.c
cups/raster-stream.c

index d9b0233e44080a30e30da465c78bd3bf905bbfa5..743c30c2abdb61ce53bcf110bf02461054ae8d90 100644 (file)
@@ -2306,7 +2306,7 @@ cups_fill(cups_file_t *fp)                /* I - CUPS file */
          return (-1);
        }
 
-       bytes = ((unsigned char)ptr[1] << 8) | (unsigned char)ptr[0];
+       bytes = (ptr[1] << 8) | ptr[0];
        ptr   += 2 + bytes;
 
        if (ptr > end)
index 8a06daf676cdc52b8f90b5a08d3f38394b00805b..bcfb3b0df1b26b5af4c198e784148fb46f22ca2e 100644 (file)
@@ -729,7 +729,7 @@ httpFreeCredentials(
        credential = (http_credential_t *)cupsArrayNext(credentials))
   {
     cupsArrayRemove(credentials, credential);
-    free((void *)credential->data);
+    free(credential->data);
     free(credential);
   }
 
@@ -3266,9 +3266,9 @@ httpWrite2(http_t     *http,              /* I - HTTP connection */
                     CUPS_LLCAST length));
 
       if (http->data_encoding == HTTP_ENCODING_CHUNKED)
-       bytes = (ssize_t)http_write_chunk(http, buffer, length);
+       bytes = http_write_chunk(http, buffer, length);
       else
-       bytes = (ssize_t)http_write(http, buffer, length);
+       bytes = http_write(http, buffer, length);
 
       DEBUG_printf(("2httpWrite2: Wrote " CUPS_LLFMT " bytes...",
                     CUPS_LLCAST bytes));
index 5483a607df600c4752114e6745d978dc8086449d..ca4a66075c487cbd178e228a7fbf2315689fb4d6 100644 (file)
@@ -692,11 +692,11 @@ parse_value(_ipp_file_t      *f,  /* I  - IPP data file */
                yres;           /* Y resolution */
          char  *ptr;           /* Pointer into value */
 
-         xres = yres = (int)strtol(value, (char **)&ptr, 10);
+         xres = yres = (int)strtol(value, &ptr, 10);
          if (ptr > value && xres > 0)
          {
            if (*ptr == 'x')
-             yres = (int)strtol(ptr + 1, (char **)&ptr, 10);
+             yres = (int)strtol(ptr + 1, &ptr, 10);
          }
 
          if (ptr <= value || xres <= 0 || yres <= 0 || !ptr || (_cups_strcasecmp(ptr, "dpi") && _cups_strcasecmp(ptr, "dpc") && _cups_strcasecmp(ptr, "dpcm") && _cups_strcasecmp(ptr, "other")))
index 1eb7835bd36cd858e7ee7b1fa450d1bac55cad0b..97662ec17665ca62faf2aad8a026ece056528ca3 100644 (file)
@@ -353,10 +353,10 @@ _cupsRasterInterpretPPD(
                                         h->cupsBorderlessScalingFactor);
   h->ImagingBoundingBox[3] = (unsigned)(top *
                                         h->cupsBorderlessScalingFactor);
-  h->cupsImagingBBox[0]    = (float)left;
-  h->cupsImagingBBox[1]    = (float)bottom;
-  h->cupsImagingBBox[2]    = (float)right;
-  h->cupsImagingBBox[3]    = (float)top;
+  h->cupsImagingBBox[0]    = left;
+  h->cupsImagingBBox[1]    = bottom;
+  h->cupsImagingBBox[2]    = right;
+  h->cupsImagingBBox[3]    = top;
 
  /*
   * Use the callback to validate the page header...
index 1459817cfa4c67d31f6abf6f7c750214cd95abb6..aab45e79233ca52c48e5f202786f9c452027eb37 100644 (file)
@@ -693,8 +693,8 @@ _cupsRasterReadHeader(
 
           if (r->header.HWResolution[0] > 0)
           {
-           r->header.PageSize[0]     = (unsigned)(r->header.cupsWidth * 72 / r->header.HWResolution[0]);
-           r->header.PageSize[1]     = (unsigned)(r->header.cupsHeight * 72 / r->header.HWResolution[1]);
+           r->header.PageSize[0]     = (r->header.cupsWidth * 72 / r->header.HWResolution[0]);
+           r->header.PageSize[1]     = (r->header.cupsHeight * 72 / r->header.HWResolution[1]);
            r->header.cupsPageSize[0] = (float)(r->header.cupsWidth * 72.0 / r->header.HWResolution[0]);
            r->header.cupsPageSize[1] = (float)(r->header.cupsHeight * 72.0 / r->header.HWResolution[1]);
           }