fix some warnings from vita builds (missing includes)

also some tidy-up to whitespace.
This commit is contained in:
Ozkan Sezer 2021-12-07 21:24:24 +03:00
parent 21d46b7e0c
commit 9409642e08
2 changed files with 12 additions and 22 deletions

View File

@ -39,7 +39,7 @@
#include <pspthreadman.h>
/* The tag name used by PSP audio */
#define PSPAUDIO_DRIVER_NAME "psp"
#define PSPAUDIO_DRIVER_NAME "psp"
static int
PSPAUDIO_OpenDevice(_THIS, void *handle, const char *devname, int iscapture)
@ -117,6 +117,7 @@ static void PSPAUDIO_WaitDevice(_THIS)
{
/* Because we block when sending audio, there's no need for this function to do anything. */
}
static Uint8 *PSPAUDIO_GetDeviceBuf(_THIS)
{
return this->hidden->mixbufs[this->hidden->next_buffer];
@ -127,7 +128,7 @@ static void PSPAUDIO_CloseDevice(_THIS)
if (this->hidden->channel >= 0) {
sceAudioChRelease(this->hidden->channel);
}
free(this->hidden->rawbuf); /* this uses memalign(), not SDL_malloc(). */
free(this->hidden->rawbuf); /* this uses memalign(), not SDL_malloc(). */
SDL_free(this->hidden);
}
@ -144,7 +145,6 @@ static void PSPAUDIO_ThreadInit(_THIS)
}
}
static int
PSPAUDIO_Init(SDL_AudioDriverImpl * impl)
{
@ -158,14 +158,9 @@ PSPAUDIO_Init(SDL_AudioDriverImpl * impl)
/* PSP audio device */
impl->OnlyHasDefaultOutputDevice = 1;
/*
impl->HasCaptureSupport = 1;
impl->OnlyHasDefaultCaptureDevice = 1;
*/
/*
impl->DetectDevices = DSOUND_DetectDevices;
impl->Deinitialize = DSOUND_Deinitialize;
impl->HasCaptureSupport = 1;
impl->OnlyHasDefaultCaptureDevice = 1;
*/
return 1; /* this audio target is available. */
}
@ -174,8 +169,6 @@ AudioBootStrap PSPAUDIO_bootstrap = {
"psp", "PSP audio driver", PSPAUDIO_Init, 0
};
/* SDL_AUDI */
#endif /* SDL_AUDIO_DRIVER_PSP */
/* vi: set ts=4 sw=4 expandtab: */

View File

@ -25,6 +25,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <malloc.h> /* memalign() */
#include "SDL_audio.h"
#include "SDL_error.h"
@ -38,10 +39,10 @@
#include <psp2/audioout.h>
#define SCE_AUDIO_SAMPLE_ALIGN(s) (((s) + 63) & ~63)
#define SCE_AUDIO_MAX_VOLUME 0x8000
#define SCE_AUDIO_MAX_VOLUME 0x8000
/* The tag name used by VITA audio */
#define VITAAUD_DRIVER_NAME "vita"
#define VITAAUD_DRIVER_NAME "vita"
static int
VITAAUD_OpenDevice(_THIS, void *handle, const char *devname, int iscapture)
@ -135,10 +136,11 @@ static void VITAAUD_CloseDevice(_THIS)
}
if (this->hidden->rawbuf != NULL) {
free(this->hidden->rawbuf);
free(this->hidden->rawbuf); /* this uses memalign(), not SDL_malloc(). */
this->hidden->rawbuf = NULL;
}
}
static void VITAAUD_ThreadInit(_THIS)
{
/* Increase the priority of this audio thread by 1 to put it
@ -152,11 +154,9 @@ static void VITAAUD_ThreadInit(_THIS)
}
}
static int
VITAAUD_Init(SDL_AudioDriverImpl * impl)
{
/* Set the function pointers */
impl->OpenDevice = VITAAUD_OpenDevice;
impl->PlayDevice = VITAAUD_PlayDevice;
@ -167,11 +167,10 @@ VITAAUD_Init(SDL_AudioDriverImpl * impl)
/* VITA audio device */
impl->OnlyHasDefaultOutputDevice = 1;
/*
/*
impl->HasCaptureSupport = 1;
impl->OnlyHasDefaultInputDevice = 1;
*/
*/
return 1; /* this audio target is available. */
}
@ -179,8 +178,6 @@ AudioBootStrap VITAAUD_bootstrap = {
"vita", "VITA audio driver", VITAAUD_Init, 0
};
/* SDL_AUDI */
#endif /* SDL_AUDIO_DRIVER_VITA */
/* vi: set ts=4 sw=4 expandtab: */