audio: changed some internal ints to be SDL_bools.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
diff --git a/src/audio/SDL_audio.c b/src/audio/SDL_audio.c
index b7dab5c..8fee9dc 100644
--- a/src/audio/SDL_audio.c
+++ b/src/audio/SDL_audio.c
@@ -373,7 +373,7 @@ void SDL_OpenedAudioDeviceDisconnected(SDL_AudioDevice *device)
/* Ends the audio callback and mark the device as STOPPED, but the
app still needs to close the device to free resources. */
current_audio.impl.LockDevice(device);
- device->enabled = 0;
+ device->enabled = SDL_FALSE;
current_audio.impl.UnlockDevice(device);
/* Post the event, if desired */
@@ -873,7 +873,7 @@ SDL_GetAudioDeviceName(int index, int iscapture)
static void
close_audio_device(SDL_AudioDevice * device)
{
- device->enabled = 0;
+ device->enabled = SDL_FALSE;
SDL_AtomicSet(&device->shutdown, 1);
if (device->thread != NULL) {
SDL_WaitThread(device->thread, NULL);
@@ -887,7 +887,7 @@ close_audio_device(SDL_AudioDevice * device)
}
if (device->opened) {
current_audio.impl.CloseDevice(device);
- device->opened = 0;
+ device->opened = SDL_FALSE;
}
free_audio_queue(device->buffer_queue_head);
@@ -1074,11 +1074,12 @@ open_audio_device(const char *devname, int iscapture,
return 0;
}
SDL_zerop(device);
+ SDL_AtomicSet(&device->shutdown, 0); /* just in case. */
device->id = id + 1;
device->spec = *obtained;
- device->enabled = 1;
- device->paused = 1;
- device->iscapture = iscapture;
+ device->enabled = SDL_TRUE;
+ device->paused = SDL_TRUE;
+ device->iscapture = iscapture ? SDL_TRUE : SDL_FALSE;
/* Create a mutex for locking the sound buffers */
if (!current_audio.impl.SkipMixerLock) {
@@ -1094,7 +1095,7 @@ open_audio_device(const char *devname, int iscapture,
close_audio_device(device);
return 0;
}
- device->opened = 1;
+ device->opened = SDL_TRUE;
/* See if we need to do any conversion */
build_cvt = SDL_FALSE;
@@ -1278,7 +1279,7 @@ SDL_PauseAudioDevice(SDL_AudioDeviceID devid, int pause_on)
SDL_AudioDevice *device = get_audio_device(devid);
if (device) {
current_audio.impl.LockDevice(device);
- device->paused = pause_on;
+ device->paused = pause_on ? SDL_TRUE : SDL_FALSE;
current_audio.impl.UnlockDevice(device);
}
}
diff --git a/src/audio/SDL_sysaudio.h b/src/audio/SDL_sysaudio.h
index 3fb4c5c..fcf441d 100644
--- a/src/audio/SDL_sysaudio.h
+++ b/src/audio/SDL_sysaudio.h
@@ -158,11 +158,10 @@ struct SDL_AudioDevice
/* Current state flags */
SDL_atomic_t shutdown; /* true if we are signaling the play thread to end. */
- /* !!! FIXME: these should be SDL_bool */
- int iscapture;
- int enabled; /* true if device is functioning and connected. */
- int paused;
- int opened;
+ SDL_bool iscapture;
+ SDL_bool enabled; /* true if device is functioning and connected. */
+ SDL_bool paused;
+ SDL_bool opened;
/* Fake audio buffer for when the audio hardware is busy */
Uint8 *fake_stream;
diff --git a/src/audio/qsa/SDL_qsa_audio.c b/src/audio/qsa/SDL_qsa_audio.c
index 1899ca6..1742fe3 100644
--- a/src/audio/qsa/SDL_qsa_audio.c
+++ b/src/audio/qsa/SDL_qsa_audio.c
@@ -371,7 +371,7 @@ QSA_OpenDevice(_THIS, void *handle, const char *devname, int iscapture)
QSA_InitAudioParams(&cparams);
/* Initialize channel direction: capture or playback */
- this->hidden->iscapture = iscapture;
+ this->hidden->iscapture = iscapture ? SDL_TRUE : SDL_FALSE;
if (device != NULL) {
/* Open requested audio device */
diff --git a/src/audio/qsa/SDL_qsa_audio.h b/src/audio/qsa/SDL_qsa_audio.h
index 53d37e9..19a2215 100644
--- a/src/audio/qsa/SDL_qsa_audio.h
+++ b/src/audio/qsa/SDL_qsa_audio.h
@@ -34,7 +34,7 @@
struct SDL_PrivateAudioData
{
/* SDL capture state */
- int iscapture;
+ SDL_bool iscapture;
/* The audio device handle */
int cardno;