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

Arguments of arf_mul_2exp_si: mutability #2

Closed
Chris00 opened this issue Jan 5, 2022 · 4 comments · Fixed by #4
Closed

Arguments of arf_mul_2exp_si: mutability #2

Chris00 opened this issue Jan 5, 2022 · 4 comments · Fixed by #4

Comments

@Chris00
Copy link
Contributor

Chris00 commented Jan 5, 2022

The header file arf.h declares

ARF_INLINE void
arf_mul_2exp_si(arf_t y, const arf_t x, slong e)

I therefore do not understand by the second argument of arb_sys::arf::arf_mul_2exp_si is mutable:

pub unsafe extern "C" fn arf_mul_2exp_si(
    y: *mut arf_struct, 
    x: *mut arf_struct, 
    e: mp_limb_signed_t
)
@wjyoumans
Copy link
Owner

The bindings are auto generated using rust-bindgen which for some reason doesn't notice some arguments should be const and instead makes them mutable. So far I've been manually correcting them but I plan on asking the bindgen people about it.

Feel free to correct the bindings in arf.rs and make a pull request if you would like it fixed right away, otherwise I will get to it when I can.

@Chris00
Copy link
Contributor Author

Chris00 commented Jan 5, 2022

The same is true for arf_printd:

ARF_INLINE void
arf_printd(const arf_t y, slong d)

v.s.

pub unsafe extern "C" fn arf_printd(
    y: *mut arf_struct, 
    d: mp_limb_signed_t
)

@Chris00
Copy link
Contributor Author

Chris00 commented Jan 5, 2022

Feel free to correct the bindings in arf.rs and make a pull request

I will.

@wjyoumans
Copy link
Owner

It seems the issue is known and unresolved at rust-bindgen. See the mention above.

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 a pull request may close this issue.

2 participants