We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
We need some native LPython way to do the following casts:
@ccall def cptr_to_i64(p: CPtr) -> i64: pass @ccall def i64_to_cptr(p: i64) -> CPtr: pass def increment_p_i16(p: CPtr, n: i32) -> CPtr: q: i64 = cptr_to_i64(p) q += i64(n * 2) return i64_to_cptr(q)
Currently they are implemented using:
uint64_t cptr_to_i64(void *p) { return (uint64_t)p; } void* i64_to_cptr(uint64_t p) { return (void*)p; }
Rather, I would like to just do:
from lpython import cptr_to_i64, i64_to_cptr def increment_p_i16(p: CPtr, n: i32) -> CPtr: q: i64 = cptr_to_i64(p) q += i64(n * 2) return i64_to_cptr(q)
And LPython will insert appropriate casting nodes in ASR.
The text was updated successfully, but these errors were encountered:
Smit-create
Successfully merging a pull request may close this issue.
We need some native LPython way to do the following casts:
Currently they are implemented using:
Rather, I would like to just do:
And LPython will insert appropriate casting nodes in ASR.
The text was updated successfully, but these errors were encountered: