From e40933b97b4903549202973f720de760f56e9078 Mon Sep 17 00:00:00 2001 From: Spencer Russell Date: Thu, 28 Jul 2016 00:55:56 -0400 Subject: [PATCH] fixes 0.5 depwarns except AsyncCondition stuff --- src/PortAudio.jl | 8 +++++--- src/libportaudio.jl | 4 ++-- test/runtests.jl | 6 +++++- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/PortAudio.jl b/src/PortAudio.jl index 134a842..e1333e9 100644 --- a/src/PortAudio.jl +++ b/src/PortAudio.jl @@ -5,6 +5,8 @@ module PortAudio using SampledSignals using Devectorize using RingBuffers +using Compat +import Compat: UTF8String # Get binary dependencies loaded from BinDeps include( "../deps/deps.jl") @@ -42,8 +44,8 @@ type PortAudioDevice end PortAudioDevice(info::PaDeviceInfo, idx) = PortAudioDevice( - bytestring(info.name), - bytestring(Pa_GetHostApiInfo(info.host_api).name), + unsafe_string(info.name), + unsafe_string(Pa_GetHostApiInfo(info.host_api).name), info.max_input_channels, info.max_output_channels, 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""" function fieldptr{T}(obj::T, field::Symbol) fieldnum = findfirst(fieldnames(T), field) - offset = fieldoffsets(T)[fieldnum] + offset = fieldoffset(T, fieldnum) FT = fieldtype(T, field) Ptr{FT}(pointer_from_objref(obj) + offset) diff --git a/src/libportaudio.jl b/src/libportaudio.jl index bcdae94..ab4a618 100644 --- a/src/libportaudio.jl +++ b/src/libportaudio.jl @@ -57,7 +57,7 @@ Pa_GetVersion() = ccall((:Pa_GetVersion, libportaudio), Cint, ()) function Pa_GetVersionText() versionPtr = ccall((:Pa_GetVersionText, libportaudio), Ptr{Cchar}, ()) - bytestring(versionPtr) + unsafe_string(versionPtr) end # Host API Functions @@ -69,7 +69,7 @@ end # all the host APIs on the system by iterating through those 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 1 => "Direct Sound", 2 => "MME", diff --git a/test/runtests.jl b/test/runtests.jl index 453feb7..0fcfcdc 100755 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,6 +1,10 @@ #!/usr/bin/env julia -using BaseTestNext +if VERSION >= v"0.5.0-dev+7720" + using Base.Test +else + using BaseTestNext +end using PortAudio using SampledSignals