aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAlex Chronopoulos <[email protected]>2016-07-29 11:51:38 +0300
committerAlex Chronopoulos <[email protected]>2016-07-29 11:51:38 +0300
commitf1eab4e9da3429d46ba49ef79676815fe1f6ce7f (patch)
tree73fc204d151d0ec7fbf9cb8f6dc53cdd3af35959
parent9995f8d05aa9218852d82e33163ba1a8da116d4f (diff)
downloadcubeb-f1eab4e9da3429d46ba49ef79676815fe1f6ce7f.tar.gz
cubeb-f1eab4e9da3429d46ba49ef79676815fe1f6ce7f.zip
Fix gecko build errors
-rw-r--r--src/cubeb_audiounit.cpp3
-rw-r--r--src/cubeb_utils_unix.h21
-rw-r--r--src/cubeb_utils_win.h3
3 files changed, 20 insertions, 7 deletions
diff --git a/src/cubeb_audiounit.cpp b/src/cubeb_audiounit.cpp
index 1ff9be6..8bbac1b 100644
--- a/src/cubeb_audiounit.cpp
+++ b/src/cubeb_audiounit.cpp
@@ -438,7 +438,6 @@ int
audiounit_init(cubeb ** context, char const * context_name)
{
cubeb * ctx;
- int r;
*context = NULL;
@@ -1290,7 +1289,7 @@ audiounit_stream_init(cubeb * context,
AU_OUT_BUS,
&output_buffer_frames,
sizeof(output_buffer_frames));
- if (noErr != 0) {
+ if (r != noErr) {
PRINT_ERROR_CODE("AudioUnitSetProperty/output/kAudioDevicePropertyBufferFrameSize", r);
audiounit_stream_destroy(stm);
return CUBEB_ERROR;
diff --git a/src/cubeb_utils_unix.h b/src/cubeb_utils_unix.h
index 9b544f1..72041f5 100644
--- a/src/cubeb_utils_unix.h
+++ b/src/cubeb_utils_unix.h
@@ -18,7 +18,6 @@ class owned_critical_section
public:
owned_critical_section()
{
- int r;
pthread_mutexattr_t attr;
pthread_mutexattr_init(&attr);
#ifdef DEBUG
@@ -26,15 +25,27 @@ public:
#else
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_NORMAL);
#endif
- r = pthread_mutex_init(&mutex, &attr);
+
+#ifdef DEBUG
+ int r =
+#endif
+ pthread_mutex_init(&mutex, &attr);
+#ifdef DEBUG
assert(r == 0);
+#endif
+
pthread_mutexattr_destroy(&attr);
}
~owned_critical_section()
{
- int r = pthread_mutex_destroy(&mutex);
+#ifdef DEBUG
+ int r =
+#endif
+ pthread_mutex_destroy(&mutex);
+#ifdef DEBUG
assert(r == 0);
+#endif
}
void enter()
@@ -44,7 +55,7 @@ public:
#endif
pthread_mutex_lock(&mutex);
#ifdef DEBUG
- assert(r == 0, "Deadlock");
+ assert(r == 0 && "Deadlock");
#endif
}
@@ -55,7 +66,7 @@ public:
#endif
pthread_mutex_unlock(&mutex);
#ifdef DEBUG
- assert(r == 0, "Unlocking unlocked mutex");
+ assert(r == 0 && "Unlocking unlocked mutex");
#endif
}
diff --git a/src/cubeb_utils_win.h b/src/cubeb_utils_win.h
index 77dfde3..90e81c1 100644
--- a/src/cubeb_utils_win.h
+++ b/src/cubeb_utils_win.h
@@ -8,6 +8,9 @@
#if !defined(CUBEB_UTILS_WIN)
#define CUBEB_UTILS_WIN
+#include <windows.h>
+#include "cubeb-internal.h"
+
/* This wraps a critical section to track the owner in debug mode, adapted from
NSPR and http://blogs.msdn.com/b/oldnewthing/archive/2013/07/12/10433554.aspx */
class owned_critical_section