JuliaLang/julia — pull request #4497 by IainNZ (2013-10-12 22:34:54+00:00)
Title: Add new pointer_to_array method for generic Integers, e.g. Cint

This came up while writing a callback for an external solver. The function I was trying to write for the callback looks something like.

```julia
function eval_f(n::Cint, x_ptr::Ptr{Float64}, user_data::Ptr{Void})
x = pointer_to_array(x_ptr, n)
# ... calculate
return(result)
end
```

However ``pointer_to_array`` can only handle arguments of type Int, which is problem on 64-bit Julia given that Cint is 32bit, and Int is 64 bit. This adds another method that automatically handles the conversion. I'm not sure what should be done with the Dims case, given that Dims is also defined by Int, not Integer.