[PATCH v2 2/8] tests: change the type of "plen" variable to unsigned int

JingPiao Chen chenjingpiao at gmail.com
Fri Jul 7 03:23:48 UTC 2017


* tests/test_nlattr.h (TEST_NLATTR_OBJECT, TEST_NLATTR_ARRAY):
Change the type of "plen" variable to unsigned int.
---
 tests/test_nlattr.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/test_nlattr.h b/tests/test_nlattr.h
index 8cbb211..466c138 100644
--- a/tests/test_nlattr.h
+++ b/tests/test_nlattr.h
@@ -99,7 +99,8 @@ print_nlattr(const unsigned int nla_len, const char *const nla_type)
 			   init_msg_, print_msg_,			\
 			   nla_type_, pattern_, obj_, ...)		\
 	do {								\
-		const int plen = sizeof(obj_) - 1 > DEFAULT_STRLEN	\
+		const unsigned int plen =				\
+			sizeof(obj_) - 1 > DEFAULT_STRLEN		\
 			? DEFAULT_STRLEN : (int) sizeof(obj_) - 1;	\
 		/* len < sizeof(obj_) */				\
 		TEST_NLATTR_((fd_), (nlh0_), (hdrlen_),			\
@@ -129,7 +130,7 @@ print_nlattr(const unsigned int nla_len, const char *const nla_type)
 			  init_msg_, print_msg_,			\
 			  nla_type_, pattern_, obj_, print_elem_)	\
 	do {								\
-		const int plen =					\
+		const unsigned int plen =				\
 			sizeof((obj_)[0]) - 1 > DEFAULT_STRLEN		\
 			? DEFAULT_STRLEN : (int) sizeof((obj_)[0]) - 1;	\
 		/* len < sizeof((obj_)[0]) */				\
-- 
2.7.4





More information about the Strace-devel mailing list