From b9371d3a380705f5aa8606252b2586454d6a0e46 Mon Sep 17 00:00:00 2001 From: Aaron Culliney Date: Sun, 7 Jun 2015 12:13:12 -0700 Subject: [PATCH] Refactor : LPDWORD > unsigned long* --- src/audio/ds-shim.h | 6 +++--- src/audio/soundcore-openal.c | 6 +++--- src/audio/win-shim.c | 2 +- src/audio/win-shim.h | 4 +--- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/audio/ds-shim.h b/src/audio/ds-shim.h index 3c79065b..631bc535 100644 --- a/src/audio/ds-shim.h +++ b/src/audio/ds-shim.h @@ -24,7 +24,7 @@ typedef struct IDirectSoundBuffer { int (*GetVolume)(void* _this, long *lplVolume); - int (*GetCurrentPosition)(void* _this, LPDWORD lpdwCurrentPlayCursor, LPDWORD lpdwCurrentWriteCursor); + int (*GetCurrentPosition)(void* _this, unsigned long *lpdwCurrentPlayCursor, unsigned long *lpdwCurrentWriteCursor); int (*Stop)(void* _this); @@ -34,12 +34,12 @@ typedef struct IDirectSoundBuffer { int (*Play)(void* _this, unsigned long dwReserved1, unsigned long dwReserved2, unsigned long dwFlags); // This method obtains a valid write pointer to the sound buffer's audio data - int (*Lock)(void* _this, unsigned long dwWriteCursor, unsigned long dwWriteBytes, void **lplpvAudioPtr1, LPDWORD lpdwAudioBytes1, void **lplpvAudioPtr2, LPDWORD lpdwAudioBytes2, unsigned long dwFlags); + int (*Lock)(void* _this, unsigned long dwWriteCursor, unsigned long dwWriteBytes, void **lplpvAudioPtr1, unsigned long *lpdwAudioBytes1, void **lplpvAudioPtr2, unsigned long *lpdwAudioBytes2, unsigned long dwFlags); // This method releases a locked sound buffer. int (*Unlock)(void* _this, void *lpvAudioPtr1, unsigned long dwAudioBytes1, void *lpvAudioPtr2, unsigned long dwAudioBytes2); - int (*GetStatus)(void* _this, LPDWORD lpdwStatus); + int (*GetStatus)(void* _this, unsigned long *lpdwStatus); int (*UnlockStaticBuffer)(void* _this, unsigned long dwAudioBytes); diff --git a/src/audio/soundcore-openal.c b/src/audio/soundcore-openal.c index 986d54fd..0067f583 100644 --- a/src/audio/soundcore-openal.c +++ b/src/audio/soundcore-openal.c @@ -726,13 +726,13 @@ static long OpenALCreateSoundBuffer(ALBufferParamsStruct *params, ALSoundBufferS (*soundbuf_struct)->_this = voice; (*soundbuf_struct)->SetVolume = (int (*)(void *, long))ALSetVolume; (*soundbuf_struct)->GetVolume = (int (*)(void *, long *))ALGetVolume; - (*soundbuf_struct)->GetCurrentPosition = (int (*)(void *, LPDWORD, LPDWORD))ALGetPosition; + (*soundbuf_struct)->GetCurrentPosition = (int (*)(void *, unsigned long *, unsigned long *))ALGetPosition; (*soundbuf_struct)->Stop = (int (*)(void *))ALStop; (*soundbuf_struct)->Restore = (int (*)(void *))ALRestore; (*soundbuf_struct)->Play = (int (*)(void *, unsigned long, unsigned long, unsigned long))ALPlay; - (*soundbuf_struct)->Lock = (int (*)(void *, unsigned long, unsigned long, void **, LPDWORD, void **, LPDWORD, unsigned long))ALBegin; + (*soundbuf_struct)->Lock = (int (*)(void *, unsigned long, unsigned long, void **, unsigned long *, void **, unsigned long *, unsigned long))ALBegin; (*soundbuf_struct)->Unlock = (int (*)(void *, void *, unsigned long, void *, unsigned long))ALCommit; - (*soundbuf_struct)->GetStatus = (int (*)(void *, LPDWORD))ALGetStatus; + (*soundbuf_struct)->GetStatus = (int (*)(void *, unsigned long *))ALGetStatus; // mockingboard-specific hacks (*soundbuf_struct)->UnlockStaticBuffer = (int (*)(void *, unsigned long))ALCommitStaticBuffer; diff --git a/src/audio/win-shim.c b/src/audio/win-shim.c index af7209c3..189359f3 100644 --- a/src/audio/win-shim.c +++ b/src/audio/win-shim.c @@ -12,7 +12,7 @@ #include "common.h" #include "audio/win-shim.h" -pthread_t CreateThread(void* unused_lpThreadAttributes, int unused_dwStackSize, LPTHREAD_START_ROUTINE lpStartRoutine, void *lpParameter, unsigned long unused_dwCreationFlags, LPDWORD lpThreadId) +pthread_t CreateThread(void* unused_lpThreadAttributes, int unused_dwStackSize, LPTHREAD_START_ROUTINE lpStartRoutine, void *lpParameter, unsigned long unused_dwCreationFlags, unsigned long *lpThreadId) { pthread_t a_thread = 0; int err = 0; diff --git a/src/audio/win-shim.h b/src/audio/win-shim.h index 4d5b77eb..55f36bb5 100644 --- a/src/audio/win-shim.h +++ b/src/audio/win-shim.h @@ -25,8 +25,6 @@ // 2013/09/19 - http://msdn.microsoft.com/en-us/library/windows/desktop/aa383751(v=vs.85).aspx -typedef unsigned long *LPDWORD; - #if !defined(TRUE) #define TRUE true #endif @@ -46,7 +44,7 @@ typedef void *IUnknown; typedef void *(*LPTHREAD_START_ROUTINE)(void *unused); -pthread_t CreateThread(void* unused_lpThreadAttributes, int unused_dwStackSize, LPTHREAD_START_ROUTINE lpStartAddress, void *lpParameter, unsigned long unused_dwCreationFlags, LPDWORD lpThreadId); +pthread_t CreateThread(void* unused_lpThreadAttributes, int unused_dwStackSize, LPTHREAD_START_ROUTINE lpStartAddress, void *lpParameter, unsigned long unused_dwCreationFlags, unsigned long *lpThreadId); #define THREAD_PRIORITY_NORMAL 0 #define THREAD_PRIORITY_TIME_CRITICAL 15