[PATCH 3/4] coreaudio: Standardize on DRV_SUCCESS/FAILURE status codes for setup functions.

Ken Thomases ken at codeweavers.com
Tue Mar 11 00:59:21 CDT 2008


This changes the sense of the CoreAudio_WaveInit return value, but nobody was
ever checking it, anyway.
---
  dlls/winecoreaudio.drv/audio.c     |   16 ++++++++--------
  dlls/winecoreaudio.drv/coreaudio.c |    4 ++--
  dlls/winecoreaudio.drv/midi.c      |    6 +++---
  dlls/winecoreaudio.drv/mixer.c     |    6 +++---
  4 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/dlls/winecoreaudio.drv/audio.c b/dlls/winecoreaudio.drv/audio.c
index ec5a096..33a5c4f 100644
--- a/dlls/winecoreaudio.drv/audio.c
+++ b/dlls/winecoreaudio.drv/audio.c
@@ -521,15 +521,15 @@ LONG CoreAudio_WaveInit(void)
 
                   (char) (status >> 16),
 
                   (char) (status >> 8),
 
                   (char) status);
-        return 1;
+        return DRV_FAILURE;
      }
      if (CoreAudio_DefaultDevice.outputDeviceID == kAudioDeviceUnknown) {
          ERR("AudioHardwareGetProperty: CoreAudio_DefaultDevice.outputDeviceID 
== kAudioDeviceUnknown\n");
-        return 1;
+        return DRV_FAILURE;
      }

      if ( ! CoreAudio_GetDevCaps() )
-        return 1;
+        return DRV_FAILURE;

 
CoreAudio_DefaultDevice.interface_name=HeapAlloc(GetProcessHeap(),0,strlen(CoreAudio_DefaultDevice.dev_name)+1);
      sprintf(CoreAudio_DefaultDevice.interface_name, "%s", 
CoreAudio_DefaultDevice.dev_name);
@@ -646,7 +646,7 @@ LONG CoreAudio_WaveInit(void)
      if (!messageThreadPortName)
      {
          ERR("Can't create message thread port name\n");
-        return 1;
+        return DRV_FAILURE;
      }

      port_ReceiveInMessageThread = 
CFMessagePortCreateLocal(kCFAllocatorDefault, messageThreadPortName,
@@ -655,7 +655,7 @@ LONG CoreAudio_WaveInit(void)
      {
          ERR("Can't create message thread local port\n");
          CFRelease(messageThreadPortName);
-        return 1;
+        return DRV_FAILURE;
      }

      Port_SendToMessageThread = CFMessagePortCreateRemote(kCFAllocatorDefault, 
messageThreadPortName);
@@ -664,7 +664,7 @@ LONG CoreAudio_WaveInit(void)
      {
          ERR("Can't create port for sending to message thread\n");
          CFRelease(port_ReceiveInMessageThread);
-        return 1;
+        return DRV_FAILURE;
      }

      /* Cannot WAIT for any events because we are called from the loader (which 
has a lock on loading stuff) */
@@ -681,12 +681,12 @@ LONG CoreAudio_WaveInit(void)
          CFRelease(port_ReceiveInMessageThread);
          CFRelease(Port_SendToMessageThread);
          Port_SendToMessageThread = NULL;
-        return 1;
+        return DRV_FAILURE;
      }

      /* The message thread is responsible for releasing 
port_ReceiveInMessageThread. */

-    return 0;
+    return DRV_SUCCESS;
  }

  void CoreAudio_WaveRelease(void)
diff --git a/dlls/winecoreaudio.drv/coreaudio.c b/dlls/winecoreaudio.drv/coreaudio.c
index 56a4fd3..5452d3b 100644
--- a/dlls/winecoreaudio.drv/coreaudio.c
+++ b/dlls/winecoreaudio.drv/coreaudio.c
@@ -45,7 +45,7 @@ static LRESULT CoreAudio_drvLoad(void)
      CoreAudio_WaveInit();
      CoreAudio_MIDIInit();
      CoreAudio_MixerInit();
-    return 1;
+    return DRV_SUCCESS;
  }

  /**************************************************************************
@@ -57,7 +57,7 @@ static LRESULT CoreAudio_drvFree(void)
      CoreAudio_WaveRelease();
      CoreAudio_MIDIRelease();
      CoreAudio_MixerRelease();
-    return 1;
+    return DRV_SUCCESS;
  }

  /**************************************************************************
diff --git a/dlls/winecoreaudio.drv/midi.c b/dlls/winecoreaudio.drv/midi.c
index 01eb453..a052e05 100644
--- a/dlls/winecoreaudio.drv/midi.c
+++ b/dlls/winecoreaudio.drv/midi.c
@@ -109,7 +109,7 @@ LONG CoreAudio_MIDIInit(void)
      {
          CFRelease(name);
          ERR("can't create wineMIDIClient\n");
-        return 0;
+        return DRV_FAILURE;
      }
      CFRelease(name);

@@ -193,7 +193,7 @@ LONG CoreAudio_MIDIInit(void)
          destinations[i].caps.wVoices = 16;
          destinations[i].caps.wNotes = 16;
      }
-    return 1;
+    return DRV_SUCCESS;
  }

  LONG CoreAudio_MIDIRelease(void)
@@ -214,7 +214,7 @@ LONG CoreAudio_MIDIRelease(void)

      HeapFree(GetProcessHeap(), 0, sources);
      HeapFree(GetProcessHeap(), 0, destinations);
-    return 1;
+    return DRV_SUCCESS;
  }


diff --git a/dlls/winecoreaudio.drv/mixer.c b/dlls/winecoreaudio.drv/mixer.c
index 66db8cb..a41b29b 100644
--- a/dlls/winecoreaudio.drv/mixer.c
+++ b/dlls/winecoreaudio.drv/mixer.c
@@ -368,7 +368,7 @@ LONG CoreAudio_MixerInit(void)
              (char) (status >> 16),
              (char) (status >> 8),
              (char) status);
-        return 0;
+        return DRV_FAILURE;
      }

      numLines = propertySize / sizeof(AudioDeviceID);
@@ -495,7 +495,7 @@ LONG CoreAudio_MixerInit(void)
      MIX_FillControls();

      HeapFree(GetProcessHeap(), 0, deviceArray);
-    return 1;
+    return DRV_SUCCESS;

  error:
      if (mixer.lines)
@@ -510,7 +510,7 @@ error:
      HeapFree(GetProcessHeap(), 0, deviceArray);
      if (mixer.mixerCtrls)
          HeapFree(GetProcessHeap(), 0, mixer.mixerCtrls);
-    return 0;
+    return DRV_FAILURE;
  }

  /**************************************************************************
-- 
1.5.3.6





More information about the wine-patches mailing list