From 847cd6432cdf9d62ce2e78e7ba71ce932a51c66c Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Sat, 5 Sep 2020 12:06:28 -0400 Subject: [PATCH] Fix compiler warnings. --- cups/hash.c | 2 +- cups/ipp-vars.c | 3 +-- cups/request.c | 4 ++-- cups/testclient.c | 2 ++ cups/testdest.c | 5 ++--- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cups/hash.c b/cups/hash.c index 4fbb443db1..c153c66559 100644 --- a/cups/hash.c +++ b/cups/hash.c @@ -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); diff --git a/cups/ipp-vars.c b/cups/ipp-vars.c index 395b0ebf3e..f7538a4eac 100644 --- a/cups/ipp-vars.c +++ b/cups/ipp-vars.c @@ -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]) diff --git a/cups/request.c b/cups/request.c index 69a7801375..ff967f05ad 100644 --- a/cups/request.c +++ b/cups/request.c @@ -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 diff --git a/cups/testclient.c b/cups/testclient.c index cf945df98a..9ddf32aab8 100644 --- a/cups/testclient.c +++ b/cups/testclient.c @@ -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); diff --git a/cups/testdest.c b/cups/testdest.c index a65e09960d..9b07e77718 100644 --- a/cups/testdest.c +++ b/cups/testdest.c @@ -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; -- 2.47.2