[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 4/5] cmocka: Use cast_ptr_to_largest_integral_type in suitable places


Replace cast_to_largest_integral_type() with its ptr
versions in macros which are supposed to take pointer
as their parameter.

Signed-off-by: Krzysztof Opasiak <k.opasiak@xxxxxxxxxxx>
---
 include/cmocka.h |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/cmocka.h b/include/cmocka.h
index 31ee8ce..2440d03 100644
--- a/include/cmocka.h
+++ b/include/cmocka.h
@@ -178,7 +178,7 @@ void will_return(#function, void *value);
 #else
 #define will_return(function, value) \
     _will_return(#function, __FILE__, __LINE__, \
-                 cast_to_largest_integral_type(value), 1)
+                 cast_ptr_to_largest_integral_type(value), 1)
 #endif
 
 #ifdef DOXYGEN
@@ -199,7 +199,7 @@ void will_return_count(#function, void *value, int count);
 #else
 #define will_return_count(function, value, count) \
     _will_return(#function, __FILE__, __LINE__, \
-                 cast_to_largest_integral_type(value), count)
+                 cast_ptr_to_largest_integral_type(value), count)
 #endif
 
 #ifdef DOXYGEN
@@ -297,7 +297,7 @@ void expect_check(#function, #parameter, #check_function, const void *check_data
 #else
 #define expect_check(function, parameter, check_function, check_data) \
     _expect_check(#function, #parameter, __FILE__, __LINE__, check_function, \
-                  cast_to_largest_integral_type(check_data), NULL, 1)
+                  cast_ptr_to_largest_integral_type(check_data), NULL, 1)
 #endif
 
 #ifdef DOXYGEN
@@ -841,7 +841,7 @@ void check_expected(#parameter);
 #else
 #define check_expected(parameter) \
     _check_expected(__func__, #parameter, __FILE__, __LINE__, \
-                    cast_to_largest_integral_type(parameter))
+                    cast_ptr_to_largest_integral_type(parameter))
 #endif
 
 /** @} */
-- 
1.7.9.5



References:
[PATCH 0/5] cmocka: Make casting macros publicKrzysztof Opasiak <k.opasiak@xxxxxxxxxxx>