fixes 0.5 depwarns except AsyncCondition stuff

This commit is contained in:
Spencer Russell 2016-07-28 00:55:56 -04:00
parent 6433b6fb93
commit e40933b97b
3 changed files with 12 additions and 6 deletions

View file

@ -5,6 +5,8 @@ module PortAudio
using SampledSignals using SampledSignals
using Devectorize using Devectorize
using RingBuffers using RingBuffers
using Compat
import Compat: UTF8String
# Get binary dependencies loaded from BinDeps # Get binary dependencies loaded from BinDeps
include( "../deps/deps.jl") include( "../deps/deps.jl")
@ -42,8 +44,8 @@ type PortAudioDevice
end end
PortAudioDevice(info::PaDeviceInfo, idx) = PortAudioDevice( PortAudioDevice(info::PaDeviceInfo, idx) = PortAudioDevice(
bytestring(info.name), unsafe_string(info.name),
bytestring(Pa_GetHostApiInfo(info.host_api).name), unsafe_string(Pa_GetHostApiInfo(info.host_api).name),
info.max_input_channels, info.max_input_channels,
info.max_output_channels, info.max_output_channels,
idx) idx)
@ -60,7 +62,7 @@ devnames() = join(["\"$(dev.name)\"" for dev in devices()], "\n")
"""Give a pointer to the given field within a Julia object""" """Give a pointer to the given field within a Julia object"""
function fieldptr{T}(obj::T, field::Symbol) function fieldptr{T}(obj::T, field::Symbol)
fieldnum = findfirst(fieldnames(T), field) fieldnum = findfirst(fieldnames(T), field)
offset = fieldoffsets(T)[fieldnum] offset = fieldoffset(T, fieldnum)
FT = fieldtype(T, field) FT = fieldtype(T, field)
Ptr{FT}(pointer_from_objref(obj) + offset) Ptr{FT}(pointer_from_objref(obj) + offset)

View file

@ -57,7 +57,7 @@ Pa_GetVersion() = ccall((:Pa_GetVersion, libportaudio), Cint, ())
function Pa_GetVersionText() function Pa_GetVersionText()
versionPtr = ccall((:Pa_GetVersionText, libportaudio), Ptr{Cchar}, ()) versionPtr = ccall((:Pa_GetVersionText, libportaudio), Ptr{Cchar}, ())
bytestring(versionPtr) unsafe_string(versionPtr)
end end
# Host API Functions # Host API Functions
@ -69,7 +69,7 @@ end
# all the host APIs on the system by iterating through those values. # all the host APIs on the system by iterating through those values.
# PaHostApiTypeId values # PaHostApiTypeId values
const pa_host_api_names = Dict{PaHostApiTypeId, ASCIIString}( const pa_host_api_names = Dict{PaHostApiTypeId, UTF8String}(
0 => "In Development", # use while developing support for a new host API 0 => "In Development", # use while developing support for a new host API
1 => "Direct Sound", 1 => "Direct Sound",
2 => "MME", 2 => "MME",

View file

@ -1,6 +1,10 @@
#!/usr/bin/env julia #!/usr/bin/env julia
if VERSION >= v"0.5.0-dev+7720"
using Base.Test
else
using BaseTestNext using BaseTestNext
end
using PortAudio using PortAudio
using SampledSignals using SampledSignals