diff options
author | Chris Robinson <[email protected]> | 2011-07-13 01:43:00 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-07-13 01:43:00 -0700 |
commit | 17773c56449475c1d255d839b89400668f15f40f (patch) | |
tree | 8907c354b007a6ac38e5d2b8b5b1c2f7312107a0 | |
parent | e1e47c6e437b58a07cc447cf212dd6ec61fdfbc0 (diff) |
Rename the ERROR macro to ERR
-rw-r--r-- | Alc/ALc.c | 18 | ||||
-rw-r--r-- | Alc/alcConfig.c | 10 | ||||
-rw-r--r-- | Alc/alsa.c | 70 | ||||
-rw-r--r-- | Alc/coreaudio.c | 72 | ||||
-rw-r--r-- | Alc/dsound.c | 18 | ||||
-rw-r--r-- | Alc/hrtf.c | 6 | ||||
-rw-r--r-- | Alc/mmdevapi.c | 44 | ||||
-rw-r--r-- | Alc/null.c | 2 | ||||
-rw-r--r-- | Alc/opensl.c | 2 | ||||
-rw-r--r-- | Alc/oss.c | 28 | ||||
-rw-r--r-- | Alc/panning.c | 4 | ||||
-rw-r--r-- | Alc/portaudio.c | 26 | ||||
-rw-r--r-- | Alc/pulseaudio.c | 58 | ||||
-rw-r--r-- | Alc/sndio.c | 20 | ||||
-rw-r--r-- | Alc/solaris.c | 16 | ||||
-rw-r--r-- | Alc/wave.c | 8 | ||||
-rw-r--r-- | Alc/winmm.c | 12 | ||||
-rw-r--r-- | OpenAL32/Include/alMain.h | 2 | ||||
-rw-r--r-- | OpenAL32/alThunk.c | 2 |
19 files changed, 209 insertions, 209 deletions
@@ -548,7 +548,7 @@ static void alc_initconfig(void) { FILE *logfile = fopen(str, "wat"); if(logfile) LogFile = logfile; - else ERROR("Failed to open log file '%s'\n", str); + else ERR("Failed to open log file '%s'\n", str); } ReadALConfig(); @@ -691,7 +691,7 @@ static void AppendList(const ALCchar *name, ALCchar **List, size_t *ListSize) temp = realloc(*List, (*ListSize) + len + 2); if(!temp) { - ERROR("Realloc failed to add %s!\n", name); + ERR("Realloc failed to add %s!\n", name); return; } *List = temp; @@ -766,7 +766,7 @@ void SetRTPriority(void) failed = (RTPrioLevel>0); #endif if(failed) - ERROR("Failed to set priority level for thread\n"); + ERR("Failed to set priority level for thread\n"); } @@ -1132,7 +1132,7 @@ void *GetSymbol(void *handle, const char *name) ret = (void*)GetProcAddress((HANDLE)handle, name); if(ret == NULL) - ERROR("Failed to load %s\n", name); + ERR("Failed to load %s\n", name); return ret; } @@ -1162,7 +1162,7 @@ void *GetSymbol(void *handle, const char *name) sym = dlsym(handle, name); if((err=dlerror()) != NULL) { - ERROR("Failed to load %s: %s\n", name, err); + ERR("Failed to load %s: %s\n", name, err); sym = NULL; } return sym; @@ -1372,7 +1372,7 @@ static ALCboolean UpdateDeviceParams(ALCdevice *device, const ALCint *attrList) device->Flags |= DEVICE_USE_HRTF; if((device->Flags&DEVICE_USE_HRTF) && !IsHrtfCompatible(device)) { - ERROR("HRTF disabled (format is %uhz %s)\n", device->Frequency, DevFmtChannelsString(device->FmtChans)); + ERR("HRTF disabled (format is %uhz %s)\n", device->Frequency, DevFmtChannelsString(device->FmtChans)); device->Flags &= ~DEVICE_USE_HRTF; } else @@ -2296,14 +2296,14 @@ ALC_API ALCvoid ALC_APIENTRY alcDestroyContext(ALCcontext *context) if(context->SourceMap.size > 0) { - ERROR("alcDestroyContext(): deleting %d Source(s)\n", context->SourceMap.size); + ERR("alcDestroyContext(): deleting %d Source(s)\n", context->SourceMap.size); ReleaseALSources(context); } ResetUIntMap(&context->SourceMap); if(context->EffectSlotMap.size > 0) { - ERROR("alcDestroyContext(): deleting %d AuxiliaryEffectSlot(s)\n", context->EffectSlotMap.size); + ERR("alcDestroyContext(): deleting %d AuxiliaryEffectSlot(s)\n", context->EffectSlotMap.size); ReleaseALAuxiliaryEffectSlots(context); } ResetUIntMap(&context->EffectSlotMap); @@ -2635,7 +2635,7 @@ static void GetFormatFromString(const char *str, enum DevFmtChannels *chans, enu return; } - ERROR("Unknown format: \"%s\"\n", str); + ERR("Unknown format: \"%s\"\n", str); *chans = DevFmtStereo; *type = DevFmtShort; } diff --git a/Alc/alcConfig.c b/Alc/alcConfig.c index aab4039d..82375f40 100644 --- a/Alc/alcConfig.c +++ b/Alc/alcConfig.c @@ -81,7 +81,7 @@ static void LoadConfigFromFile(FILE *f) if(!buffer[i]) { - ERROR("config parse error: bad line \"%s\"\n", buffer); + ERR("config parse error: bad line \"%s\"\n", buffer); continue; } buffer[i] = 0; @@ -112,7 +112,7 @@ static void LoadConfigFromFile(FILE *f) nextBlock = realloc(cfgBlocks, (cfgCount+1)*sizeof(ConfigBlock)); if(!nextBlock) { - ERROR("config parse error: error reallocating config blocks\n"); + ERR("config parse error: error reallocating config blocks\n"); continue; } cfgBlocks = nextBlock; @@ -137,7 +137,7 @@ static void LoadConfigFromFile(FILE *f) if(!buffer[i] || buffer[i] == '#' || i == 0) { - ERROR("config parse error: malformed option line: \"%s\"\n", buffer); + ERR("config parse error: malformed option line: \"%s\"\n", buffer); continue; } @@ -150,7 +150,7 @@ static void LoadConfigFromFile(FILE *f) i++; if(buffer[i] != '=') { - ERROR("config parse error: option without a value: \"%s\"\n", buffer); + ERR("config parse error: option without a value: \"%s\"\n", buffer); continue; } } @@ -174,7 +174,7 @@ static void LoadConfigFromFile(FILE *f) ent = realloc(curBlock->entries, (curBlock->entryCount+1)*sizeof(ConfigEntry)); if(!ent) { - ERROR("config parse error: error reallocating config entries\n"); + ERR("config parse error: error reallocating config entries\n"); continue; } curBlock->entries = ent; @@ -282,7 +282,7 @@ static DevMap *probe_devices(snd_pcm_stream_t stream, ALuint *count) card = -1; if((err=snd_card_next(&card)) < 0) - ERROR("Failed to find a card: %s\n", snd_strerror(err)); + ERR("Failed to find a card: %s\n", snd_strerror(err)); DevList = malloc(sizeof(DevMap) * 1); DevList[0].name = strdup("ALSA Default"); @@ -292,12 +292,12 @@ static DevMap *probe_devices(snd_pcm_stream_t stream, ALuint *count) sprintf(name, "hw:%d", card); if((err = snd_ctl_open(&handle, name, 0)) < 0) { - ERROR("control open (%i): %s\n", card, snd_strerror(err)); + ERR("control open (%i): %s\n", card, snd_strerror(err)); goto next_card; } if((err = snd_ctl_card_info(handle, info)) < 0) { - ERROR("control hardware info (%i): %s\n", card, snd_strerror(err)); + ERR("control hardware info (%i): %s\n", card, snd_strerror(err)); snd_ctl_close(handle); goto next_card; } @@ -309,7 +309,7 @@ static DevMap *probe_devices(snd_pcm_stream_t stream, ALuint *count) void *temp; if(snd_ctl_pcm_next_device(handle, &dev) < 0) - ERROR("snd_ctl_pcm_next_device failed\n"); + ERR("snd_ctl_pcm_next_device failed\n"); if(dev < 0) break; @@ -318,7 +318,7 @@ static DevMap *probe_devices(snd_pcm_stream_t stream, ALuint *count) snd_pcm_info_set_stream(pcminfo, stream); if((err = snd_ctl_pcm_info(handle, pcminfo)) < 0) { if(err != -ENOENT) - ERROR("control digital audio info (%i): %s\n", card, snd_strerror(err)); + ERR("control digital audio info (%i): %s\n", card, snd_strerror(err)); continue; } @@ -339,7 +339,7 @@ static DevMap *probe_devices(snd_pcm_stream_t stream, ALuint *count) snd_ctl_close(handle); next_card: if(snd_card_next(&card) < 0) { - ERROR("snd_card_next failed\n"); + ERR("snd_card_next failed\n"); break; } } @@ -356,7 +356,7 @@ static int xrun_recovery(snd_pcm_t *handle, int err) { err = snd_pcm_recover(handle, err, 1); if(err < 0) - ERROR("recover failed: %s\n", snd_strerror(err)); + ERR("recover failed: %s\n", snd_strerror(err)); return err; } @@ -397,7 +397,7 @@ static ALuint ALSAProc(ALvoid *ptr) int state = verify_state(data->pcmHandle); if(state < 0) { - ERROR("Invalid state detected: %s\n", snd_strerror(state)); + ERR("Invalid state detected: %s\n", snd_strerror(state)); aluHandleDisconnect(pDevice); break; } @@ -405,7 +405,7 @@ static ALuint ALSAProc(ALvoid *ptr) avail = snd_pcm_avail_update(data->pcmHandle); if(avail < 0) { - ERROR("available update failed: %s\n", snd_strerror(avail)); + ERR("available update failed: %s\n", snd_strerror(avail)); continue; } @@ -417,12 +417,12 @@ static ALuint ALSAProc(ALvoid *ptr) err = snd_pcm_start(data->pcmHandle); if(err < 0) { - ERROR("start failed: %s\n", snd_strerror(err)); + ERR("start failed: %s\n", snd_strerror(err)); continue; } } if(snd_pcm_wait(data->pcmHandle, 1000) == 0) - ERROR("Wait timeout... buffer size too low?\n"); + ERR("Wait timeout... buffer size too low?\n"); continue; } avail -= avail%pDevice->UpdateSize; @@ -435,7 +435,7 @@ static ALuint ALSAProc(ALvoid *ptr) err = snd_pcm_mmap_begin(data->pcmHandle, &areas, &offset, &frames); if(err < 0) { - ERROR("mmap begin error: %s\n", snd_strerror(err)); + ERR("mmap begin error: %s\n", snd_strerror(err)); break; } @@ -445,8 +445,8 @@ static ALuint ALSAProc(ALvoid *ptr) commitres = snd_pcm_mmap_commit(data->pcmHandle, offset, frames); if(commitres < 0 || (commitres-frames) != 0) { - ERROR("mmap commit error: %s\n", - snd_strerror(commitres >= 0 ? -EPIPE : commitres)); + ERR("mmap commit error: %s\n", + snd_strerror(commitres >= 0 ? -EPIPE : commitres)); break; } @@ -471,7 +471,7 @@ static ALuint ALSANoMMapProc(ALvoid *ptr) int state = verify_state(data->pcmHandle); if(state < 0) { - ERROR("Invalid state detected: %s\n", snd_strerror(state)); + ERR("Invalid state detected: %s\n", snd_strerror(state)); aluHandleDisconnect(pDevice); break; } @@ -561,7 +561,7 @@ static ALCboolean alsa_open_playback(ALCdevice *device, const ALCchar *deviceNam if(i < 0) { free(data); - ERROR("Could not open playback device '%s': %s\n", driver, snd_strerror(i)); + ERR("Could not open playback device '%s': %s\n", driver, snd_strerror(i)); return ALC_FALSE; } @@ -665,21 +665,21 @@ static ALCboolean alsa_reset_playback(ALCdevice *device) else { if((device->Flags&DEVICE_CHANNELS_REQUEST)) - ERROR("Failed to set %s, got Mono instead\n", DevFmtChannelsString(device->FmtChans)); + ERR("Failed to set %s, got Mono instead\n", DevFmtChannelsString(device->FmtChans)); device->FmtChans = DevFmtMono; } } else { if((device->Flags&DEVICE_CHANNELS_REQUEST)) - ERROR("Failed to set %s, got Stereo instead\n", DevFmtChannelsString(device->FmtChans)); + ERR("Failed to set %s, got Stereo instead\n", DevFmtChannelsString(device->FmtChans)); device->FmtChans = DevFmtStereo; } device->Flags &= ~DEVICE_CHANNELS_REQUEST; } if(i >= 0 && (i=snd_pcm_hw_params_set_rate_resample(data->pcmHandle, p, 0)) < 0) { - ERROR("Failed to disable ALSA resampler\n"); + ERR("Failed to disable ALSA resampler\n"); i = 0; } /* set rate (implicitly constrains period/buffer parameters) */ @@ -702,7 +702,7 @@ static ALCboolean alsa_reset_playback(ALCdevice *device) err = "get periods"; if(i < 0) { - ERROR("%s failed: %s\n", err, snd_strerror(i)); + ERR("%s failed: %s\n", err, snd_strerror(i)); snd_pcm_hw_params_free(p); return ALC_FALSE; } @@ -720,7 +720,7 @@ static ALCboolean alsa_reset_playback(ALCdevice *device) err = "sw set params"; if(i != 0) { - ERROR("%s failed: %s\n", err, snd_strerror(i)); + ERR("%s failed: %s\n", err, snd_strerror(i)); snd_pcm_sw_params_free(sp); return ALC_FALSE; } @@ -730,7 +730,7 @@ static ALCboolean alsa_reset_playback(ALCdevice *device) if(device->Frequency != rate) { if((device->Flags&DEVICE_FREQUENCY_REQUEST)) - ERROR("Failed to set %dhz, got %dhz instead\n", device->Frequency, rate); + ERR("Failed to set %dhz, got %dhz instead\n", device->Frequency, rate); device->Flags &= ~DEVICE_FREQUENCY_REQUEST; device->Frequency = rate; } @@ -746,7 +746,7 @@ static ALCboolean alsa_reset_playback(ALCdevice *device) data->buffer = malloc(data->size); if(!data->buffer) { - ERROR("buffer malloc failed\n"); + ERR("buffer malloc failed\n"); return ALC_FALSE; } device->UpdateSize = periodSizeInFrames; @@ -758,7 +758,7 @@ static ALCboolean alsa_reset_playback(ALCdevice *device) i = snd_pcm_prepare(data->pcmHandle); if(i < 0) { - ERROR("prepare error: %s\n", snd_strerror(i)); + ERR("prepare error: %s\n", snd_strerror(i)); return ALC_FALSE; } device->UpdateSize = periodSizeInFrames; @@ -767,7 +767,7 @@ static ALCboolean alsa_reset_playback(ALCdevice *device) } if(data->thread == NULL) { - ERROR("Could not create playback thread\n"); + ERR("Could not create playback thread\n"); free(data->buffer); data->buffer = NULL; return ALC_FALSE; @@ -837,7 +837,7 @@ static ALCboolean alsa_open_capture(ALCdevice *pDevice, const ALCchar *deviceNam i = snd_pcm_open(&data->pcmHandle, driver, SND_PCM_STREAM_CAPTURE, SND_PCM_NONBLOCK); if(i < 0) { - ERROR("Could not open capture device '%s': %s\n", driver, snd_strerror(i)); + ERR("Could not open capture device '%s': %s\n", driver, snd_strerror(i)); free(data); return ALC_FALSE; } @@ -888,14 +888,14 @@ static ALCboolean alsa_open_capture(ALCdevice *pDevice, const ALCchar *deviceNam err = "set params"; if(i < 0) { - ERROR("%s failed: %s\n", err, snd_strerror(i)); + ERR("%s failed: %s\n", err, snd_strerror(i)); snd_pcm_hw_params_free(p); goto error; } if((i=snd_pcm_hw_params_get_period_size(p, &bufferSizeInFrames, NULL)) < 0) { - ERROR("get size failed: %s\n", snd_strerror(i)); + ERR("get size failed: %s\n", snd_strerror(i)); snd_pcm_hw_params_free(p); goto error; } @@ -907,7 +907,7 @@ static ALCboolean alsa_open_capture(ALCdevice *pDevice, const ALCchar *deviceNam data->ring = CreateRingBuffer(frameSize, pDevice->UpdateSize*pDevice->NumUpdates); if(!data->ring) { - ERROR("ring buffer create failed\n"); + ERR("ring buffer create failed\n"); goto error; } @@ -915,7 +915,7 @@ static ALCboolean alsa_open_capture(ALCdevice *pDevice, const ALCchar *deviceNam data->buffer = malloc(data->size); if(!data->buffer) { - ERROR("buffer malloc failed\n"); + ERR("buffer malloc failed\n"); goto error; } @@ -954,7 +954,7 @@ static void alsa_start_capture(ALCdevice *Device) err = snd_pcm_start(data->pcmHandle); if(err < 0) { - ERROR("start failed: %s\n", snd_strerror(err)); + ERR("start failed: %s\n", snd_strerror(err)); aluHandleDisconnect(Device); } else @@ -976,7 +976,7 @@ static ALCuint alsa_available_samples(ALCdevice *Device) avail = (Device->Connected ? snd_pcm_avail_update(data->pcmHandle) : 0); if(avail < 0) { - ERROR("avail update failed: %s\n", snd_strerror(avail)); + ERR("avail update failed: %s\n", snd_strerror(avail)); if((avail=snd_pcm_recover(data->pcmHandle, avail, 1)) >= 0) { @@ -987,7 +987,7 @@ static ALCuint alsa_available_samples(ALCdevice *Device) } if(avail < 0) { - ERROR("restore error: %s\n", snd_strerror(avail)); + ERR("restore error: %s\n", snd_strerror(avail)); aluHandleDisconnect(Device); } } @@ -1001,7 +1001,7 @@ static ALCuint alsa_available_samples(ALCdevice *Device) amt = snd_pcm_readi(data->pcmHandle, data->buffer, amt); if(amt < 0) { - ERROR("read error: %s\n", snd_strerror(amt)); + ERR("read error: %s\n", snd_strerror(amt)); if(amt == -EAGAIN) continue; @@ -1014,7 +1014,7 @@ static ALCuint alsa_available_samples(ALCdevice *Device) } if(amt < 0) { - ERROR("restore error: %s\n", snd_strerror(amt)); + ERR("restore error: %s\n", snd_strerror(amt)); aluHandleDisconnect(Device); break; } diff --git a/Alc/coreaudio.c b/Alc/coreaudio.c index 0fa8a0ff..979dfbb7 100644 --- a/Alc/coreaudio.c +++ b/Alc/coreaudio.c @@ -125,7 +125,7 @@ static OSStatus ca_capture_callback(void *inRefCon, AudioUnitRenderActionFlags * err = AudioUnitRender(data->audioUnit, &flags, inTimeStamp, 1, inNumberFrames, data->bufferList); if(err != noErr) { - ERROR("AudioUnitRender error: %d\n", err); + ERR("AudioUnitRender error: %d\n", err); return err; } @@ -156,7 +156,7 @@ static ALCboolean ca_open_playback(ALCdevice *device, const ALCchar *deviceName) comp = FindNextComponent(NULL, &desc); if(comp == NULL) { - ERROR("FindNextComponent failed\n"); + ERR("FindNextComponent failed\n"); return ALC_FALSE; } @@ -166,7 +166,7 @@ static ALCboolean ca_open_playback(ALCdevice *device, const ALCchar *deviceName) err = OpenAComponent(comp, &data->audioUnit); if(err != noErr) { - ERROR("OpenAComponent failed\n"); + ERR("OpenAComponent failed\n"); free(data); device->ExtraData = NULL; return ALC_FALSE; @@ -197,14 +197,14 @@ static ALCboolean ca_reset_playback(ALCdevice *device) err = AudioUnitInitialize(data->audioUnit); if(err != noErr) { - ERROR("AudioUnitInitialize failed\n"); + ERR("AudioUnitInitialize failed\n"); return ALC_FALSE; } err = AudioOutputUnitStart(data->audioUnit); if(err != noErr) { - ERROR("AudioOutputUnitStart failed\n"); + ERR("AudioOutputUnitStart failed\n"); return ALC_FALSE; } @@ -213,7 +213,7 @@ static ALCboolean ca_reset_playback(ALCdevice *device) err = AudioUnitGetProperty(data->audioUnit, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Output, 0, &streamFormat, &size); if(err != noErr || size != sizeof(AudioStreamBasicDescription)) { - ERROR("AudioUnitGetProperty failed\n"); + ERR("AudioUnitGetProperty failed\n"); return ALC_FALSE; } @@ -231,14 +231,14 @@ static ALCboolean ca_reset_playback(ALCdevice *device) err = AudioUnitSetProperty(data->audioUnit, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, 0, &streamFormat, size); if(err != noErr) { - ERROR("AudioUnitSetProperty failed\n"); + ERR("AudioUnitSetProperty failed\n"); return ALC_FALSE; } if(device->Frequency != streamFormat.mSampleRate) { if((device->Flags&DEVICE_FREQUENCY_REQUEST)) - ERROR("CoreAudio does not support changing sample rates (wanted %dhz, got %dhz)\n", device->Frequency, streamFormat.mSampleRate); + ERR("CoreAudio does not support changing sample rates (wanted %dhz, got %dhz)\n", device->Frequency, streamFormat.mSampleRate); device->Flags &= ~DEVICE_FREQUENCY_REQUEST; device->UpdateSize = (ALuint)((ALuint64)device->UpdateSize * @@ -255,7 +255,7 @@ static ALCboolean ca_reset_playback(ALCdevice *device) if((device->Flags&DEVICE_CHANNELS_REQUEST) && device->FmtChans != DevFmtMono) { - ERROR("Failed to set %s, got Mono instead\n", DevFmtChannelsString(device->FmtChans)); + ERR("Failed to set %s, got Mono instead\n", DevFmtChannelsString(device->FmtChans)); device->Flags &= ~DEVICE_CHANNELS_REQUEST; } device->FmtChans = DevFmtMono; @@ -264,7 +264,7 @@ static ALCboolean ca_reset_playback(ALCdevice *device) if((device->Flags&DEVICE_CHANNELS_REQUEST) && device->FmtChans != DevFmtStereo) { - ERROR("Failed to set %s, got Stereo instead\n", DevFmtChannelsString(device->FmtChans)); + ERR("Failed to set %s, got Stereo instead\n", DevFmtChannelsString(device->FmtChans)); device->Flags &= ~DEVICE_CHANNELS_REQUEST; } device->FmtChans = DevFmtStereo; @@ -273,7 +273,7 @@ static ALCboolean ca_reset_playback(ALCdevice *device) if((device->Flags&DEVICE_CHANNELS_REQUEST) && device->FmtChans != DevFmtQuad) { - ERROR("Failed to set %s, got Quad instead\n", DevFmtChannelsString(device->FmtChans)); + ERR("Failed to set %s, got Quad instead\n", DevFmtChannelsString(device->FmtChans)); device->Flags &= ~DEVICE_CHANNELS_REQUEST; } device->FmtChans = DevFmtQuad; @@ -282,7 +282,7 @@ static ALCboolean ca_reset_playback(ALCdevice *device) if((device->Flags&DEVICE_CHANNELS_REQUEST) && device->FmtChans != DevFmtX51) { - ERROR("Failed to set %s, got 5.1 Surround instead\n", DevFmtChannelsString(device->FmtChans)); + ERR("Failed to set %s, got 5.1 Surround instead\n", DevFmtChannelsString(device->FmtChans)); device->Flags &= ~DEVICE_CHANNELS_REQUEST; } device->FmtChans = DevFmtX51; @@ -291,7 +291,7 @@ static ALCboolean ca_reset_playback(ALCdevice *device) if((device->Flags&DEVICE_CHANNELS_REQUEST) && device->FmtChans != DevFmtX61) { - ERROR("Failed to set %s, got 6.1 Surround instead\n", DevFmtChannelsString(device->FmtChans)); + ERR("Failed to set %s, got 6.1 Surround instead\n", DevFmtChannelsString(device->FmtChans)); device->Flags &= ~DEVICE_CHANNELS_REQUEST; } device->FmtChans = DevFmtX61; @@ -300,13 +300,13 @@ static ALCboolean ca_reset_playback(ALCdevice *device) if((device->Flags&DEVICE_CHANNELS_REQUEST) && device->FmtChans != DevFmtX71) { - ERROR("Failed to set %s, got 7.1 Surround instead\n", DevFmtChannelsString(device->FmtChans)); + ERR("Failed to set %s, got 7.1 Surround instead\n", DevFmtChannelsString(device->FmtChans)); device->Flags &= ~DEVICE_CHANNELS_REQUEST; } device->FmtChans = DevFmtX71; break; default: - ERROR("Unhandled channel count (%d), using Stereo\n", streamFormat.mChannelsPerFrame); + ERR("Unhandled channel count (%d), using Stereo\n", streamFormat.mChannelsPerFrame); device->Flags &= ~DEVICE_CHANNELS_REQUEST; device->FmtChans = DevFmtStereo; streamFormat.mChannelsPerFrame = 2; @@ -345,7 +345,7 @@ static ALCboolean ca_reset_playback(ALCdevice *device) err = AudioUnitSetProperty(data->audioUnit, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, 0, &streamFormat, sizeof(AudioStreamBasicDescription)); if(err != noErr) { - ERROR("AudioUnitSetProperty failed\n"); + ERR("AudioUnitSetProperty failed\n"); return ALC_FALSE; } @@ -357,7 +357,7 @@ static ALCboolean ca_reset_playback(ALCdevice *device) err = AudioUnitSetProperty(data->audioUnit, kAudioUnitProperty_SetRenderCallback, kAudioUnitScope_Input, 0, &input, sizeof(AURenderCallbackStruct)); if(err != noErr) { - ERROR("AudioUnitSetProperty failed\n"); + ERR("AudioUnitSetProperty failed\n"); return ALC_FALSE; } @@ -372,7 +372,7 @@ static void ca_stop_playback(ALCdevice *device) AudioOutputUnitStop(data->audioUnit); err = AudioUnitUninitialize(data->audioUnit); if(err != noErr) - ERROR("-- AudioUnitUninitialize failed.\n"); + ERR("-- AudioUnitUninitialize failed.\n"); } static ALCboolean ca_open_capture(ALCdevice *device, const ALCchar *deviceName) @@ -400,7 +400,7 @@ static ALCboolean ca_open_capture(ALCdevice *device, const ALCchar *deviceName) comp = FindNextComponent(NULL, &desc); if(comp == NULL) { - ERROR("FindNextComponent failed\n"); + ERR("FindNextComponent failed\n"); return ALC_FALSE; } @@ -411,7 +411,7 @@ static ALCboolean ca_open_capture(ALCdevice *device, const ALCchar *deviceName) err = OpenAComponent(comp, &data->audioUnit); if(err != noErr) { - ERROR("OpenAComponent failed\n"); + ERR("OpenAComponent failed\n"); goto error; } @@ -420,7 +420,7 @@ static ALCboolean ca_open_capture(ALCdevice *device, const ALCchar *deviceName) err = AudioUnitSetProperty(data->audioUnit, kAudioOutputUnitProperty_EnableIO, kAudioUnitScope_Output, 0, &enableIO, sizeof(ALuint)); if(err != noErr) { - ERROR("AudioUnitSetProperty failed\n"); + ERR("AudioUnitSetProperty failed\n"); goto error; } @@ -429,7 +429,7 @@ static ALCboolean ca_open_capture(ALCdevice *device, const ALCchar *deviceName) err = AudioUnitSetProperty(data->audioUnit, kAudioOutputUnitProperty_EnableIO, kAudioUnitScope_Input, 1, &enableIO, sizeof(ALuint)); if(err != noErr) { - ERROR("AudioUnitSetProperty failed\n"); + ERR("AudioUnitSetProperty failed\n"); goto error; } @@ -438,13 +438,13 @@ static ALCboolean ca_open_capture(ALCdevice *device, const ALCchar *deviceName) err = AudioHardwareGetProperty(kAudioHardwarePropertyDefaultInputDevice, &propertySize, &inputDevice); if(err != noErr) { - ERROR("AudioHardwareGetProperty failed\n"); + ERR("AudioHardwareGetProperty failed\n"); goto error; } if(inputDevice == kAudioDeviceUnknown) { - ERROR("No input device found\n"); + ERR("No input device found\n"); goto error; } @@ -452,7 +452,7 @@ static ALCboolean ca_open_capture(ALCdevice *device, const ALCchar *deviceName) err = AudioUnitSetProperty(data->audioUnit, kAudioOutputUnitProperty_CurrentDevice, kAudioUnitScope_Global, 0, &inputDevice, sizeof(AudioDeviceID)); if(err != noErr) { - ERROR("AudioUnitSetProperty failed\n"); + ERR("AudioUnitSetProperty failed\n"); goto error; } @@ -463,7 +463,7 @@ static ALCboolean ca_open_capture(ALCdevice *device, const ALCchar *deviceName) err = AudioUnitSetProperty(data->audioUnit, kAudioOutputUnitProperty_SetInputCallback, kAudioUnitScope_Global, 0, &input, sizeof(AURenderCallbackStruct)); if(err != noErr) { - ERROR("AudioUnitSetProperty failed\n"); + ERR("AudioUnitSetProperty failed\n"); goto error; } @@ -471,7 +471,7 @@ static ALCboolean ca_open_capture(ALCdevice *device, const ALCchar *deviceName) err = AudioUnitInitialize(data->audioUnit); if(err != noErr) { - ERROR("AudioUnitInitialize failed\n"); + ERR("AudioUnitInitialize failed\n"); goto error; } @@ -480,7 +480,7 @@ static ALCboolean ca_open_capture(ALCdevice *device, const ALCchar *deviceName) err = AudioUnitGetProperty(data->audioUnit, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, 1, &hardwareFormat, &propertySize); if(err != noErr || propertySize != sizeof(AudioStreamBasicDescription)) { - ERROR("AudioUnitGetProperty failed\n"); + ERR("AudioUnitGetProperty failed\n"); goto error; } @@ -501,7 +501,7 @@ static ALCboolean ca_open_capture(ALCdevice *device, const ALCchar *deviceName) break; case DevFmtByte: case DevFmtUShort: - ERROR("%s samples not supported\n", DevFmtTypeString(device->FmtType)); + ERR("%s samples not supported\n", DevFmtTypeString(device->FmtType)); goto error; } @@ -519,7 +519,7 @@ static ALCboolean ca_open_capture(ALCdevice *device, const ALCchar *deviceName) case DevFmtX51Side: case DevFmtX61: case DevFmtX71: - ERROR("%s not supported\n", DevFmtChannelsString(device->FmtChans)); + ERR("%s not supported\n", DevFmtChannelsString(device->FmtChans)); goto error; } @@ -547,7 +547,7 @@ static ALCboolean ca_open_capture(ALCdevice *device, const ALCchar *deviceName) err = AudioUnitSetProperty(data->audioUnit, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Output, 1, (void *)&outputFormat, sizeof(outputFormat)); if(err != noErr) { - ERROR("AudioUnitSetProperty failed\n"); + ERR("AudioUnitSetProperty failed\n"); goto error; } @@ -556,7 +556,7 @@ static ALCboolean ca_open_capture(ALCdevice *device, const ALCchar *deviceName) err = AudioUnitSetProperty(data->audioUnit, kAudioUnitProperty_MaximumFramesPerSlice, kAudioUnitScope_Output, 0, &outputFrameCount, sizeof(outputFrameCount)); if(err != noErr) { - ERROR("AudioUnitSetProperty failed: %d\n", err); + ERR("AudioUnitSetProperty failed: %d\n", err); goto error; } @@ -564,7 +564,7 @@ static ALCboolean ca_open_capture(ALCdevice *device, const ALCchar *deviceName) err = AudioConverterNew(&outputFormat, &requestedFormat, &data->audioConverter); if(err != noErr) { - ERROR("AudioConverterNew failed: %d\n", err); + ERR("AudioConverterNew failed: %d\n", err); goto error; } @@ -624,7 +624,7 @@ static void ca_start_capture(ALCdevice *device) ca_data *data = (ca_data*)device->ExtraData; OSStatus err = AudioOutputUnitStart(data->audioUnit); if(err != noErr) - ERROR("AudioOutputUnitStart failed\n"); + ERR("AudioOutputUnitStart failed\n"); } static void ca_stop_capture(ALCdevice *device) @@ -632,7 +632,7 @@ static void ca_stop_capture(ALCdevice *device) ca_data *data = (ca_data*)device->ExtraData; OSStatus err = AudioOutputUnitStop(data->audioUnit); if(err != noErr) - ERROR("AudioOutputUnitStop failed\n"); + ERR("AudioOutputUnitStop failed\n"); } static ALCuint ca_available_samples(ALCdevice *device) @@ -670,7 +670,7 @@ static void ca_capture_samples(ALCdevice *device, ALCvoid *buffer, ALCuint sampl &frameCount, list, NULL); if(err != noErr) { - ERROR("AudioConverterFillComplexBuffer error: %d\n", err); + ERR("AudioConverterFillComplexBuffer error: %d\n", err); alcSetError(device, ALC_INVALID_VALUE); } } diff --git a/Alc/dsound.c b/Alc/dsound.c index bbf552df..5f3c8e3c 100644 --- a/Alc/dsound.c +++ b/Alc/dsound.c @@ -86,13 +86,13 @@ static void *DSoundLoad(void) ds_handle = LoadLibraryA("dsound.dll"); if(ds_handle == NULL) { - ERROR("Failed to load dsound.dll\n"); + ERR("Failed to load dsound.dll\n"); return NULL; } #define LOAD_FUNC(x) do { \ if((p##x = (void*)GetProcAddress((HMODULE)ds_handle, #x)) == NULL) { \ - ERROR("Could not load %s from dsound.dll\n", #x); \ + ERR("Could not load %s from dsound.dll\n", #x); \ failed = AL_TRUE; \ } \ } while(0) @@ -185,7 +185,7 @@ static ALuint DSoundProc(ALvoid *ptr) err = IDirectSoundBuffer_GetCaps(pData->DSsbuffer, &DSBCaps); if(FAILED(err)) { - ERROR("Failed to get buffer caps: 0x%lx\n", err); + ERR("Failed to get buffer caps: 0x%lx\n", err); aluHandleDisconnect(pDevice); return 1; } @@ -207,7 +207,7 @@ static ALuint DSoundProc(ALvoid *ptr) err = IDirectSoundBuffer_Play(pData->DSsbuffer, 0, 0, DSBPLAY_LOOPING); if(FAILED(err)) { - ERROR("Failed to play buffer: 0x%lx\n", err); + ERR("Failed to play buffer: 0x%lx\n", err); aluHandleDisconnect(pDevice); return 1; } @@ -248,7 +248,7 @@ static ALuint DSoundProc(ALvoid *ptr) } else { - ERROR("Buffer lock error: %#lx\n", err); + ERR("Buffer lock error: %#lx\n", err); aluHandleDisconnect(pDevice); return 1; } @@ -280,7 +280,7 @@ static ALCboolean DSoundOpenPlayback(ALCdevice *device, const ALCchar *deviceNam { hr = DirectSoundEnumerateA(DSoundEnumDevices, NULL); if(FAILED(hr)) - ERROR("Error enumerating DirectSound devices (%#x)!\n", (unsigned int)hr); + ERR("Error enumerating DirectSound devices (%#x)!\n", (unsigned int)hr); } for(i = 0;i < NumDevices;i++) @@ -313,7 +313,7 @@ static ALCboolean DSoundOpenPlayback(ALCdevice *device, const ALCchar *deviceNam if(pData->lpDS) IDirectSound_Release(pData->lpDS); free(pData); - ERROR("Device init failed: 0x%08lx\n", hr); + ERR("Device init failed: 0x%08lx\n", hr); return ALC_FALSE; } @@ -372,7 +372,7 @@ static ALCboolean DSoundResetPlayback(ALCdevice *device) else if(speakers == DSSPEAKER_7POINT1) device->FmtChans = DevFmtX71; else - ERROR("Unknown system speaker config: 0x%lx\n", speakers); + ERR("Unknown system speaker config: 0x%lx\n", speakers); } switch(device->FmtChans) @@ -605,7 +605,7 @@ void alcDSoundProbe(enum DevProbe type) hr = DirectSoundEnumerateA(DSoundEnumDevices, NULL); if(FAILED(hr)) - ERROR("Error enumerating DirectSound devices (%#x)!\n", (unsigned int)hr); + ERR("Error enumerating DirectSound devices (%#x)!\n", (unsigned int)hr); else { for(i = 0;i < NumDevices;i++) @@ -148,7 +148,7 @@ void InitHrtf(void) { f = fopen(str, "rb"); if(f == NULL) - ERROR("Could not open %s\n", str); + ERR("Could not open %s\n", str); } if(f != NULL) { @@ -174,13 +174,13 @@ void InitHrtf(void) newdata.delays[i] = val; if(val > maxDelay) { - ERROR("Invalid delay at idx %zu: %u (max: %u), in %s\n", i, val, maxDelay, str); + ERR("Invalid delay at idx %zu: %u (max: %u), in %s\n", i, val, maxDelay, str); failed = AL_TRUE; } } if(feof(f)) { - ERROR("Premature end of data while reading %s\n", str); + ERR("Premature end of data while reading %s\n", str); failed = AL_TRUE; } diff --git a/Alc/mmdevapi.c b/Alc/mmdevapi.c index c31263cd..a68f1b15 100644 --- a/Alc/mmdevapi.c +++ b/Alc/mmdevapi.c @@ -82,7 +82,7 @@ static ALCboolean MakeExtensible(WAVEFORMATEXTENSIBLE *out, const WAVEFORMATEX * else if(out->Format.nChannels == 2) out->dwChannelMask = STEREO; else - ERROR("Unhandled PCM channel count: %d\n", out->Format.nChannels); + ERR("Unhandled PCM channel count: %d\n", out->Format.nChannels); out->SubFormat = KSDATAFORMAT_SUBTYPE_PCM; } else if(in->wFormatTag == WAVE_FORMAT_IEEE_FLOAT) @@ -95,12 +95,12 @@ static ALCboolean MakeExtensible(WAVEFORMATEXTENSIBLE *out, const WAVEFORMATEX * else if(out->Format.nChannels == 2) out->dwChannelMask = STEREO; else - ERROR("Unhandled IEEE float channel count: %d\n", out->Format.nChannels); + ERR("Unhandled IEEE float channel count: %d\n", out->Format.nChannels); out->SubFormat = KSDATAFORMAT_SUBTYPE_IEEE_FLOAT; } else { - ERROR("Unhandled format tag: 0x%04x\n", in->wFormatTag); + ERR("Unhandled format tag: 0x%04x\n", in->wFormatTag); return ALC_FALSE; } return ALC_TRUE; @@ -151,7 +151,7 @@ static ALuint MMDevApiProc(ALvoid *ptr) hr = IAudioClient_GetService(data->client, &IID_IAudioRenderClient, &render.ptr); if(FAILED(hr)) { - ERROR("Failed to get AudioRenderClient service: 0x%08lx\n", hr); + ERR("Failed to get AudioRenderClient service: 0x%08lx\n", hr); aluHandleDisconnect(device); return 0; } @@ -163,7 +163,7 @@ static ALuint MMDevApiProc(ALvoid *ptr) hr = IAudioClient_GetCurrentPadding(data->client, &written); if(FAILED(hr)) { - ERROR("Failed to get padding: 0x%08lx\n", hr); + ERR("Failed to get padding: 0x%08lx\n", hr); aluHandleDisconnect(device); break; } @@ -184,7 +184,7 @@ static ALuint MMDevApiProc(ALvoid *ptr) } if(FAILED(hr)) { - ERROR("Failed to buffer data: 0x%08lx\n", hr); + ERR("Failed to buffer data: 0x%08lx\n", hr); aluHandleDisconnect(device); break; } @@ -229,7 +229,7 @@ static ALCboolean MMDevApiOpenPlayback(ALCdevice *device, const ALCchar *deviceN data->mmdev = NULL; free(data); - ERROR("Device init failed: 0x%08lx\n", hr); + ERR("Device init failed: 0x%08lx\n", hr); return ALC_FALSE; } data->client = client; @@ -265,7 +265,7 @@ static ALCboolean MMDevApiResetPlayback(ALCdevice *device) hr = IAudioClient_GetMixFormat(data->client, &wfx); if(FAILED(hr)) { - ERROR("Failed to get mix format: 0x%08lx\n", hr); + ERR("Failed to get mix format: 0x%08lx\n", hr); return ALC_FALSE; } @@ -296,7 +296,7 @@ static ALCboolean MMDevApiResetPlayback(ALCdevice *device) else if(OutputType.Format.nChannels == 8 && OutputType.dwChannelMask == X7DOT1) device->FmtChans = DevFmtX71; else - ERROR("Unhandled channel config: %d -- 0x%08x\n", OutputType.Format.nChannels, OutputType.dwChannelMask); + ERR("Unhandled channel config: %d -- 0x%08x\n", OutputType.Format.nChannels, OutputType.dwChannelMask); } switch(device->FmtChans) @@ -364,12 +364,12 @@ static ALCboolean MMDevApiResetPlayback(ALCdevice *device) hr = IAudioClient_IsFormatSupported(data->client, AUDCLNT_SHAREMODE_SHARED, &OutputType.Format, &wfx); if(FAILED(hr)) { - ERROR("Failed to check format support: 0x%08lx\n", hr); + ERR("Failed to check format support: 0x%08lx\n", hr); hr = IAudioClient_GetMixFormat(data->client, &wfx); } if(FAILED(hr)) { - ERROR("Failed to find a supported format: 0x%08lx\n", hr); + ERR("Failed to find a supported format: 0x%08lx\n", hr); return ALC_FALSE; } @@ -386,7 +386,7 @@ static ALCboolean MMDevApiResetPlayback(ALCdevice *device) if(device->Frequency != OutputType.Format.nSamplesPerSec) { if((device->Flags&DEVICE_FREQUENCY_REQUEST)) - ERROR("Failed to set %dhz, got %dhz instead\n", device->Frequency, OutputType.Format.nSamplesPerSec); + ERR("Failed to set %dhz, got %dhz instead\n", device->Frequency, OutputType.Format.nSamplesPerSec); device->Flags &= ~DEVICE_FREQUENCY_REQUEST; device->Frequency = OutputType.Format.nSamplesPerSec; } @@ -400,7 +400,7 @@ static ALCboolean MMDevApiResetPlayback(ALCdevice *device) (device->FmtChans == DevFmtX71 && OutputType.Format.nChannels == 8 && OutputType.dwChannelMask == X7DOT1))) { if((device->Flags&DEVICE_CHANNELS_REQUEST)) - ERROR("Failed to set %s, got %d channels (0x%08x) instead\n", DevFmtChannelsString(device->FmtChans), OutputType.Format.nChannels, OutputType.dwChannelMask); + ERR("Failed to set %s, got %d channels (0x%08x) instead\n", DevFmtChannelsString(device->FmtChans), OutputType.Format.nChannels, OutputType.dwChannelMask); device->Flags &= ~DEVICE_CHANNELS_REQUEST; if(OutputType.Format.nChannels == 1 && OutputType.dwChannelMask == MONO) @@ -419,7 +419,7 @@ static ALCboolean MMDevApiResetPlayback(ALCdevice *device) device->FmtChans = DevFmtX71; else { - ERROR("Unhandled extensible channels: %d -- 0x%08x\n", OutputType.Format.nChannels, OutputType.dwChannelMask); + ERR("Unhandled extensible channels: %d -- 0x%08x\n", OutputType.Format.nChannels, OutputType.dwChannelMask); device->FmtChans = DevFmtStereo; OutputType.Format.nChannels = 2; OutputType.dwChannelMask = STEREO; @@ -434,7 +434,7 @@ static ALCboolean MMDevApiResetPlayback(ALCdevice *device) !((device->FmtType == DevFmtUByte && OutputType.Format.wBitsPerSample == 8) || (device->FmtType == DevFmtShort && OutputType.Format.wBitsPerSample == 16))) { - ERROR("Failed to set %s samples, got %d/%d-bit instead\n", DevFmtTypeString(device->FmtType), OutputType.Samples.wValidBitsPerSample, OutputType.Format.wBitsPerSample); + ERR("Failed to set %s samples, got %d/%d-bit instead\n", DevFmtTypeString(device->FmtType), OutputType.Samples.wValidBitsPerSample, OutputType.Format.wBitsPerSample); if(OutputType.Format.wBitsPerSample == 8) device->FmtType = DevFmtUByte; else if(OutputType.Format.wBitsPerSample == 16) @@ -454,7 +454,7 @@ static ALCboolean MMDevApiResetPlayback(ALCdevice *device) if(OutputType.Samples.wValidBitsPerSample != OutputType.Format.wBitsPerSample || !((device->FmtType == DevFmtFloat && OutputType.Format.wBitsPerSample == 32))) { - ERROR("Failed to set %s samples, got %d/%d-bit instead\n", DevFmtTypeString(device->FmtType), OutputType.Samples.wValidBitsPerSample, OutputType.Format.wBitsPerSample); + ERR("Failed to set %s samples, got %d/%d-bit instead\n", DevFmtTypeString(device->FmtType), OutputType.Samples.wValidBitsPerSample, OutputType.Format.wBitsPerSample); if(OutputType.Format.wBitsPerSample != 32) { device->FmtType = DevFmtFloat; @@ -465,7 +465,7 @@ static ALCboolean MMDevApiResetPlayback(ALCdevice *device) } else { - ERROR("Unhandled format sub-type\n"); + ERR("Unhandled format sub-type\n"); device->FmtType = DevFmtShort; OutputType.Format.wBitsPerSample = 16; OutputType.Samples.wValidBitsPerSample = OutputType.Format.wBitsPerSample; @@ -482,7 +482,7 @@ static ALCboolean MMDevApiResetPlayback(ALCdevice *device) 0, &OutputType.Format, NULL); if(FAILED(hr)) { - ERROR("Failed to initialize audio client: 0x%08lx\n", hr); + ERR("Failed to initialize audio client: 0x%08lx\n", hr); return ALC_FALSE; } @@ -491,7 +491,7 @@ static ALCboolean MMDevApiResetPlayback(ALCdevice *device) hr = IAudioClient_GetBufferSize(data->client, &buffer_len); if(FAILED(hr)) { - ERROR("Failed to get audio buffer info: 0x%08lx\n", hr); + ERR("Failed to get audio buffer info: 0x%08lx\n", hr); return ALC_FALSE; } @@ -500,14 +500,14 @@ static ALCboolean MMDevApiResetPlayback(ALCdevice *device) if(device->NumUpdates <= 1) { device->NumUpdates = 1; - ERROR("Audio client returned default_period > buffer_len/2; expect break up\n"); + ERR("Audio client returned default_period > buffer_len/2; expect break up\n"); } device->UpdateSize = buffer_len / device->NumUpdates; hr = IAudioClient_Start(data->client); if(FAILED(hr)) { - ERROR("Failed to start audio client: 0x%08lx\n", hr); + ERR("Failed to start audio client: 0x%08lx\n", hr); return ALC_FALSE; } @@ -515,7 +515,7 @@ static ALCboolean MMDevApiResetPlayback(ALCdevice *device) if(!data->thread) { IAudioClient_Stop(data->client); - ERROR("Failed to start thread\n"); + ERR("Failed to start thread\n"); return ALC_FALSE; } @@ -109,7 +109,7 @@ static ALCboolean null_reset_playback(ALCdevice *device) data->buffer = malloc(data->size); if(!data->buffer) { - ERROR("Buffer malloc failed\n"); + ERR("Buffer malloc failed\n"); return ALC_FALSE; } SetDefaultWFXChannelOrder(device); diff --git a/Alc/opensl.c b/Alc/opensl.c index 37b88f2b..40fa998f 100644 --- a/Alc/opensl.c +++ b/Alc/opensl.c @@ -161,7 +161,7 @@ static const char *res_str(SLresult result) #define PRINTERR(x, s) do { \ if((x) != SL_RESULT_SUCCESS) \ - ERROR("%s: %s\n", (s), res_str((x))); \ + ERR("%s: %s\n", (s), res_str((x))); \ } while(0) /* this callback handler is called every time a buffer finishes playing */ @@ -98,7 +98,7 @@ static ALuint OSSProc(ALvoid *ptr) { if(errno != EAGAIN && errno != EWOULDBLOCK && errno != EINTR) { - ERROR("write failed: %s\n", strerror(errno)); + ERR("write failed: %s\n", strerror(errno)); aluHandleDisconnect(pDevice); break; } @@ -131,7 +131,7 @@ static ALuint OSSCaptureProc(ALvoid *ptr) amt = read(data->fd, data->mix_data, data->data_size); if(amt < 0) { - ERROR("read failed: %s\n", strerror(errno)); + ERR("read failed: %s\n", strerror(errno)); aluHandleDisconnect(pDevice); break; } @@ -166,7 +166,7 @@ static ALCboolean oss_open_playback(ALCdevice *device, const ALCchar *deviceName if(data->fd == -1) { free(data); - ERROR("Could not open %s: %s\n", driver, strerror(errno)); + ERR("Could not open %s: %s\n", driver, strerror(errno)); return ALC_FALSE; } @@ -243,14 +243,14 @@ static ALCboolean oss_reset_playback(ALCdevice *device) if(0) { err: - ERROR("%s failed: %s\n", err, strerror(errno)); + ERR("%s failed: %s\n", err, strerror(errno)); return ALC_FALSE; } #undef CHECKERR if((int)ChannelsFromDevFmt(device->FmtChans) != numChannels) { - ERROR("Failed to set %s, got %d channels instead\n", DevFmtChannelsString(device->FmtChans), numChannels); + ERR("Failed to set %s, got %d channels instead\n", DevFmtChannelsString(device->FmtChans), numChannels); return ALC_FALSE; } @@ -258,14 +258,14 @@ static ALCboolean oss_reset_playback(ALCdevice *device) (ossFormat == AFMT_U8 && device->FmtType == DevFmtUByte) || (ossFormat == AFMT_S16_NE && device->FmtType == DevFmtShort))) { - ERROR("Failed to set %s samples, got OSS format %#x\n", DevFmtTypeString(device->FmtType), ossFormat); + ERR("Failed to set %s samples, got OSS format %#x\n", DevFmtTypeString(device->FmtType), ossFormat); return ALC_FALSE; } if(device->Frequency != (ALuint)ossSpeed) { if((device->Flags&DEVICE_FREQUENCY_REQUEST)) - ERROR("Failed to set %dhz, got %dhz instead\n", device->Frequency, ossSpeed); + ERR("Failed to set %dhz, got %dhz instead\n", device->Frequency, ossSpeed); device->Flags &= ~DEVICE_FREQUENCY_REQUEST; device->Frequency = ossSpeed; } @@ -301,7 +301,7 @@ static void oss_stop_playback(ALCdevice *device) data->killNow = 0; if(ioctl(data->fd, SNDCTL_DSP_RESET) != 0) - ERROR("Error resetting device: %s\n", strerror(errno)); + ERR("Error resetting device: %s\n", strerror(errno)); free(data->mix_data); data->mix_data = NULL; @@ -336,7 +336,7 @@ static ALCboolean oss_open_capture(ALCdevice *device, const ALCchar *deviceName) if(data->fd == -1) { free(data); - ERROR("Could not open %s: %s\n", driver, strerror(errno)); + ERR("Could not open %s: %s\n", driver, strerror(errno)); return ALC_FALSE; } @@ -354,7 +354,7 @@ static ALCboolean oss_open_capture(ALCdevice *device, const ALCchar *deviceName) case DevFmtUShort: case DevFmtFloat: free(data); - ERROR("%s capture samples not supported on OSS\n", DevFmtTypeString(device->FmtType)); + ERR("%s capture samples not supported on OSS\n", DevFmtTypeString(device->FmtType)); return ALC_FALSE; } @@ -382,7 +382,7 @@ static ALCboolean oss_open_capture(ALCdevice *device, const ALCchar *deviceName) if(0) { err: - ERROR("%s failed: %s\n", err, strerror(errno)); + ERR("%s failed: %s\n", err, strerror(errno)); close(data->fd); free(data); return ALC_FALSE; @@ -391,7 +391,7 @@ static ALCboolean oss_open_capture(ALCdevice *device, const ALCchar *deviceName) if((int)ChannelsFromDevFmt(device->FmtChans) != numChannels) { - ERROR("Failed to set %s, got %d channels instead\n", DevFmtChannelsString(device->FmtChans), numChannels); + ERR("Failed to set %s, got %d channels instead\n", DevFmtChannelsString(device->FmtChans), numChannels); close(data->fd); free(data); return ALC_FALSE; @@ -401,7 +401,7 @@ static ALCboolean oss_open_capture(ALCdevice *device, const ALCchar *deviceName) (ossFormat == AFMT_U8 && device->FmtType == DevFmtUByte) || (ossFormat == AFMT_S16_NE && device->FmtType == DevFmtShort))) { - ERROR("Failed to set %s samples, got OSS format %#x\n", DevFmtTypeString(device->FmtType), ossFormat); + ERR("Failed to set %s samples, got OSS format %#x\n", DevFmtTypeString(device->FmtType), ossFormat); close(data->fd); free(data); return ALC_FALSE; @@ -410,7 +410,7 @@ static ALCboolean oss_open_capture(ALCdevice *device, const ALCchar *deviceName) data->ring = CreateRingBuffer(frameSize, device->UpdateSize * device->NumUpdates); if(!data->ring) { - ERROR("Ring buffer create failed\n"); + ERR("Ring buffer create failed\n"); close(data->fd); free(data); return ALC_FALSE; diff --git a/Alc/panning.c b/Alc/panning.c index 08183c94..2757a51f 100644 --- a/Alc/panning.c +++ b/Alc/panning.c @@ -89,7 +89,7 @@ static void SetSpeakerArrangement(const char *name, ALfloat SpeakerAngle[MAXCHAN val = SIDE_RIGHT; else { - ERROR("Unknown speaker for %s: \"%s\"\n", name, confkey); + ERR("Unknown speaker for %s: \"%s\"\n", name, confkey); continue; } @@ -105,7 +105,7 @@ static void SetSpeakerArrangement(const char *name, ALfloat SpeakerAngle[MAXCHAN if(angle >= -180 && angle <= 180) SpeakerAngle[i] = angle * M_PI/180.0f; else - ERROR("Invalid angle for speaker \"%s\": %ld\n", confkey, angle); + ERR("Invalid angle for speaker \"%s\": %ld\n", confkey, angle); break; } } diff --git a/Alc/portaudio.c b/Alc/portaudio.c index 0ccfc7fd..21f43ae2 100644 --- a/Alc/portaudio.c +++ b/Alc/portaudio.c @@ -104,7 +104,7 @@ void *pa_load(void) if((err=Pa_Initialize()) != paNoError) { - ERROR("Pa_Initialize() returned an error: %s\n", Pa_GetErrorText(err)); + ERR("Pa_Initialize() returned an error: %s\n", Pa_GetErrorText(err)); CloseLib(pa_handle); pa_handle = NULL; return NULL; @@ -204,7 +204,7 @@ static ALCboolean pa_open_playback(ALCdevice *device, const ALCchar *deviceName) device->UpdateSize, paNoFlag, pa_callback, device); if(err != paNoError) { - ERROR("Pa_OpenStream() returned an error: %s\n", Pa_GetErrorText(err)); + ERR("Pa_OpenStream() returned an error: %s\n", Pa_GetErrorText(err)); device->ExtraData = NULL; free(data); return ALC_FALSE; @@ -216,14 +216,14 @@ static ALCboolean pa_open_playback(ALCdevice *device, const ALCchar *deviceName) { if(outParams.channelCount != 1 && outParams.channelCount != 2) { - ERROR("Unhandled channel count: %u\n", outParams.channelCount); + ERR("Unhandled channel count: %u\n", outParams.channelCount); Pa_CloseStream(data->stream); device->ExtraData = NULL; free(data); return ALC_FALSE; } if((device->Flags&DEVICE_CHANNELS_REQUEST)) - ERROR("Failed to set %s, got %u channels instead\n", DevFmtChannelsString(device->FmtChans), outParams.channelCount); + ERR("Failed to set %s, got %u channels instead\n", DevFmtChannelsString(device->FmtChans), outParams.channelCount); device->Flags &= ~DEVICE_CHANNELS_REQUEST; device->FmtChans = ((outParams.channelCount==1) ? DevFmtMono : DevFmtStereo); } @@ -238,7 +238,7 @@ static void pa_close_playback(ALCdevice *device) err = Pa_CloseStream(data->stream); if(err != paNoError) - ERROR("Error closing stream: %s\n", Pa_GetErrorText(err)); + ERR("Error closing stream: %s\n", Pa_GetErrorText(err)); free(data); device->ExtraData = NULL; @@ -254,7 +254,7 @@ static ALCboolean pa_reset_playback(ALCdevice *device) if(device->Frequency != streamInfo->sampleRate) { if((device->Flags&DEVICE_FREQUENCY_REQUEST)) - ERROR("PortAudio does not support changing sample rates (wanted %dhz, got %.1fhz)\n", device->Frequency, streamInfo->sampleRate); + ERR("PortAudio does not support changing sample rates (wanted %dhz, got %.1fhz)\n", device->Frequency, streamInfo->sampleRate); device->Flags &= ~DEVICE_FREQUENCY_REQUEST; device->Frequency = streamInfo->sampleRate; } @@ -263,7 +263,7 @@ static ALCboolean pa_reset_playback(ALCdevice *device) err = Pa_StartStream(data->stream); if(err != paNoError) { - ERROR("Pa_StartStream() returned an error: %s\n", Pa_GetErrorText(err)); + ERR("Pa_StartStream() returned an error: %s\n", Pa_GetErrorText(err)); return ALC_FALSE; } @@ -277,7 +277,7 @@ static void pa_stop_playback(ALCdevice *device) err = Pa_StopStream(data->stream); if(err != paNoError) - ERROR("Error stopping stream: %s\n", Pa_GetErrorText(err)); + ERR("Error stopping stream: %s\n", Pa_GetErrorText(err)); } @@ -332,7 +332,7 @@ static ALCboolean pa_open_capture(ALCdevice *device, const ALCchar *deviceName) inParams.sampleFormat = paFloat32; break; case DevFmtUShort: - ERROR("Unsigned short samples not supported\n"); + ERR("Unsigned short samples not supported\n"); goto error; } inParams.channelCount = ChannelsFromDevFmt(device->FmtChans); @@ -341,7 +341,7 @@ static ALCboolean pa_open_capture(ALCdevice *device, const ALCchar *deviceName) paFramesPerBufferUnspecified, paNoFlag, pa_capture_cb, device); if(err != paNoError) { - ERROR("Pa_OpenStream() returned an error: %s\n", Pa_GetErrorText(err)); + ERR("Pa_OpenStream() returned an error: %s\n", Pa_GetErrorText(err)); goto error; } @@ -363,7 +363,7 @@ static void pa_close_capture(ALCdevice *device) err = Pa_CloseStream(data->stream); if(err != paNoError) - ERROR("Error closing stream: %s\n", Pa_GetErrorText(err)); + ERR("Error closing stream: %s\n", Pa_GetErrorText(err)); free(data); device->ExtraData = NULL; @@ -376,7 +376,7 @@ static void pa_start_capture(ALCdevice *device) err = Pa_StartStream(data->stream); if(err != paNoError) - ERROR("Error starting stream: %s\n", Pa_GetErrorText(err)); + ERR("Error starting stream: %s\n", Pa_GetErrorText(err)); } static void pa_stop_capture(ALCdevice *device) @@ -386,7 +386,7 @@ static void pa_stop_capture(ALCdevice *device) err = Pa_StopStream(data->stream); if(err != paNoError) - ERROR("Error stopping stream: %s\n", Pa_GetErrorText(err)); + ERR("Error stopping stream: %s\n", Pa_GetErrorText(err)); } static void pa_capture_samples(ALCdevice *device, ALCvoid *buffer, ALCuint samples) diff --git a/Alc/pulseaudio.c b/Alc/pulseaudio.c index 32050cb1..c3561bed 100644 --- a/Alc/pulseaudio.c +++ b/Alc/pulseaudio.c @@ -369,7 +369,7 @@ static void stream_buffer_attr_callback(pa_stream *stream, void *pdata) //{{{ if(Device->NumUpdates <= 1) { Device->NumUpdates = 1; - ERROR("PulseAudio returned minreq > tlength/2; expect break up\n"); + ERR("PulseAudio returned minreq > tlength/2; expect break up\n"); } UnlockDevice(Device); @@ -391,7 +391,7 @@ static void context_state_callback2(pa_context *context, void *pdata) //{{{ if(pa_context_get_state(context) == PA_CONTEXT_FAILED) { - ERROR("Received context failure!\n"); + ERR("Received context failure!\n"); aluHandleDisconnect(Device); } pa_threaded_mainloop_signal(data->loop, 0); @@ -404,7 +404,7 @@ static void stream_state_callback2(pa_stream *stream, void *pdata) //{{{ if(pa_stream_get_state(stream) == PA_STREAM_FAILED) { - ERROR("Received stream failure!\n"); + ERR("Received stream failure!\n"); aluHandleDisconnect(Device); } pa_threaded_mainloop_signal(data->loop, 0); @@ -470,7 +470,7 @@ static void sink_info_callback(pa_context *context, const pa_sink_info *info, in } pa_channel_map_snprint(chanmap_str, sizeof(chanmap_str), &info->channel_map); - ERROR("Failed to find format for channel map:\n %s\n", chanmap_str); + ERR("Failed to find format for channel map:\n %s\n", chanmap_str); }//}}} static void sink_device_callback(pa_context *context, const pa_sink_info *info, int eol, void *pdata) //{{{ @@ -628,7 +628,7 @@ static pa_context *connect_context(pa_threaded_mainloop *loop, ALboolean silent) context = pa_context_new(pa_threaded_mainloop_get_api(loop), name); if(!context) { - ERROR("pa_context_new() failed\n"); + ERR("pa_context_new() failed\n"); return NULL; } @@ -653,7 +653,7 @@ static pa_context *connect_context(pa_threaded_mainloop *loop, ALboolean silent) if(err < 0) { if(!silent) - ERROR("Context did not connect: %s\n", pa_strerror(err)); + ERR("Context did not connect: %s\n", pa_strerror(err)); pa_context_unref(context); return NULL; } @@ -672,8 +672,8 @@ static pa_stream *connect_playback_stream(ALCdevice *device, stream = pa_stream_new(data->context, "Playback Stream", spec, chanmap); if(!stream) { - ERROR("pa_stream_new() failed: %s\n", - pa_strerror(pa_context_errno(data->context))); + ERR("pa_stream_new() failed: %s\n", + pa_strerror(pa_context_errno(data->context))); return NULL; } @@ -681,8 +681,8 @@ static pa_stream *connect_playback_stream(ALCdevice *device, if(pa_stream_connect_playback(stream, data->device_name, attr, flags, NULL, NULL) < 0) { - ERROR("Stream did not connect: %s\n", - pa_strerror(pa_context_errno(data->context))); + ERR("Stream did not connect: %s\n", + pa_strerror(pa_context_errno(data->context))); pa_stream_unref(stream); return NULL; } @@ -691,8 +691,8 @@ static pa_stream *connect_playback_stream(ALCdevice *device, { if(!PA_STREAM_IS_GOOD(state)) { - ERROR("Stream did not get ready: %s\n", - pa_strerror(pa_context_errno(data->context))); + ERR("Stream did not get ready: %s\n", + pa_strerror(pa_context_errno(data->context))); pa_stream_unref(stream); return NULL; } @@ -762,12 +762,12 @@ static ALCboolean pulse_open(ALCdevice *device, const ALCchar *device_name) //{{ if(!(data->loop = pa_threaded_mainloop_new())) { - ERROR("pa_threaded_mainloop_new() failed!\n"); + ERR("pa_threaded_mainloop_new() failed!\n"); goto out; } if(pa_threaded_mainloop_start(data->loop) < 0) { - ERROR("pa_threaded_mainloop_start() failed\n"); + ERR("pa_threaded_mainloop_start() failed\n"); goto out; } @@ -879,7 +879,7 @@ static ALCboolean pulse_open_playback(ALCdevice *device, const ALCchar *device_n if(pa_stream_is_suspended(stream)) { - ERROR("Device is suspended\n"); + ERR("Device is suspended\n"); pa_stream_disconnect(stream); pa_stream_unref(stream); pa_threaded_mainloop_unlock(data->loop); @@ -957,14 +957,14 @@ static ALCboolean pulse_reset_playback(ALCdevice *device) //{{{ if(pa_sample_spec_valid(&data->spec) == 0) { - ERROR("Invalid sample format\n"); + ERR("Invalid sample format\n"); pa_threaded_mainloop_unlock(data->loop); return ALC_FALSE; } if(!pa_channel_map_init_auto(&chanmap, data->spec.channels, PA_CHANNEL_MAP_WAVEEX)) { - ERROR("Couldn't build map for channel count (%d)!\n", data->spec.channels); + ERR("Couldn't build map for channel count (%d)!\n", data->spec.channels); pa_threaded_mainloop_unlock(data->loop); return ALC_FALSE; } @@ -985,7 +985,7 @@ static ALCboolean pulse_reset_playback(ALCdevice *device) //{{{ pa_operation *o; if((device->Flags&DEVICE_FREQUENCY_REQUEST)) - ERROR("Failed to set frequency %dhz, got %dhz instead\n", device->Frequency, data->spec.rate); + ERR("Failed to set frequency %dhz, got %dhz instead\n", device->Frequency, data->spec.rate); device->Flags &= ~DEVICE_FREQUENCY_REQUEST; /* Server updated our playback rate, so modify the buffer attribs @@ -1140,21 +1140,21 @@ static ALCboolean pulse_open_capture(ALCdevice *device, const ALCchar *device_na break; case DevFmtByte: case DevFmtUShort: - ERROR("Capture format type %#x capture not supported on PulseAudio\n", device->FmtType); + ERR("Capture format type %#x capture not supported on PulseAudio\n", device->FmtType); pa_threaded_mainloop_unlock(data->loop); goto fail; } if(pa_sample_spec_valid(&data->spec) == 0) { - ERROR("Invalid sample format\n"); + ERR("Invalid sample format\n"); pa_threaded_mainloop_unlock(data->loop); goto fail; } if(!pa_channel_map_init_auto(&chanmap, data->spec.channels, PA_CHANNEL_MAP_WAVEEX)) { - ERROR("Couldn't build map for channel count (%d)!\n", data->spec.channels); + ERR("Couldn't build map for channel count (%d)!\n", data->spec.channels); pa_threaded_mainloop_unlock(data->loop); goto fail; } @@ -1162,8 +1162,8 @@ static ALCboolean pulse_open_capture(ALCdevice *device, const ALCchar *device_na data->stream = pa_stream_new(data->context, "Capture Stream", &data->spec, &chanmap); if(!data->stream) { - ERROR("pa_stream_new() failed: %s\n", - pa_strerror(pa_context_errno(data->context))); + ERR("pa_stream_new() failed: %s\n", + pa_strerror(pa_context_errno(data->context))); pa_threaded_mainloop_unlock(data->loop); goto fail; @@ -1174,8 +1174,8 @@ static ALCboolean pulse_open_capture(ALCdevice *device, const ALCchar *device_na flags |= PA_STREAM_START_CORKED|PA_STREAM_ADJUST_LATENCY; if(pa_stream_connect_record(data->stream, pulse_name, &data->attr, flags) < 0) { - ERROR("Stream did not connect: %s\n", - pa_strerror(pa_context_errno(data->context))); + ERR("Stream did not connect: %s\n", + pa_strerror(pa_context_errno(data->context))); pa_stream_unref(data->stream); data->stream = NULL; @@ -1188,8 +1188,8 @@ static ALCboolean pulse_open_capture(ALCdevice *device, const ALCchar *device_na { if(!PA_STREAM_IS_GOOD(state)) { - ERROR("Stream did not get ready: %s\n", - pa_strerror(pa_context_errno(data->context))); + ERR("Stream did not get ready: %s\n", + pa_strerror(pa_context_errno(data->context))); pa_stream_unref(data->stream); data->stream = NULL; @@ -1257,8 +1257,8 @@ static ALCuint pulse_available_samples(ALCdevice *device) //{{{ if(pa_stream_peek(data->stream, &buf, &length) < 0) { - ERROR("pa_stream_peek() failed: %s\n", - pa_strerror(pa_context_errno(data->context))); + ERR("pa_stream_peek() failed: %s\n", + pa_strerror(pa_context_errno(data->context))); break; } diff --git a/Alc/sndio.c b/Alc/sndio.c index d8da17ee..4c61dffd 100644 --- a/Alc/sndio.c +++ b/Alc/sndio.c @@ -151,7 +151,7 @@ static ALuint sndio_proc(ALvoid *ptr) wrote = sio_write(data->sndHandle, WritePtr, len); if(wrote == 0) { - ERROR("sio_write failed\n"); + ERR("sio_write failed\n"); aluHandleDisconnect(device); break; } @@ -185,7 +185,7 @@ static ALCboolean sndio_open_playback(ALCdevice *device, const ALCchar *deviceNa if(data->sndHandle == NULL) { free(data); - ERROR("Could not open device\n"); + ERR("Could not open device\n"); return ALC_FALSE; } @@ -246,14 +246,14 @@ static ALCboolean sndio_reset_playback(ALCdevice *device) if(!sio_setpar(data->sndHandle, &par) || !sio_getpar(data->sndHandle, &par)) { - ERROR("Failed to set device parameters\n"); + ERR("Failed to set device parameters\n"); return ALC_FALSE; } if(par.rate != device->Frequency) { if((device->Flags&DEVICE_FREQUENCY_REQUEST)) - ERROR("Failed to set frequency %uhz, got %uhz instead\n", device->Frequency, par.rate); + ERR("Failed to set frequency %uhz, got %uhz instead\n", device->Frequency, par.rate); device->Flags &= ~DEVICE_FREQUENCY_REQUEST; device->Frequency = par.rate; } @@ -262,18 +262,18 @@ static ALCboolean sndio_reset_playback(ALCdevice *device) { if(par.pchan != 1 && par.pchan != 2) { - ERROR("Unhandled channel count: %u\n", par.pchan); + ERR("Unhandled channel count: %u\n", par.pchan); return ALC_FALSE; } if((device->Flags&DEVICE_CHANNELS_REQUEST)) - ERROR("Failed to set %s, got %u channels instead\n", DevFmtChannelsString(device->FmtChans), par.pchan); + ERR("Failed to set %s, got %u channels instead\n", DevFmtChannelsString(device->FmtChans), par.pchan); device->Flags &= ~DEVICE_CHANNELS_REQUEST; device->FmtChans = ((par.pchan==1) ? DevFmtMono : DevFmtStereo); } if(par.bits != par.bps*8) { - ERROR("Padded samples not supported (%u of %u bits)\n", par.bits, par.bps*8); + ERR("Padded samples not supported (%u of %u bits)\n", par.bits, par.bps*8); return ALC_FALSE; } @@ -287,7 +287,7 @@ static ALCboolean sndio_reset_playback(ALCdevice *device) device->FmtType = DevFmtUShort; else { - ERROR("Unhandled sample format: %s %u-bit\n", (par.sig?"signed":"unsigned"), par.bits); + ERR("Unhandled sample format: %s %u-bit\n", (par.sig?"signed":"unsigned"), par.bits); return ALC_FALSE; } @@ -300,7 +300,7 @@ static ALCboolean sndio_reset_playback(ALCdevice *device) if(!sio_start(data->sndHandle)) { - ERROR("Error starting playback\n"); + ERR("Error starting playback\n"); return ALC_FALSE; } @@ -332,7 +332,7 @@ static void sndio_stop_playback(ALCdevice *device) data->killNow = 0; if(!sio_stop(data->sndHandle)) - ERROR("Error stopping device\n"); + ERR("Error stopping device\n"); free(data->mix_data); data->mix_data = NULL; diff --git a/Alc/solaris.c b/Alc/solaris.c index 32fec944..d020ed4b 100644 --- a/Alc/solaris.c +++ b/Alc/solaris.c @@ -73,7 +73,7 @@ static ALuint SolarisProc(ALvoid *ptr) { if(errno != EAGAIN && errno != EWOULDBLOCK && errno != EINTR) { - ERROR("write failed: %s\n", strerror(errno)); + ERR("write failed: %s\n", strerror(errno)); aluHandleDisconnect(pDevice); break; } @@ -111,7 +111,7 @@ static ALCboolean solaris_open_playback(ALCdevice *device, const ALCchar *device if(data->fd == -1) { free(data); - ERROR("Could not open %s: %s\n", driver, strerror(errno)); + ERR("Could not open %s: %s\n", driver, strerror(errno)); return ALC_FALSE; } @@ -170,13 +170,13 @@ static ALCboolean solaris_reset_playback(ALCdevice *device) if(ioctl(data->fd, AUDIO_SETINFO, &info) < 0) { - ERROR("ioctl failed: %s\n", strerror(errno)); + ERR("ioctl failed: %s\n", strerror(errno)); return ALC_FALSE; } if(ChannelsFromDevFmt(device->FmtChans) != info.play.channels) { - ERROR("Could not set %d channels, got %d instead\n", ChannelsFromDevFmt(device->FmtChans), info.play.channels); + ERR("Could not set %d channels, got %d instead\n", ChannelsFromDevFmt(device->FmtChans), info.play.channels); return ALC_FALSE; } @@ -187,15 +187,15 @@ static ALCboolean solaris_reset_playback(ALCdevice *device) (info.play.precision == 16 && info.play.encoding == AUDIO_ENCODING_LINEAR && device->FmtType == DevFmtShort))) { - ERROR("Could not set %#x sample type, got %d (%#x)\n", - device->FmtType, info.play.precision, info.play.encoding); + ERR("Could not set %#x sample type, got %d (%#x)\n", + device->FmtType, info.play.precision, info.play.encoding); return ALC_FALSE; } if(device->Frequency != info.play.sample_rate) { if((device->Flags&DEVICE_FREQUENCY_REQUEST)) - ERROR("Failed to set requested frequency %dhz, got %dhz instead\n", device->Frequency, info.play.sample_rate); + ERR("Failed to set requested frequency %dhz, got %dhz instead\n", device->Frequency, info.play.sample_rate); device->Flags &= ~DEVICE_FREQUENCY_REQUEST; device->Frequency = info.play.sample_rate; } @@ -230,7 +230,7 @@ static void solaris_stop_playback(ALCdevice *device) data->killNow = 0; if(ioctl(data->fd, AUDIO_DRAIN) < 0) - ERROR("Error draining device: %s\n", strerror(errno)); + ERR("Error draining device: %s\n", strerror(errno)); free(data->mix_data); data->mix_data = NULL; @@ -149,7 +149,7 @@ static ALuint WaveProc(ALvoid *ptr) data->f); if(ferror(data->f)) { - ERROR("Error writing to file\n"); + ERR("Error writing to file\n"); aluHandleDisconnect(pDevice); break; } @@ -179,7 +179,7 @@ static ALCboolean wave_open_playback(ALCdevice *device, const ALCchar *deviceNam if(!data->f) { free(data); - ERROR("Could not open file '%s': %s\n", fname, strerror(errno)); + ERR("Could not open file '%s': %s\n", fname, strerror(errno)); return ALC_FALSE; } @@ -256,7 +256,7 @@ static ALCboolean wave_reset_playback(ALCdevice *device) if(ferror(data->f)) { - ERROR("Error writing header: %s\n", strerror(errno)); + ERR("Error writing header: %s\n", strerror(errno)); return ALC_FALSE; } @@ -266,7 +266,7 @@ static ALCboolean wave_reset_playback(ALCdevice *device) data->buffer = malloc(data->size); if(!data->buffer) { - ERROR("Buffer malloc failed\n"); + ERR("Buffer malloc failed\n"); return ALC_FALSE; } diff --git a/Alc/winmm.c b/Alc/winmm.c index b6fa4da3..900d51db 100644 --- a/Alc/winmm.c +++ b/Alc/winmm.c @@ -341,7 +341,7 @@ static ALCboolean WinMMOpenPlayback(ALCdevice *pDevice, const ALCchar *deviceNam if((pDevice->Flags&DEVICE_CHANNELS_REQUEST) && pDevice->FmtChans != DevFmtStereo) { - ERROR("Failed to set %s, got Stereo instead\n", DevFmtChannelsString(pDevice->FmtChans)); + ERR("Failed to set %s, got Stereo instead\n", DevFmtChannelsString(pDevice->FmtChans)); pDevice->Flags &= ~DEVICE_CHANNELS_REQUEST; } pDevice->FmtChans = DevFmtStereo; @@ -373,7 +373,7 @@ static ALCboolean WinMMOpenPlayback(ALCdevice *pDevice, const ALCchar *deviceNam if((res=waveOutOpen(&pData->hWaveHandle.Out, lDeviceID, &wfexFormat, (DWORD_PTR)&WaveOutProc, (DWORD_PTR)pDevice, CALLBACK_FUNCTION)) != MMSYSERR_NOERROR) { - ERROR("waveOutOpen failed: %u\n", res); + ERR("waveOutOpen failed: %u\n", res); goto failure; } @@ -381,7 +381,7 @@ static ALCboolean WinMMOpenPlayback(ALCdevice *pDevice, const ALCchar *deviceNam pData->hWaveThreadEvent = CreateEvent(NULL, AL_TRUE, AL_FALSE, "WaveOutThreadDestroyed"); if(pData->hWaveHdrEvent == NULL || pData->hWaveThreadEvent == NULL) { - ERROR("CreateEvent failed: %lu\n", GetLastError()); + ERR("CreateEvent failed: %lu\n", GetLastError()); goto failure; } @@ -439,7 +439,7 @@ static ALCboolean WinMMResetPlayback(ALCdevice *device) if(device->Frequency != pData->Frequency) { if((device->Flags&DEVICE_FREQUENCY_REQUEST)) - ERROR("WinMM does not support changing sample rates (wanted %dhz, got %dhz)\n", device->Frequency, pData->Frequency); + ERR("WinMM does not support changing sample rates (wanted %dhz, got %dhz)\n", device->Frequency, pData->Frequency); device->Flags &= ~DEVICE_FREQUENCY_REQUEST; device->Frequency = pData->Frequency; } @@ -570,7 +570,7 @@ static ALCboolean WinMMOpenCapture(ALCdevice *pDevice, const ALCchar *deviceName if((res=waveInOpen(&pData->hWaveHandle.In, lDeviceID, &wfexCaptureFormat, (DWORD_PTR)&WaveInProc, (DWORD_PTR)pDevice, CALLBACK_FUNCTION)) != MMSYSERR_NOERROR) { - ERROR("waveInOpen failed: %u\n", res); + ERR("waveInOpen failed: %u\n", res); goto failure; } @@ -578,7 +578,7 @@ static ALCboolean WinMMOpenCapture(ALCdevice *pDevice, const ALCchar *deviceName pData->hWaveThreadEvent = CreateEvent(NULL, AL_TRUE, AL_FALSE, "WaveInThreadDestroyed"); if(pData->hWaveHdrEvent == NULL || pData->hWaveThreadEvent == NULL) { - ERROR("CreateEvent failed: %lu\n", GetLastError()); + ERR("CreateEvent failed: %lu\n", GetLastError()); goto failure; } diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index e10201be..092da0da 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -552,7 +552,7 @@ extern enum LogLevel LogLevel; AL_PRINT(__VA_ARGS__); \ } while(0) -#define ERROR(...) do { \ +#define ERR(...) do { \ if(LogLevel >= LogError) \ AL_PRINT(__VA_ARGS__); \ } while(0) diff --git a/OpenAL32/alThunk.c b/OpenAL32/alThunk.c index b925175c..e4e99a2c 100644 --- a/OpenAL32/alThunk.c +++ b/OpenAL32/alThunk.c @@ -70,7 +70,7 @@ ALenum alThunkAddEntry(ALvoid *ptr, ALuint *idx) if(!NewList) { LeaveCriticalSection(&g_ThunkLock); - ERROR("Realloc failed to increase to %u enties!\n", g_ThunkArraySize*2); + ERR("Realloc failed to increase to %u enties!\n", g_ThunkArraySize*2); return AL_OUT_OF_MEMORY; } memset(&NewList[g_ThunkArraySize], 0, g_ThunkArraySize*sizeof(ThunkEntry)); |