[OpenBIOS] [RFC 2/5] Fix for pointer2cell() and cell2pointer()

Blue Swirl blauwirbel at gmail.com
Wed Oct 27 21:48:53 CEST 2010


On Tue, Oct 26, 2010 at 11:08 PM, Andreas Färber <andreas.faerber at web.de> wrote:
> ---
>  include/kernel/stack.h |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/kernel/stack.h b/include/kernel/stack.h
> index 809ffe9..44fef0f 100644
> --- a/include/kernel/stack.h
> +++ b/include/kernel/stack.h
> @@ -31,8 +31,8 @@ typedef ucell phandle_t;
>
>
>  #ifdef NATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH
> -#define pointer2cell(x) ((ucell)(x))
> -#define cell2pointer(x) ((u8 *)(x))
> +#define pointer2cell(x) ((ucell)(uintptr_t)(x))
> +#define cell2pointer(x) ((u8 *)(uintptr_t)(x))

Perhaps this should be changed to inline function which returns void
*, then we may avoid a few casts.



More information about the OpenBIOS mailing list