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

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


On Thursday 12 February 2015 14:11:40 Krzysztof Opasiak wrote:
> Replace cast_to_largest_integral_type() with its ptr
> versions in macros which are supposed to take pointer
> as their parameter.
> 

I don't really see what you are trying to fix here. I think the patch is 
wrong. Can you please create a test case which shows the issue you're trying 
to solve?

Thanks,


	-- andreas

> 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 1d6abd1..d82dbf8 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
> 
>  #ifdef DOXYGEN

-- 
Andreas Schneider                   GPG-ID: CC014E3D
www.cryptomilk.org                asn@xxxxxxxxxxxxxx


References:
[PATCH v2 0/5] cmocka: Make casting macros publicKrzysztof Opasiak <k.opasiak@xxxxxxxxxxx>
[PATCH v2 4/5] cmocka: Use cast_ptr_to_largest_integral_type in suitable placesKrzysztof Opasiak <k.opasiak@xxxxxxxxxxx>