Skip to contentSkip to conversation

tst_test.h: Turn 1 bit tst_test members to unsigned

PATCH In review Petr Vorel 2 participants 3 messages May 6, 2024 – May 7, 2024

lore
Share & tools
lore

Petr Vorel

author
#0 lore raw

PATCH 1/1 tst_test.h: Turn 1 bit tst_test members to unsigned

This fixes clang warning:

test22.c:33:17: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]

---
 include/tst_test.h | 40 ++++++++++++++++++++--------------------
 1 file changed, 20 insertions(+), 20 deletions(-)
include/tst_test.h +20 -20
index be09bce27..69587917f 100644
@@ -476,26 +476,26 @@ struct tst_ulimit_val {
 
 	const char *tconf_msg;
 
-	int needs_tmpdir:1;
-	int needs_root:1;
-	int forks_child:1;
-	int needs_device:1;
-	int needs_checkpoints:1;
-	int needs_overlay:1;
-	int format_device:1;
-	int mount_device:1;
-	int needs_rofs:1;
-	int child_needs_reinit:1;
-	int needs_devfs:1;
-	int restore_wallclock:1;
-
-	int all_filesystems:1;
-
-	int skip_in_lockdown:1;
-	int skip_in_secureboot:1;
-	int skip_in_compat:1;
-
-	int needs_hugetlbfs:1;
+	unsigned int needs_tmpdir:1;
+	unsigned int needs_root:1;
+	unsigned int forks_child:1;
+	unsigned int needs_device:1;
+	unsigned int needs_checkpoints:1;
+	unsigned int needs_overlay:1;
+	unsigned int format_device:1;
+	unsigned int mount_device:1;
+	unsigned int needs_rofs:1;
+	unsigned int child_needs_reinit:1;
+	unsigned int needs_devfs:1;
+	unsigned int restore_wallclock:1;
+
+	unsigned int all_filesystems:1;
+
+	unsigned int skip_in_lockdown:1;
+	unsigned int skip_in_secureboot:1;
+	unsigned int skip_in_compat:1;
+
+	unsigned int needs_hugetlbfs:1;
 
 	const char *const *skip_filesystems;
 
Signature · 5 lines
2.43.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Petr Vorel

This fixes clang warning:

test22.c:33:17: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]

---

Quoted 62 lines
 include/tst_test.h | 40 ++++++++++++++++++++--------------------
 1 file changed, 20 insertions(+), 20 deletions(-)
include/tst_test.h +20 -21
index be09bce27..69587917f 100644
@@ -476,26 +476,26 @@ struct tst_ulimit_val {
 
        const char *tconf_msg;
 
-       int needs_tmpdir:1;
-       int needs_root:1;
-       int forks_child:1;
-       int needs_device:1;
-       int needs_checkpoints:1;
-       int needs_overlay:1;
-       int format_device:1;
-       int mount_device:1;
-       int needs_rofs:1;
-       int child_needs_reinit:1;
-       int needs_devfs:1;
-       int restore_wallclock:1;
-
-       int all_filesystems:1;
-
-       int skip_in_lockdown:1;
-       int skip_in_secureboot:1;
-       int skip_in_compat:1;
-
-       int needs_hugetlbfs:1;
+       unsigned int needs_tmpdir:1;
+       unsigned int needs_root:1;
+       unsigned int forks_child:1;
+       unsigned int needs_device:1;
+       unsigned int needs_checkpoints:1;
+       unsigned int needs_overlay:1;
+       unsigned int format_device:1;
+       unsigned int mount_device:1;
+       unsigned int needs_rofs:1;
+       unsigned int child_needs_reinit:1;
+       unsigned int needs_devfs:1;
+       unsigned int restore_wallclock:1;
+
+       unsigned int all_filesystems:1;
+
+       unsigned int skip_in_lockdown:1;
+       unsigned int skip_in_secureboot:1;
+       unsigned int skip_in_compat:1;
+
+       unsigned int needs_hugetlbfs:1;
 
        const char *const *skip_filesystems;
 
--

2.43.0

--
Mailing list info: https://lists.linux.it/listinfo/ltp

Signature · 5 lines
Regards,
Li Wang

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
author
#2 lore raw

Hi Li,

thanks for your review, merged!

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp