From 29bda83e12534f17c95dfd575b56a06fb747c8e7 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Mon, 3 Sep 2018 09:30:08 -0400 Subject: [PATCH] Silence some bogus Clang warnings. --- cups/ipp.c | 2 ++ cups/snmp.c | 4 ++-- test/ipptool.c | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cups/ipp.c b/cups/ipp.c index f30d8428f..afd85474d 100644 --- a/cups/ipp.c +++ b/cups/ipp.c @@ -6779,7 +6779,9 @@ ipp_set_value(ipp_t *ipp, /* IO - IPP message */ * Reset pointers in the list... */ +#ifndef __clang_analyzer__ DEBUG_printf(("4debug_free: %p %s", (void *)*attr, temp->name)); +#endif /* !__clang_analyzer__ */ DEBUG_printf(("4debug_alloc: %p %s %s%s (%d)", (void *)temp, temp->name, temp->num_values > 1 ? "1setOf " : "", ippTagString(temp->value_tag), temp->num_values)); if (ipp->current == *attr && ipp->prev) diff --git a/cups/snmp.c b/cups/snmp.c index cd88b2098..1e1fa3eef 100644 --- a/cups/snmp.c +++ b/cups/snmp.c @@ -1234,10 +1234,10 @@ asn1_get_integer( return (0); } - for (value = (**buffer & 0x80) ? -1 : 0; + for (value = (**buffer & 0x80) ? ~0 : 0; length > 0 && *buffer < bufend; length --, (*buffer) ++) - value = (value << 8) | **buffer; + value = ((value & 0xffffff) << 8) | **buffer; return (value); } diff --git a/test/ipptool.c b/test/ipptool.c index 39ccb286b..9b5bc6395 100644 --- a/test/ipptool.c +++ b/test/ipptool.c @@ -4783,7 +4783,7 @@ with_value(_cups_testdata_t *data, /* I - Test data */ * Grab hex-encoded value... */ - if ((withlen = (int)strlen(value)) & 1 || withlen > (2 * (sizeof(withdata) + 1))) + if ((withlen = (int)strlen(value)) & 1 || withlen > (int)(2 * (sizeof(withdata) + 1))) { print_fatal_error(data, "Bad WITH-VALUE hex value."); return (0); -- 2.39.5