]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Address some clang-reported warnings.
authorMichael R Sweet <msweet@msweet.org>
Tue, 15 Apr 2025 00:10:23 +0000 (20:10 -0400)
committerMichael R Sweet <msweet@msweet.org>
Tue, 15 Apr 2025 00:10:23 +0000 (20:10 -0400)
cups/dnssd.c
cups/jwt.c
cups/tls.c
scheduler/job.c
scheduler/printers.c
tools/ippeveps.c

index f2add7673cf7d4d0c091c5ad2ab22cb8a3061f6b..7d99f1da094bd3a5e6599ab21b38e9d89484bc55 100644 (file)
@@ -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)
index cb9ba73119081ff302cde5238f0ff3ee2fb1d598..4743a15f89d5839aa3aeefe20ecbfe52e60721a5 100644 (file)
@@ -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)
   {
index 19e4ccb3763802154b930114def373401289333e..3f3295ee6b74dd5371b6c37b6f5d5b554e10b6e9 100644 (file)
@@ -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));
index 21b5a21fc500b67770c318a52fc5b8cbef03794e..207c506f3e338db8eda831eaf5c9b4d63cdc53cf 100644 (file)
@@ -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)
   {
index 2d5be1797bd7c25b9d68a443bf195b3c5bc393e5..31d66322f1aab372a68d11ba419d4c50f3e8a456 100644 (file)
@@ -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...
index ef85f4e3f4cc86b3fe1af999377239876b9a7dce..75ba2b0e658ad6676714b63fb9675c65044a0ec8 100644 (file)
@@ -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) */