]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix compiler warnings.
authorMichael R Sweet <michael.r.sweet@gmail.com>
Sat, 5 Sep 2020 16:06:28 +0000 (12:06 -0400)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Sat, 5 Sep 2020 16:06:28 +0000 (12:06 -0400)
cups/hash.c
cups/ipp-vars.c
cups/request.c
cups/testclient.c
cups/testdest.c

index 4fbb443db10cbf2180bb2af6266ed00a177d9a89..c153c665591dff31a6bc7e5ab8614a4f90ae5715 100644 (file)
@@ -199,7 +199,7 @@ cupsHashData(const char    *algorithm,      /* I - Algorithm name */
       goto too_small;
 
     _cupsMD5Init(&state);
-    _cupsMD5Append(&state, data, datalen);
+    _cupsMD5Append(&state, data, (int)datalen);
     _cupsMD5Finish(&state, hash);
 
     return (16);
index 395b0ebf3e130951cb2482c3230c3d3b6150a7bc..f7538a4eac859a6e0722b63a148d17155d75a327 100644 (file)
@@ -221,9 +221,8 @@ _ippVarsSet(_ipp_vars_t *v,         /* I - IPP variables */
   if (!strcmp(name, "uri"))
   {
     char               uri[1024];      /* New printer URI */
-    http_uri_status_t  uri_status;     /* URI status */
 
-    if ((uri_status = httpSeparateURI(HTTP_URI_CODING_ALL, value, v->scheme, sizeof(v->scheme), v->username, sizeof(v->username), v->host, sizeof(v->host), &(v->port), v->resource, sizeof(v->resource))) < HTTP_URI_STATUS_OK)
+    if (httpSeparateURI(HTTP_URI_CODING_ALL, value, v->scheme, sizeof(v->scheme), v->username, sizeof(v->username), v->host, sizeof(v->host), &(v->port), v->resource, sizeof(v->resource)) < HTTP_URI_STATUS_OK)
       return (0);
 
     if (v->username[0])
index 69a7801375ade2a3a8eb8b16f92baf8fc3aa1bcf..ff967f05ad14a8edc57f169438ad9a3acc248d6a 100644 (file)
@@ -395,7 +395,7 @@ cupsGetResponse(http_t     *http,   /* I - Connection to server or @code CUPS_HTTP
       ippDelete(response);
       response = NULL;
 
-      http->status = status = HTTP_STATUS_ERROR;
+      http->status = HTTP_STATUS_ERROR;
       http->error  = EINVAL;
     }
   }
@@ -422,7 +422,7 @@ cupsGetResponse(http_t     *http,   /* I - Connection to server or @code CUPS_HTTP
       if (!cupsDoAuthentication(http, "POST", resource))
         httpReconnect2(http, 30000, NULL);
       else
-        http->status = status = HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED;
+        http->status = HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED;
     }
 
 #ifdef HAVE_SSL
index cf945df98a6d3d24fb1051c0ff344911e1cb0a8d..9ddf32aab87f624bb7080d564355a51484232bd7 100644 (file)
@@ -603,6 +603,8 @@ make_raster_file(ipp_t      *response,  /* I - Printer attributes */
   for (y = 0; y < header.cupsHeight; y ++)
     cupsRasterWritePixels(ras, line, header.cupsBytesPerLine);
 
+  free(line);
+
   cupsRasterClose(ras);
 
   close(fd);
index a65e09960d84cd1219e8c1f010331595f023a2d0..9b07e77718fb161c2c5a92cb1b72f7e9d8079062 100644 (file)
@@ -410,7 +410,6 @@ print_file(http_t        *http,             /* I - Connection to destination */
 {
   cups_file_t  *fp;                    /* File to print */
   int          job_id;                 /* Job ID */
-  ipp_status_t status;                 /* Submission status */
   const char   *title;                 /* Title of job */
   char         buffer[32768];          /* File buffer */
   ssize_t      bytes;                  /* Bytes read/to write */
@@ -427,7 +426,7 @@ print_file(http_t        *http,             /* I - Connection to destination */
   else
     title = filename;
 
-  if ((status = cupsCreateDestJob(http, dest, dinfo, &job_id, title, num_options, options)) > IPP_STATUS_OK_IGNORED_OR_SUBSTITUTED)
+  if (cupsCreateDestJob(http, dest, dinfo, &job_id, title, num_options, options) > IPP_STATUS_OK_IGNORED_OR_SUBSTITUTED)
   {
     printf("Unable to create job: %s\n", cupsLastErrorString());
     cupsFileClose(fp);
@@ -454,7 +453,7 @@ print_file(http_t        *http,             /* I - Connection to destination */
 
   cupsFileClose(fp);
 
-  if ((status = cupsFinishDestDocument(http, dest, dinfo)) > IPP_STATUS_OK_IGNORED_OR_SUBSTITUTED)
+  if (cupsFinishDestDocument(http, dest, dinfo) > IPP_STATUS_OK_IGNORED_OR_SUBSTITUTED)
   {
     printf("Unable to send document: %s\n", cupsLastErrorString());
     return;