diff options
author | Michael Dickens <michael.dickens@ettus.com> | 2015-03-18 12:53:43 -0400 |
---|---|---|
committer | Michael Dickens <michael.dickens@ettus.com> | 2015-03-31 12:23:27 -0400 |
commit | 693fccf63657ccdb00f4e1fe33aa2a60f12244cd (patch) | |
tree | 23688915b902d832f8f22f6e4814b71647d4a3de /gr-audio/lib | |
parent | fafd8c275505e7851565ef1f81dbcceb7693c18e (diff) |
audio osx: change copying of a UInt32 type into a string by using memcpy instead of a direct pointer manipulation, to make some newer compilers happy.
Diffstat (limited to 'gr-audio/lib')
-rw-r--r-- | gr-audio/lib/osx/osx_impl.cc | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/gr-audio/lib/osx/osx_impl.cc b/gr-audio/lib/osx/osx_impl.cc index c4e580b132..92a2c24150 100644 --- a/gr-audio/lib/osx/osx_impl.cc +++ b/gr-audio/lib/osx/osx_impl.cc @@ -42,9 +42,9 @@ operator<< (std::ostream& s, const AudioStreamBasicDescription& asbd) { - char format_id[5]; - *((UInt32*)format_id) = asbd.mFormatID; - format_id[4] = 0; + char format_id[sizeof(asbd.mFormatID)+1]; + memcpy((void*)(&asbd.mFormatID), format_id, sizeof(asbd.mFormatID)); + format_id[sizeof(asbd.mFormatID)] = 0; s << " Sample Rate : " << asbd.mSampleRate << std::endl; s << " Format ID : " << format_id << std::endl; s << " Format Flags : " << asbd.mFormatFlags << std::endl; @@ -166,10 +166,6 @@ find_audio_devices OSStatus err = noErr; - // set the default audio device id to "unknown" - - AudioDeviceID d_ad_id = kAudioDeviceUnknown; - // retrieve the size of the array of known audio device IDs UInt32 prop_size = 0; |