From: Michael R Sweet Date: Mon, 10 Nov 2025 20:13:33 +0000 (-0500) Subject: Fix clang warnings. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2e7c11874d7a0b7477b0c8bccedc290833d75932;p=thirdparty%2Fcups.git Fix clang warnings. --- diff --git a/cups/auth.c b/cups/auth.c index fc52a0cba1..b29e998be6 100644 --- a/cups/auth.c +++ b/cups/auth.c @@ -449,8 +449,8 @@ _cupsSetNegotiateAuthString( { // Allocate the authorization string since Windows KDCs can have // arbitrarily large credentials... - int authsize = 10 + // "Negotiate " - (((int)output_token.length * 4 / 3 + 3) & ~3) + 1; + size_t authsize = (size_t)(10 + // "Negotiate " + ((output_token.length * 4 / 3 + 3) & ~3U) + 1); // Base64 + nul httpSetAuthString(http, NULL, NULL); diff --git a/cups/ipp-support.c b/cups/ipp-support.c index 5d575b5b52..8ff8bc04e3 100644 --- a/cups/ipp-support.c +++ b/cups/ipp-support.c @@ -2019,7 +2019,7 @@ ippCreateRequestedArray(ipp_t *request) // I - IPP request } // If the attribute contains a single "all" keyword, return NULL... - count = ippGetCount(requested); + count = (size_t)ippGetCount(requested); if (count == 1 && !strcmp(ippGetString(requested, 0, NULL), "all")) return (NULL); diff --git a/cups/ipp.c b/cups/ipp.c index 844f273b4a..622e0c981e 100644 --- a/cups/ipp.c +++ b/cups/ipp.c @@ -6042,7 +6042,7 @@ ipp_set_value(ipp_t *ipp, // IO - IPP message if (temp->num_values <= 1) alloc_values = 1; else - alloc_values = (temp->num_values + IPP_MAX_VALUES - 1) & (size_t)~(IPP_MAX_VALUES - 1); + alloc_values = (temp->num_values + IPP_MAX_VALUES - 1) & ~(IPP_MAX_VALUES - 1); if (element < alloc_values) { diff --git a/cups/tls-openssl.c b/cups/tls-openssl.c index 7e9e1414f0..b4a654841b 100644 --- a/cups/tls-openssl.c +++ b/cups/tls-openssl.c @@ -96,7 +96,7 @@ cupsAreCredentialsValidForName( STACK_OF(GENERAL_NAME) *names = NULL; // subjectAltName values - DEBUG_printf("1cupsAreCredentialsValidForName: certs=%p(num=%d), cert=%p", certs, sk_X509_num(certs), cert); + DEBUG_printf("1cupsAreCredentialsValidForName: certs=%p(num=%d), cert=%p", (void *)certs, sk_X509_num(certs), (void *)cert); X509_NAME_get_text_by_NID(X509_get_subject_name(cert), NID_commonName, subjectName, sizeof(subjectName)); DEBUG_printf("1cupsAreCredentialsValidForName: subjectName=\"%s\"", subjectName); @@ -116,7 +116,7 @@ cupsAreCredentialsValidForName( if (!result) { names = X509_get_ext_d2i(cert, NID_subject_alt_name, /*crit*/NULL, /*idx*/NULL); - DEBUG_printf("1cupsAreCredentialsValidForName: names=%p", names); + DEBUG_printf("1cupsAreCredentialsValidForName: names=%p", (void *)names); } if (names)