[Spice-devel] [PATCH] use more portable SPICE_OFFSETOF instead of offsetof

Christophe Fergeau cfergeau at redhat.com
Tue May 17 15:16:03 UTC 2016


Acked-by: Christophe Fergeau <cfergeau at redhat.com>

On Mon, May 16, 2016 at 05:13:29PM +0100, Frediano Ziglio wrote:
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
>  server/reds.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/server/reds.c b/server/reds.c
> index 9898fe5..1909e6e 100644
> --- a/server/reds.c
> +++ b/server/reds.c
> @@ -442,7 +442,7 @@ uint64_t *stat_add_counter(RedsState *reds, StatNodeRef parent, const char *name
>  
>  void stat_remove_counter(RedsState *reds, uint64_t *counter)
>  {
> -    reds_stat_remove(reds, (SpiceStatNode *)(counter - offsetof(SpiceStatNode, value)));
> +    reds_stat_remove(reds, (SpiceStatNode *)(counter - SPICE_OFFSETOF(SpiceStatNode, value)));
>  }
>  
>  void stat_update_value(RedsState *reds, uint32_t value)
> -- 
> 2.7.4
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20160517/73ea5347/attachment.sig>


More information about the Spice-devel mailing list