From 9409642e08ceafdf10ef9ccc8d6ef9a35dcce9b8 Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Tue, 7 Dec 2021 21:24:24 +0300
Subject: [PATCH] fix some warnings from vita builds (missing includes)
also some tidy-up to whitespace.
---
src/audio/psp/SDL_pspaudio.c | 15 ++++-----------
src/audio/vita/SDL_vitaaudio.c | 17 +++++++----------
2 files changed, 11 insertions(+), 21 deletions(-)
diff --git a/src/audio/psp/SDL_pspaudio.c b/src/audio/psp/SDL_pspaudio.c
index 686ba711970..56d730a859b 100644
--- a/src/audio/psp/SDL_pspaudio.c
+++ b/src/audio/psp/SDL_pspaudio.c
@@ -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;
*/
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: */
diff --git a/src/audio/vita/SDL_vitaaudio.c b/src/audio/vita/SDL_vitaaudio.c
index 88b2b693d82..54238c5a589 100644
--- a/src/audio/vita/SDL_vitaaudio.c
+++ b/src/audio/vita/SDL_vitaaudio.c
@@ -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: */