Change in osmo-ccid-firmware[master]: prettier slot bitmask code

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Thu Nov 28 15:23:49 UTC 2019


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/16295 )

Change subject: prettier slot bitmask code
......................................................................

prettier slot bitmask code

Change-Id: Ia70c589c06d8d786afac54063d41e775e8d850c2
---
M sysmoOCTSIM/main.c
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/sysmoOCTSIM/main.c b/sysmoOCTSIM/main.c
index e3d7034..07c5af8 100644
--- a/sysmoOCTSIM/main.c
+++ b/sysmoOCTSIM/main.c
@@ -273,8 +273,8 @@
 
 	for(int i = 0; i <8; i++) {
 		uint8_t byteidx = i >> 2;
-		uint8_t old_bit = old_bm & (1 << i);
-		uint8_t new_bit = new_bm & (1 << i);
+		uint8_t old_bit = (old_bm >> i) & 1;
+		uint8_t new_bit = (new_bm >> i) & 1;
 		uint8_t bv;
 		if (old_bit == new_bit && new_bit == 0)
 			bv = 0x00;

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/16295
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ccid-firmware
Gerrit-Branch: master
Gerrit-Change-Id: Ia70c589c06d8d786afac54063d41e775e8d850c2
Gerrit-Change-Number: 16295
Gerrit-PatchSet: 4
Gerrit-Owner: Hoernchen <ewild at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20191128/a0952f8e/attachment.htm>


More information about the gerrit-log mailing list