-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Misc remove &x
ccall syntax
#23301
Misc remove &x
ccall syntax
#23301
Conversation
base/irrationals.jl
Outdated
ccall(($(string("mpfr_const_", def)), :libmpfr), | ||
Cint, (Ref{BigFloat}, Int32), c, MPFR.ROUNDING_MODE[]) | ||
return c | ||
return c[] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am following the suggestion here JuliaMath/SpecialFunctions.jl#44 (comment) isn't this more explicit and clear ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Ref is not doing anything and you ARE mutating the BigFloat
so adding a Ref
seems like a bad idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK thank you very much for clarifying this! Droped the last commit. Other than that is this LGTY?
base/printf.jl
Outdated
@@ -1130,8 +1130,8 @@ function bigfloat_printf(out, d, flags::String, width::Int, precision::Int, c::C | |||
@assert length(printf_fmt) == fmt_len | |||
bufsiz = length(DIGITS) | |||
lng = ccall((:mpfr_snprintf,:libmpfr), Int32, | |||
(Ptr{UInt8}, Culong, Ptr{UInt8}, Ptr{BigFloat}...), | |||
DIGITS, bufsiz, printf_fmt, &d) | |||
(Ptr{UInt8}, Culong, Ptr{UInt8}, Ref{BigFloat}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep the ...
It can affect calling convention (and does on x86_64).
Thanks for the review @yuyichao |
part of #6080 (ref) |
good to merge? |
No description provided.