Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^3: why SvUV() would crop to 32 bits?

by ptizoom (Scribe)
on Jan 04, 2015 at 10:42 UTC ( [id://1112101]=note: print w/replies, xml ) Need Help??


in reply to Re^2: why SvUV() would crop to 32 bits?
in thread why SvUV() would crop to 32 bits?

yes thanks...spot on. the macro woz working all the way, but just the format cropping let me down. (although I must have missed it with gdb.)

so...

printf(":: x%" UVxf " to ...", SvUV($input), $1);
does the job.

and here with a code example showing a few ugly ways to cast back pointers to all sorts...:

%typemap(in) void (* cb)(void *) , void *data , void (cb)(void *){ //if SvGETMAGIC($input) {}; $1 = INT2PTR($1_ltype, SvUV($input)); printf(":: x%" UVxf " to x%lx\n", SvUV($input), $1); { int ret = SWIG_ConvertFunctionPtr($input, (void**)(& $1), 0); printf(":: to x%lx\n", $1); } if(SvGMAGICAL($input)) mg_get($input); $1 = DPTR2FPTR($1_ltype, SvUV($input)); printf("::DPTR2FPTR x%lx to x%lx\n", SvIV($input), $1); }
bot::add_idle_callback x7fc3ff9bc040 , x0 :: x7fc3ff9bc040 to x7fc3ff9bc040 :: to x7fc3ff9bc040 ::DPTR2FPTR x7fc3ff9bc040 to x7fc3ff9bc040 :: x0 to x0 :: to x0 ::DPTR2FPTR x0 to x0 ::in c add_idle_callback xff9bc040 , x0

Replies are listed 'Best First'.
Re^4: why SvUV() would crop to 32 bits?
by ikegami (Patriarch) on Jan 05, 2015 at 15:05 UTC

    Tip:

    You can replace

    if(SvGMAGICAL($input)) mg_get($input);
    with
    SvGETMAGIC($input);

    (Just spotted that in a cursory glance. Didn't look at the rest.)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1112101]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (6)
As of 2024-03-28 16:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found