Skip to content

Commit

Permalink
Merge pull request #57 from andreasnoack/master
Browse files Browse the repository at this point in the history
Updates for Julia 0.6
  • Loading branch information
kbarbary committed Jan 22, 2017
2 parents 990aacb + 89807df commit 60c6076
Show file tree
Hide file tree
Showing 9 changed files with 251 additions and 251 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Expand Up @@ -3,7 +3,6 @@ os:
- linux
- osx
julia:
- 0.3
- 0.4
- 0.5
- nightly
Expand Down
2 changes: 1 addition & 1 deletion REQUIRE
@@ -1,3 +1,3 @@
julia 0.3
julia 0.4
BinDeps 0.3.12
Compat 0.8.6
4 changes: 2 additions & 2 deletions appveyor.yml
@@ -1,9 +1,9 @@
environment:
matrix:
- JULIAVERSION: "julialang/bin/winnt/x86/0.3/julia-0.3-latest-win32.exe"
- JULIAVERSION: "julialang/bin/winnt/x64/0.3/julia-0.3-latest-win64.exe"
- JULIAVERSION: "julialang/bin/winnt/x86/0.4/julia-0.4-latest-win32.exe"
- JULIAVERSION: "julialang/bin/winnt/x64/0.4/julia-0.4-latest-win64.exe"
- JULIAVERSION: "julialang/bin/winnt/x86/0.5/julia-0.5-latest-win32.exe"
- JULIAVERSION: "julialang/bin/winnt/x64/0.5/julia-0.5-latest-win64.exe"
- JULIAVERSION: "julianightlies/bin/winnt/x86/julia-latest-win32.exe"
- JULIAVERSION: "julianightlies/bin/winnt/x64/julia-latest-win64.exe"

Expand Down
6 changes: 3 additions & 3 deletions src/fits.jl
Expand Up @@ -55,9 +55,9 @@ function show(io::IO, f::FITS)
else
print(io, "HDUs: ")

names = Array(Compat.ASCIIString, nhdu)
vers = Array(Compat.ASCIIString, nhdu)
types = Array(Compat.ASCIIString, nhdu)
names = Vector{Compat.ASCIIString}(nhdu)
vers = Vector{Compat.ASCIIString}(nhdu)
types = Vector{Compat.ASCIIString}(nhdu)
for i = 1:nhdu
t = fits_movabs_hdu(f.fitsfile, i)
types[i] = (t == :image_hdu ? "Image" :
Expand Down
14 changes: 7 additions & 7 deletions src/header.jl
Expand Up @@ -85,7 +85,7 @@ end
# (null if no key exists or if parsing an existing key is unsuccessful.)
function fits_try_read_keys{T}(f::FITSFile, ::Type{T}, keys)
status = Cint[0]
value = Array(UInt8, 71)
value = Vector{UInt8}(71)
for key in keys
ccall((:ffgkey, libcfitsio), Cint,
(Ptr{Void},Ptr{UInt8},Ptr{UInt8},Ptr{UInt8},Ptr{Cint}),
Expand Down Expand Up @@ -223,17 +223,17 @@ function read_header(hdu::HDU)

# Below, we use a direct call to ffgkyn so that we can keep reusing the
# same buffers.
key = Array(UInt8, 81)
value = Array(UInt8, 81)
comment = Array(UInt8, 81)
key = Vector{UInt8}(81)
value = Vector{UInt8}(81)
comment = Vector{UInt8}(81)
status = Cint[0]

nkeys, morekeys = fits_get_hdrspace(hdu.fitsfile)

# Initialize output arrays
keys = Array(Compat.ASCIIString, nkeys)
values = Array(Any, nkeys)
comments = Array(Compat.ASCIIString, nkeys)
keys = Vector{Compat.ASCIIString}(nkeys)
values = Vector{Any}(nkeys)
comments = Vector{Compat.ASCIIString}(nkeys)
for i=1:nkeys
ccall((:ffgkyn,libcfitsio), Cint,
(Ptr{Void},Cint,Ptr{UInt8},Ptr{UInt8},Ptr{UInt8},Ptr{Cint}),
Expand Down
4 changes: 2 additions & 2 deletions src/image.jl
Expand Up @@ -58,7 +58,7 @@ function read(hdu::ImageHDU)
fits_movabs_hdu(hdu.fitsfile, hdu.ext)
sz = fits_get_img_size(hdu.fitsfile)
bitpix = fits_get_img_equivtype(hdu.fitsfile)
data = Array(TYPE_FROM_BITPIX[bitpix], sz...)
data = Array{TYPE_FROM_BITPIX[bitpix]}(sz...)
fits_read_pix(hdu.fitsfile, data)
data
end
Expand Down Expand Up @@ -119,7 +119,7 @@ function read_internal(hdu::ImageHDU, I::@compat(Union{Range{Int}, Integer, Colo

# construct output array
bitpix = fits_get_img_equivtype(hdu.fitsfile)
data = Array(TYPE_FROM_BITPIX[bitpix], _index_shape(sz, I...))
data = Array{TYPE_FROM_BITPIX[bitpix]}(_index_shape(sz, I...))

fits_read_subset(hdu.fitsfile, firsts, lasts, steps, data)
data
Expand Down

0 comments on commit 60c6076

Please sign in to comment.