[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 04/08: audio osx: change copying of a UInt3
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 04/08: 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. |
Date: |
Tue, 31 Mar 2015 20:37:40 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
jcorgan pushed a commit to branch maint
in repository gnuradio.
commit 693fccf63657ccdb00f4e1fe33aa2a60f12244cd
Author: Michael Dickens <address@hidden>
Date: Wed Mar 18 12:53:43 2015 -0400
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.
---
gr-audio/lib/osx/osx_impl.cc | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/gr-audio/lib/osx/osx_impl.cc b/gr-audio/lib/osx/osx_impl.cc
index c4e580b..92a2c24 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;
- [Commit-gnuradio] [gnuradio] branch maint updated (48b29c4 -> d817c5f), git, 2015/03/31
- [Commit-gnuradio] [gnuradio] 01/08: qtgui: clarify return value, to make some compilers happier., git, 2015/03/31
- [Commit-gnuradio] [gnuradio] 05/08: audio osx: use memcpy instead of bcopy, to be consistent with the rest of GNU Radio., git, 2015/03/31
- [Commit-gnuradio] [gnuradio] 02/08: filter: use correct function for argument type; where's std::abs when you need it to auto-type?, git, 2015/03/31
- [Commit-gnuradio] [gnuradio] 08/08: logger: fix macro name in comments., git, 2015/03/31
- [Commit-gnuradio] [gnuradio] 03/08: blocks: fixmsg handler pmt length / size comparison to be valid., git, 2015/03/31
- [Commit-gnuradio] [gnuradio] 06/08: blocks: use explicit type conversion to compare the same types., git, 2015/03/31
- [Commit-gnuradio] [gnuradio] 07/08: pager & digital: add explicit type to constants that could be interpreted in other ways, to make various compilers happy., git, 2015/03/31
- [Commit-gnuradio] [gnuradio] 04/08: 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.,
git <=