Skip to content
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

Merged
merged 4 commits into from
Aug 25, 2017
Merged

Misc remove &x ccall syntax #23301

merged 4 commits into from
Aug 25, 2017

Conversation

musm
Copy link
Contributor

@musm musm commented Aug 17, 2017

No description provided.

ccall(($(string("mpfr_const_", def)), :libmpfr),
Cint, (Ref{BigFloat}, Int32), c, MPFR.ROUNDING_MODE[])
return c
return c[]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Contributor Author

@musm musm Aug 17, 2017

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 ?

Copy link
Contributor

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.

Copy link
Contributor Author

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}),
Copy link
Contributor

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).

@musm
Copy link
Contributor Author

musm commented Aug 17, 2017

Thanks for the review @yuyichao

@musm
Copy link
Contributor Author

musm commented Aug 18, 2017

part of #6080 (ref)

@musm
Copy link
Contributor Author

musm commented Aug 21, 2017

good to merge?

@rfourquet rfourquet merged commit 6922ce8 into JuliaLang:master Aug 25, 2017
@musm musm deleted the syn branch May 15, 2019 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants