Skip to content
This repository has been archived by the owner on Mar 4, 2021. It is now read-only.

Commit

Permalink
Further mcs 3.2.3 compilation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
marek-safar authored and abock committed Sep 16, 2013
1 parent 4701c9a commit 4f393d3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/AudioToolbox/AudioFile.cs
Expand Up @@ -1003,7 +1003,7 @@ public IntPtr GetProperty (AudioFileProperty property, out int size)
try {
var r = AudioFileGetProperty (handle, property, ref size, buffer);
if (r == 0){
T t = *(T*) buffer;
T t = (T) Marshal.PtrToStructure (buffer, typeof (T));
return t;
}

Expand Down
9 changes: 4 additions & 5 deletions src/AudioToolbox/AudioQueue.cs
Expand Up @@ -831,8 +831,7 @@ public IntPtr GetProperty (AudioQueueProperty property, out int size)
try {
r = AudioQueueGetProperty (handle, property, buffer, ref size);
if (r == 0){
T result;
result = *(T*) buffer;
T result = (T) Marshal.PtrToStructure (buffer, typeof (T));
return result;
}

Expand Down Expand Up @@ -1057,11 +1056,11 @@ public AudioQueueStatus SetChannelAssignments (params AudioQueueChannelAssignmen
}
}

unsafe static IntPtr MarshalArray<T> (ref T[] array, out int totalSize) where T : struct
unsafe static IntPtr MarshalArray (ref AudioQueueChannelAssignment[] array, out int totalSize)
{
int elementSize = sizeof (T);
int elementSize = sizeof (AudioQueueChannelAssignment);
totalSize = elementSize * array.Length;
var array_ptr = (T*) Marshal.AllocHGlobal (totalSize);
var array_ptr = (AudioQueueChannelAssignment*) Marshal.AllocHGlobal (totalSize);

for (int i = 0; i < array.Length; i++)
array_ptr [i] = array [i];
Expand Down

0 comments on commit 4f393d3

Please sign in to comment.