summaryrefslogtreecommitdiffstats
path: root/misc/sigrok-firmware-fx2lafw/patches/00-fx2lafw__silence_integer_overflow_compile_warnings.patch
blob: 57143d0f91ea6b2d884ef23a148f1bb3b72a2415 (plain)
From: Gerhard Sittig <redacted>
Date: Mon, 22 Feb 2021 19:17:02 +0000 (+0100)
Subject: fx2lafw: silence integer overflow compile warnings
X-Git-Url: http://sigrok.org/gitweb/?p=sigrok-firmware-fx2lafw.git;a=commitdiff_plain;h=61f1c8fc33ce959f167f6bcb5ba3b0959d60b038

fx2lafw: silence integer overflow compile warnings

Explicitly mark literals for control bitfield values as unsigned, to
avoid compiler warnings when the MSB gets set in assignments to a byte.
This kind of follows up to commit f6ef2ff72979 after commit b283ba837a11
re-introduced the warning.
---

diff --git a/gpif-acquisition.c b/gpif-acquisition.c
index 96476ccc..c6ba52a0 100644
--- a/gpif-acquisition.c
+++ b/gpif-acquisition.c
@@ -161,7 +161,7 @@ static void gpif_make_data_dp_state(volatile BYTE *pSTATE)
 	 * BRANCH
 	 * Branch to IDLE if condition is true, back to S0 otherwise.
 	 */
-	pSTATE[0] = (1 << 7) | (7 << 3) | (0 << 0);
+	pSTATE[0] = (1u << 7) | (7u << 3) | (0u << 0);
 
 	/*
 	 * OPCODE