audio: Changed a disk and dummy backends to use _this instead of this.
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 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158
diff --git a/src/audio/disk/SDL_diskaudio.c b/src/audio/disk/SDL_diskaudio.c
index 5b2fa14..4cb1370 100644
--- a/src/audio/disk/SDL_diskaudio.c
+++ b/src/audio/disk/SDL_diskaudio.c
@@ -46,19 +46,19 @@
static void
DISKAUDIO_WaitDevice(_THIS)
{
- SDL_Delay(this->hidden->io_delay);
+ SDL_Delay(_this->hidden->io_delay);
}
static void
DISKAUDIO_PlayDevice(_THIS)
{
- const size_t written = SDL_RWwrite(this->hidden->io,
- this->hidden->mixbuf,
- 1, this->spec.size);
+ const size_t written = SDL_RWwrite(_this->hidden->io,
+ _this->hidden->mixbuf,
+ 1, _this->spec.size);
/* If we couldn't write, assume fatal error for now */
- if (written != this->spec.size) {
- SDL_OpenedAudioDeviceDisconnected(this);
+ if (written != _this->spec.size) {
+ SDL_OpenedAudioDeviceDisconnected(_this);
}
#ifdef DEBUG_AUDIO
fprintf(stderr, "Wrote %d bytes of audio data\n", written);
@@ -68,13 +68,13 @@ DISKAUDIO_PlayDevice(_THIS)
static Uint8 *
DISKAUDIO_GetDeviceBuf(_THIS)
{
- return (this->hidden->mixbuf);
+ return (_this->hidden->mixbuf);
}
static int
DISKAUDIO_CaptureFromDevice(_THIS, void *buffer, int buflen)
{
- struct SDL_PrivateAudioData *h = this->hidden;
+ struct SDL_PrivateAudioData *h = _this->hidden;
const int origbuflen = buflen;
SDL_Delay(h->io_delay);
@@ -90,7 +90,7 @@ DISKAUDIO_CaptureFromDevice(_THIS, void *buffer, int buflen)
}
/* if we ran out of file, just write silence. */
- SDL_memset(buffer, this->spec.silence, buflen);
+ SDL_memset(buffer, _this->spec.silence, buflen);
return origbuflen;
}
@@ -105,11 +105,11 @@ DISKAUDIO_FlushCapture(_THIS)
static void
DISKAUDIO_CloseDevice(_THIS)
{
- if (this->hidden->io != NULL) {
- SDL_RWclose(this->hidden->io);
+ if (_this->hidden->io != NULL) {
+ SDL_RWclose(_this->hidden->io);
}
- SDL_free(this->hidden->mixbuf);
- SDL_free(this->hidden);
+ SDL_free(_this->hidden->mixbuf);
+ SDL_free(_this->hidden);
}
@@ -132,32 +132,32 @@ DISKAUDIO_OpenDevice(_THIS, void *handle, const char *devname, int iscapture)
const char *fname = get_filename(iscapture, handle ? NULL : devname);
const char *envr = SDL_getenv(DISKENVR_IODELAY);
- this->hidden = (struct SDL_PrivateAudioData *)
- SDL_malloc(sizeof(*this->hidden));
- if (this->hidden == NULL) {
+ _this->hidden = (struct SDL_PrivateAudioData *)
+ SDL_malloc(sizeof(*_this->hidden));
+ if (_this->hidden == NULL) {
return SDL_OutOfMemory();
}
- SDL_zerop(this->hidden);
+ SDL_zerop(_this->hidden);
if (envr != NULL) {
- this->hidden->io_delay = SDL_atoi(envr);
+ _this->hidden->io_delay = SDL_atoi(envr);
} else {
- this->hidden->io_delay = ((this->spec.samples * 1000) / this->spec.freq);
+ _this->hidden->io_delay = ((_this->spec.samples * 1000) / _this->spec.freq);
}
/* Open the audio device */
- this->hidden->io = SDL_RWFromFile(fname, iscapture ? "rb" : "wb");
- if (this->hidden->io == NULL) {
+ _this->hidden->io = SDL_RWFromFile(fname, iscapture ? "rb" : "wb");
+ if (_this->hidden->io == NULL) {
return -1;
}
/* Allocate mixing buffer */
if (!iscapture) {
- this->hidden->mixbuf = (Uint8 *) SDL_malloc(this->spec.size);
- if (this->hidden->mixbuf == NULL) {
+ _this->hidden->mixbuf = (Uint8 *) SDL_malloc(_this->spec.size);
+ if (_this->hidden->mixbuf == NULL) {
return SDL_OutOfMemory();
}
- SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size);
+ SDL_memset(_this->hidden->mixbuf, _this->spec.silence, _this->spec.size);
}
SDL_LogCritical(SDL_LOG_CATEGORY_AUDIO,
diff --git a/src/audio/disk/SDL_diskaudio.h b/src/audio/disk/SDL_diskaudio.h
index 9548fe5..8fdde7c 100644
--- a/src/audio/disk/SDL_diskaudio.h
+++ b/src/audio/disk/SDL_diskaudio.h
@@ -27,7 +27,7 @@
#include "../SDL_sysaudio.h"
/* Hidden "this" pointer for the audio functions */
-#define _THIS SDL_AudioDevice *this
+#define _THIS SDL_AudioDevice *_this
struct SDL_PrivateAudioData
{
diff --git a/src/audio/dummy/SDL_dummyaudio.c b/src/audio/dummy/SDL_dummyaudio.c
index a62be1c..6d6d61c 100644
--- a/src/audio/dummy/SDL_dummyaudio.c
+++ b/src/audio/dummy/SDL_dummyaudio.c
@@ -37,10 +37,10 @@ static int
DUMMYAUDIO_CaptureFromDevice(_THIS, void *buffer, int buflen)
{
/* Delay to make this sort of simulate real audio input. */
- SDL_Delay((this->spec.samples * 1000) / this->spec.freq);
+ SDL_Delay((_this->spec.samples * 1000) / _this->spec.freq);
/* always return a full buffer of silence. */
- SDL_memset(buffer, this->spec.silence, buflen);
+ SDL_memset(buffer, _this->spec.silence, buflen);
return buflen;
}
diff --git a/src/audio/dummy/SDL_dummyaudio.h b/src/audio/dummy/SDL_dummyaudio.h
index acab160..a39f439 100644
--- a/src/audio/dummy/SDL_dummyaudio.h
+++ b/src/audio/dummy/SDL_dummyaudio.h
@@ -26,7 +26,7 @@
#include "../SDL_sysaudio.h"
/* Hidden "this" pointer for the audio functions */
-#define _THIS SDL_AudioDevice *this
+#define _THIS SDL_AudioDevice *_this
struct SDL_PrivateAudioData
{