mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-30 23:18:29 +00:00
Change return type from void to int, for functions that set an error
(SDL_SetError(), SDL_OutOfMemory(), SDL_Unsupported(), SDL_InvalidParam()) Update prototype to forward errors to generic layer, for the functions: MoveCursor, WarpMouse, GL_DeleteContext, GetDisplayModes. Check invalid parameter in SDL_SetTextInputRect() generic layer.
This commit is contained in:
@@ -82,11 +82,11 @@ static const Uint8 mix8[] = {
|
||||
#define ADJUST_VOLUME_U8(s, v) ((s) = ((((s) - 128) * (v)) / SDL_MIX_MAXVOLUME) + 128)
|
||||
#define ADJUST_VOLUME_U16(s, v) ((s) = ((((s) - 32768) * (v)) / SDL_MIX_MAXVOLUME) + 32768)
|
||||
|
||||
void SDL_MixAudioFormat(Uint8 *dst, const Uint8 *src, SDL_AudioFormat format,
|
||||
int SDL_MixAudioFormat(Uint8 *dst, const Uint8 *src, SDL_AudioFormat format,
|
||||
Uint32 len, int volume)
|
||||
{
|
||||
if (volume == 0) {
|
||||
return;
|
||||
return 0;
|
||||
}
|
||||
|
||||
switch (format) {
|
||||
@@ -334,7 +334,8 @@ void SDL_MixAudioFormat(Uint8 *dst, const Uint8 *src, SDL_AudioFormat format,
|
||||
} break;
|
||||
|
||||
default: /* If this happens... FIXME! */
|
||||
SDL_SetError("SDL_MixAudioFormat(): unknown audio format");
|
||||
return;
|
||||
return SDL_SetError("SDL_MixAudioFormat(): unknown audio format");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user