From f4967b94028319ad03f1d4d4f751cc119be73b87 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 19 Nov 2022 22:26:54 +0100 Subject: [PATCH] hdmi_cec: avoid compiler warnings Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/83ff276d6b1ed05cc3cc827e58d74bd46e5af7b0 Author: vanhofen Date: 2022-11-19 (Sat, 19 Nov 2022) Origin message was: ------------------ - hdmi_cec: avoid compiler warnings ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/hdmi_cec.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/driver/hdmi_cec.cpp b/src/driver/hdmi_cec.cpp index 977a152f3..75c326941 100644 --- a/src/driver/hdmi_cec.cpp +++ b/src/driver/hdmi_cec.cpp @@ -165,6 +165,8 @@ void hdmi_cec::ReportPhysicalAddress() void hdmi_cec::SendCECMessage(struct cec_message &txmessage, int sleeptime) { + (void) sleeptime; // avoid compiler warning + char str[txmessage.length * 6]; for (int i = 0; i < txmessage.length; i++) @@ -548,9 +550,9 @@ void hdmi_cec::run() static unsigned char pressedkey = 0; char str[rxmessage.length * 6]; - for (int i = 0; i < rxmessage.length; i++) + for (int j = 0; j < rxmessage.length; j++) { - sprintf(str + (i * 6), "[0x%02X]", rxmessage.data[i]); + sprintf(str + (j * 6), "[0x%02X]", rxmessage.data[j]); } dprintf(DEBUG_NORMAL, GREEN" [CEC] received message %s to %s (0x%02X>>0x%02X) '%s' (%s)\n" NORMAL, ToString((cec_logical_address)rxmessage.initiator), rxmessage.destination == 0xf ? "all" : ToString((cec_logical_address)rxmessage.destination), rxmessage.initiator, rxmessage.destination, ToString((cec_opcode)rxmessage.opcode), str);