lkml.org 
[lkml]   [2009]   [Dec]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/4] perf_event: fix getting point
On Wed, Dec 16, 2009 at 09:03:47AM +0800, Xiao Guangrong wrote:
> >> @@ -1919,13 +1919,32 @@ raw_field_value(struct event *event, const char *name, void *data)
> >>
> >> void *raw_field_ptr(struct event *event, const char *name, void *data)
> >> {
> >> + void *ptr;
> >> + unsigned long long value;
> >> +
> >> + value = raw_field_value(event, name, data);
> >> +
> >> + if (!value)
> >> + return NULL;
> >> +
> >> + memcpy(&ptr, &value, sizeof(ptr));
> >
> >
> >
> > Could you perhaps just do
> >
> > ptr = (void *)value; ?
> >
>
> We can't do it in x86_32:
> error: cast to pointer from integer of different size


You can just do:

ptr = (void *)(unsigned long)value;



\
 
 \ /
  Last update: 2009-12-16 02:25    [W:0.121 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site