All of lore.kernel.org
 help / color / mirror / Atom feed
From: joevt <joevt@shaw.ca>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: linux-media@vger.kernel.org, joevt <joevt@shaw.ca>
Subject: [PATCH 07/10] edid-decode: cleanup printf format string compiler warnings
Date: Sat, 23 Nov 2019 08:46:01 -0800	[thread overview]
Message-ID: <20191123164604.268-8-joevt@shaw.ca> (raw)
In-Reply-To: <20191123164604.268-1-joevt@shaw.ca>

In current versions of macOS, $(CC) in Makefile is gcc but gcc points to clang. clang complains when h is used for char or int (h is usually for short).

Signed-off-by: Joe van Tunen <joevt@shaw.ca>
---
 edid-decode.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/edid-decode.c b/edid-decode.c
index ce404cd..a40ee96 100644
--- a/edid-decode.c
+++ b/edid-decode.c
@@ -1127,13 +1127,13 @@ static int do_checksum(const unsigned char *x, size_t len)
 	unsigned char sum = 0;
 	unsigned i;
 
-	printf("Checksum: 0x%hx", check);
+	printf("Checksum: 0x%hhx", check);
 
 	for (i = 0; i < len-1; i++)
 		sum += x[i];
 
 	if ((unsigned char)(check + sum) != 0) {
-		printf(" (should be 0x%hx)\n", -sum & 0xff);
+		printf(" (should be 0x%x)\n", -sum & 0xff);
 		return 0;
 	}
 
@@ -3286,7 +3286,7 @@ static int edid_from_file(const char *from_file, const char *to_file,
 	}
 
 	cur_block = "EDID Structure Version & Revision";
-	printf("EDID version: %hd.%hd\n", edid[0x12], edid[0x13]);
+	printf("EDID version: %hhu.%hhu\n", edid[0x12], edid[0x13]);
 	if (edid[0x12] == 1) {
 		if (edid[0x13] > 4) {
 			printf("Claims > 1.4, assuming 1.4 conformance\n");
@@ -3321,12 +3321,12 @@ static int edid_from_file(const char *from_file, const char *to_file,
 		if (edid[0x11] <= 0x0f) {
 			fail("bad year of manufacture\n");
 		} else if (edid[0x10] == 0xff) {
-			printf("Model year %hu\n", edid[0x11] + 1990);
+			printf("Model year %u\n", edid[0x11] + 1990);
 		} else if (edid[0x11] + 90 <= ptm->tm_year + 1) {
 			if (edid[0x10])
-				printf("Made in week %hu of %hu\n", edid[0x10], edid[0x11] + 1990);
+				printf("Made in week %hhu of %u\n", edid[0x10], edid[0x11] + 1990);
 			else
-				printf("Made in year %hu\n", edid[0x11] + 1990);
+				printf("Made in year %u\n", edid[0x11] + 1990);
 		} else {
 			fail("bad year of manufacture\n");
 		}
-- 
2.21.0 (Apple Git-122.2)


  parent reply	other threads:[~2019-11-23 16:46 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-23 16:45 [PATCH 00/10] edid-decode: bug fixes, additions, changes joevt
2019-11-23 16:45 ` [PATCH 01/10] edid-decode: change horizontal refresh rates to kHz joevt
2019-11-23 16:45 ` [PATCH 02/10] edid-decode: correct horizontal range in Monitor Ranges joevt
2019-11-23 16:45 ` [PATCH 03/10] edid-decode: correct calculation of DisplayID type 1 timings joevt
2019-11-23 16:45 ` [PATCH 04/10] edid-decode: add front porch, pulse width, and back porch joevt
2019-11-23 16:45 ` [PATCH 05/10] edid-decode: output timings for YCbCr 4:2:0 cmdb joevt
2019-11-24 10:26   ` Hans Verkuil
2019-11-25  6:32     ` Joe van Tunen
2019-11-25  8:20       ` Hans Verkuil
2019-11-23 16:46 ` [PATCH 06/10] edid-decode: Dump hex of unknown CTA Vendor-Specific blocks joevt
2019-11-23 16:46 ` joevt [this message]
2019-11-23 16:46 ` [PATCH 08/10] edid-decode: Dump hex of non-decoded extension blocks joevt
2019-11-23 16:46 ` [PATCH 09/10] edid-decode: DisplayID additions joevt
2019-11-24 10:03   ` Hans Verkuil
2019-11-25  6:30     ` Joe van Tunen
2019-11-25  9:15       ` Hans Verkuil
2019-11-23 16:46 ` [PATCH 10/10] edid-decode: add example EDIDs joevt
2019-11-24 11:10   ` Hans Verkuil
2019-11-24 11:12 ` [PATCH 00/10] edid-decode: bug fixes, additions, changes Hans Verkuil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191123164604.268-8-joevt@shaw.ca \
    --to=joevt@shaw.ca \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.