foxygit / doom Log in
commit 0de7210f96259b4bc6850d4119e8069e31c4a14c
Author:     Simon Howard <fraggle@gmail.com>
AuthorDate: Sun Sep 6 18:15:52 2009 +0000
Commit:     Simon Howard <fraggle@gmail.com>
CommitDate: Sun Sep 6 18:15:52 2009 +0000

    Fixes for MSVC compile (thanks entryway).

    Subversion-branch: /trunk/chocolate-doom
    Subversion-revision: 1657
---
 src/i_main.c     | 4 ++--
 src/i_sdlsound.c | 7 +++++--
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/i_main.c b/src/i_main.c
index 03f8a5ac..cdfb531a 100644
--- a/src/i_main.c
+++ b/src/i_main.c
@@ -47,7 +47,7 @@ static void LockCPUAffinity(void)
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>

-typedef BOOL WINAPI (*SetAffinityFunc)(HANDLE hProcess, DWORD_PTR mask);
+typedef BOOL (WINAPI *SetAffinityFunc)(HANDLE hProcess, DWORD mask);

 // This is a bit more complicated than it really needs to be.  We really
 // just need to call the SetProcessAffinityMask function, but that
@@ -74,7 +74,7 @@ static void LockCPUAffinity(void)

     // Find the SetProcessAffinityMask function.

-    SetAffinity = GetProcAddress(kernel32_dll, "SetProcessAffinityMask");
+    SetAffinity = (SetAffinityFunc)GetProcAddress(kernel32_dll, "SetProcessAffinityMask");

     // If the function was not found, we are on an old (Win9x) system
     // that doesn't have this function.  That's no problem, because
diff --git a/src/i_sdlsound.c b/src/i_sdlsound.c
index bb8229e4..ea5c92a5 100644
--- a/src/i_sdlsound.c
+++ b/src/i_sdlsound.c
@@ -275,12 +275,15 @@ static boolean LoadSoundLump(int sound,
 			     uint32_t *length,
 			     byte **data_ref)
 {
+    int lumplen;
+    byte *data;
+
     // Load the sound

     *lumpnum    = S_sfx[sound].lumpnum;
     *data_ref   = W_CacheLumpNum(*lumpnum, PU_STATIC);
-    int lumplen = W_LumpLength(*lumpnum);
-    byte *data  = *data_ref;
+    lumplen = W_LumpLength(*lumpnum);
+    data  = *data_ref;

     // Ensure this is a valid sound