From: Michael R Sweet Date: Tue, 15 Apr 2025 00:10:23 +0000 (-0400) Subject: Address some clang-reported warnings. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bccc3342b067b6c98101a71c8de299c66ee9adea;p=thirdparty%2Fcups.git Address some clang-reported warnings. --- diff --git a/cups/dnssd.c b/cups/dnssd.c index f2add7673c..7d99f1da09 100644 --- a/cups/dnssd.c +++ b/cups/dnssd.c @@ -1003,7 +1003,7 @@ cupsDNSSDQueryNew( cups_dnssd_query_t *query; // Query request - DEBUG_printf("cupsDNSSDQueryNew(dnssd=%p, if_index=%u, fullname=\"%s\", rrtype=%u, query_cb=%p, cb_data=%p)", (void *)dnssd, if_index, fullname, rrtype, query_cb, cb_data); + DEBUG_printf("cupsDNSSDQueryNew(dnssd=%p, if_index=%u, fullname=\"%s\", rrtype=%u, query_cb=%p, cb_data=%p)", (void *)dnssd, if_index, fullname, rrtype, (void *)query_cb, cb_data); // Range check input... if (!dnssd || !fullname || !query_cb) diff --git a/cups/jwt.c b/cups/jwt.c index cb9ba73119..4743a15f89 100644 --- a/cups/jwt.c +++ b/cups/jwt.c @@ -1475,7 +1475,7 @@ cupsJWTSign(cups_jwt_t *jwt, // I - JWT object } // Remove existing JOSE string, if any... - DEBUG_printf("1cupsJWTSign: jose=%p, jose_string=\"%s\"", jwt->jose, jwt->jose_string); + DEBUG_printf("1cupsJWTSign: jose=%p, jose_string=\"%s\"", (void *)jwt->jose, jwt->jose_string); _cupsJSONDelete(jwt->jose, "alg"); _cupsJSONDelete(jwt->jose, "x5c"); @@ -1688,7 +1688,7 @@ make_ec_key(cups_json_t *jwk, // I - JSON web key y = make_bignum(jwk, "y"); d = verify ? NULL : make_bignum(jwk, "d"); - DEBUG_printf("4make_ec_key: crv=\"%s\", x=%p, y=%p, d=%p", crv, x, y, d); + DEBUG_printf("4make_ec_key: crv=\"%s\", x=%p, y=%p, d=%p", crv, (void *)x, (void *)y, (void *)d); if (!crv || ((!x || !y) && !d)) goto ec_done; @@ -1774,7 +1774,7 @@ make_rsa(cups_json_t *jwk) // I - JSON web key rsa_done: - DEBUG_printf("4make_rsa: n=%p, e=%p, d=%p, p=%p, q=%p, dp=%p, dq=%p, qi=%p, rsa=%p", n, e, d, p, q, dp, dq, qi, rsa); + DEBUG_printf("4make_rsa: n=%p, e=%p, d=%p, p=%p, q=%p, dp=%p, dq=%p, qi=%p, rsa=%p", (void *)n, (void *)e, (void *)d, (void *)p, (void *)q, (void *)dp, (void *)dq, (void *)qi, (void *)rsa); if (!rsa) { diff --git a/cups/tls.c b/cups/tls.c index 19e4ccb376..3f3295ee6b 100644 --- a/cups/tls.c +++ b/cups/tls.c @@ -151,7 +151,7 @@ cupsSaveCredentials( // Validate input... - DEBUG_printf("cupsSaveCredentials(path=\"%s\", common_name=\"%s\", credentials=%p(%u), key=%p(%u))", path, common_name, credentials, credentials ? (unsigned)strlen(credentials) : 0, key, key ? (unsigned)strlen(key) : 0); + DEBUG_printf("cupsSaveCredentials(path=\"%s\", common_name=\"%s\", credentials=%p(%u), key=%p(%u))", path, common_name, (void *)credentials, credentials ? (unsigned)strlen(credentials) : 0, (void *)key, key ? (unsigned)strlen(key) : 0); if (!path) path = http_default_path(defpath, sizeof(defpath)); diff --git a/scheduler/job.c b/scheduler/job.c index 21b5a21fc5..207c506f3e 100644 --- a/scheduler/job.c +++ b/scheduler/job.c @@ -4195,7 +4195,7 @@ ipp_length(ipp_t *ipp) /* I - IPP request */ * Loop through all attributes... */ - bytes = 0; + bytes = 1; for (attr = ipp->attrs; attr != NULL; attr = attr->next) { diff --git a/scheduler/printers.c b/scheduler/printers.c index 2d5be1797b..31d66322f1 100644 --- a/scheduler/printers.c +++ b/scheduler/printers.c @@ -972,7 +972,7 @@ cupsdLoadAllPrinters(void) } } - if (strncmp(p->device_uri, "file:", 5) && p->state != IPP_PSTATE_STOPPED) + if (p->device_uri && strncmp(p->device_uri, "file:", 5) && p->state != IPP_PSTATE_STOPPED) { /* * See if the backend exists... diff --git a/tools/ippeveps.c b/tools/ippeveps.c index ef85f4e3f4..75ba2b0e65 100644 --- a/tools/ippeveps.c +++ b/tools/ippeveps.c @@ -470,7 +470,7 @@ get_options(cups_option_t **options) /* O - Options */ if ((value = getenv("IPP_SIDES")) == NULL) value = getenv("IPP_SIDES_DEFAULT"); - if (value && ppd_cache->sides_option) + if (value && ppd_cache && ppd_cache->sides_option) { if (!strcmp(value, "one-sided") && ppd_cache->sides_1sided) num_options = cupsAddOption(ppd_cache->sides_option, ppd_cache->sides_1sided, num_options, options); @@ -483,7 +483,7 @@ get_options(cups_option_t **options) /* O - Options */ if ((value = getenv("IPP_PRINT_QUALITY")) == NULL) value = getenv("IPP_PRINT_QUALITY_DEFAULT"); - if (value) + if (value && ppd_cache) { int i; /* Looping var */ int pq; /* Print quality (0-2) */