From 73adcd6b88d78c00a2061c09cc62d9bcff16f897 Mon Sep 17 00:00:00 2001 From: Bernhard Miklautz Date: Wed, 6 Mar 2013 00:24:03 +0100 Subject: [PATCH] server/Mac: fixes to build without xcode --- server/Mac/mf_mountain_lion.c | 7 ++++--- server/Mac/mf_rdpsnd.c | 3 ++- server/Mac/mf_rdpsnd.h | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/server/Mac/mf_mountain_lion.c b/server/Mac/mf_mountain_lion.c index 3e0155fbf..88d59033a 100644 --- a/server/Mac/mf_mountain_lion.c +++ b/server/Mac/mf_mountain_lion.c @@ -48,6 +48,7 @@ void (^streamHandler)(CGDisplayStreamFrameStatus, uint64_t, IOSurfaceRef, CGDisp RFX_RECT rect; unsigned long offset_beg; unsigned long stride; + int i; rect.x = 0; rect.y = 0; @@ -64,7 +65,7 @@ void (^streamHandler)(CGDisplayStreamFrameStatus, uint64_t, IOSurfaceRef, CGDisp stride = IOSurfaceGetBytesPerRow(frameSurface); //memcpy(localBuf, baseAddress + offset_beg, surflen); - for(int i = 0; i < rect.height; i++) + for(i = 0; i < rect.height; i++) { offset_beg = (stride * (rect.y + i) + (rect.x * 4)); memcpy(localBuf + offset_beg, @@ -232,7 +233,7 @@ int mf_mlion_get_dirty_region(RFX_RECT* invalid) int mf_mlion_peek_dirty_region(RFX_RECT* invalid) { - size_t num_rects; + size_t num_rects, i; CGRect dirtyRegion; const CGRect * rects = CGDisplayStreamUpdateGetRects(lastUpdate, kCGDisplayStreamUpdateDirtyRects, &num_rects); @@ -242,7 +243,7 @@ int mf_mlion_peek_dirty_region(RFX_RECT* invalid) } dirtyRegion = *rects; - for (size_t i = 0; i < num_rects; i++) + for (i = 0; i < num_rects; i++) { dirtyRegion = CGRectUnion(dirtyRegion, *(rects+i)); } diff --git a/server/Mac/mf_rdpsnd.c b/server/Mac/mf_rdpsnd.c index 0bd40d7ef..679cf08f1 100644 --- a/server/Mac/mf_rdpsnd.c +++ b/server/Mac/mf_rdpsnd.c @@ -46,6 +46,7 @@ static void mf_peer_rdpsnd_activated(rdpsnd_server_context* context) { OSStatus status; + int i; recorderState.dataFormat.mSampleRate = 44100.0; recorderState.dataFormat.mFormatID = kAudioFormatLinearPCM; @@ -83,7 +84,7 @@ static void mf_peer_rdpsnd_activated(rdpsnd_server_context* context) mf_rdpsnd_derive_buffer_size(recorderState.queue, &recorderState.dataFormat, 0.05, &recorderState.bufferByteSize); - for (int i = 0; i < snd_numBuffers; ++i) + for (i = 0; i < SND_NUMBUFFERS; ++i) { AudioQueueAllocateBuffer(recorderState.queue, recorderState.bufferByteSize, diff --git a/server/Mac/mf_rdpsnd.h b/server/Mac/mf_rdpsnd.h index e5653b39a..e635be7d7 100644 --- a/server/Mac/mf_rdpsnd.h +++ b/server/Mac/mf_rdpsnd.h @@ -43,12 +43,12 @@ void mf_peer_rdpsnd_input_callback (void *inUserD const AudioStreamPacketDescription *inPacketDescs); -static const int snd_numBuffers = 3; +#define SND_NUMBUFFERS 3 struct _AQRecorderState { AudioStreamBasicDescription dataFormat; AudioQueueRef queue; - AudioQueueBufferRef buffers[snd_numBuffers]; + AudioQueueBufferRef buffers[SND_NUMBUFFERS]; AudioFileID audioFile; UInt32 bufferByteSize; SInt64 currentPacket;