[lttng-dev] [PATCH babeltrace 1/1] Cleanup: test_bitfield: nr_bits should be unsigned

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Thu May 30 16:15:22 EDT 2019


Should not have any effect on the code behavior, but removes
useless type conversions between unsigned and signed types.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>
Change-Id: I39096ab89936875009a68d3ab8a4546c7f1eb8ae
---
 tests/lib/test_bitfield.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/lib/test_bitfield.c b/tests/lib/test_bitfield.c
index 05547c07..9e9a52ad 100644
--- a/tests/lib/test_bitfield.c
+++ b/tests/lib/test_bitfield.c
@@ -380,7 +380,7 @@ void run_test_unsigned(unsigned int src_ui, unsigned long long src_ull)
 
 void run_test_signed_write(int src_i, long long src_ll)
 {
-	int nrbits_i, nrbits_ll;
+	unsigned int nrbits_i, nrbits_ll;
 	union {
 		signed char c[TEST_LEN];
 		short s[TEST_LEN/sizeof(short)];
@@ -500,7 +500,8 @@ void run_test_signed_write(int src_i, long long src_ll)
 
 void run_test_signed_read(int src_i, long long src_ll)
 {
-	int nrbits_i, nrbits_ll, readval_i;
+	unsigned int nrbits_i, nrbits_ll;
+	int readval_i;
 	union {
 		unsigned char c[TEST_LEN];
 		unsigned short s[TEST_LEN/sizeof(unsigned short)];
-- 
2.11.0



More information about the lttng-dev mailing list