mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-25 09:17:12 +01:00
Fixed compiler warnings on QNX.
This commit is contained in:
parent
67754af887
commit
03eaddcad4
@ -56,24 +56,6 @@
|
|||||||
#define DEFAULT_CPARAMS_FRAGS_MIN 1
|
#define DEFAULT_CPARAMS_FRAGS_MIN 1
|
||||||
#define DEFAULT_CPARAMS_FRAGS_MAX 1
|
#define DEFAULT_CPARAMS_FRAGS_MAX 1
|
||||||
|
|
||||||
#define QSA_NO_WORKAROUNDS 0x00000000
|
|
||||||
#define QSA_MMAP_WORKAROUND 0x00000001
|
|
||||||
|
|
||||||
struct BuggyCards
|
|
||||||
{
|
|
||||||
char *cardname;
|
|
||||||
unsigned long bugtype;
|
|
||||||
};
|
|
||||||
|
|
||||||
#define QSA_WA_CARDS 3
|
|
||||||
#define QSA_MAX_CARD_NAME_LENGTH 33
|
|
||||||
|
|
||||||
struct BuggyCards buggycards[QSA_WA_CARDS] = {
|
|
||||||
{"Sound Blaster Live!", QSA_MMAP_WORKAROUND},
|
|
||||||
{"Vortex 8820", QSA_MMAP_WORKAROUND},
|
|
||||||
{"Vortex 8830", QSA_MMAP_WORKAROUND},
|
|
||||||
};
|
|
||||||
|
|
||||||
/* List of found devices */
|
/* List of found devices */
|
||||||
#define QSA_MAX_DEVICES 32
|
#define QSA_MAX_DEVICES 32
|
||||||
#define QSA_MAX_NAME_LENGTH 81+16 /* Hardcoded in QSA, can't be changed */
|
#define QSA_MAX_NAME_LENGTH 81+16 /* Hardcoded in QSA, can't be changed */
|
||||||
@ -97,40 +79,16 @@ QSA_SetError(const char *fn, int status)
|
|||||||
return SDL_SetError("QSA: %s() failed: %s", fn, snd_strerror(status));
|
return SDL_SetError("QSA: %s() failed: %s", fn, snd_strerror(status));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* card names check to apply the workarounds */
|
|
||||||
static int
|
|
||||||
QSA_CheckBuggyCards(_THIS, unsigned long checkfor)
|
|
||||||
{
|
|
||||||
char scardname[QSA_MAX_CARD_NAME_LENGTH];
|
|
||||||
int it;
|
|
||||||
|
|
||||||
if (snd_card_get_name
|
|
||||||
(this->hidden->cardno, scardname, QSA_MAX_CARD_NAME_LENGTH - 1) < 0) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (it = 0; it < QSA_WA_CARDS; it++) {
|
|
||||||
if (SDL_strcmp(buggycards[it].cardname, scardname) == 0) {
|
|
||||||
if (buggycards[it].bugtype == checkfor) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* !!! FIXME: does this need to be here? Does the SDL version not work? */
|
/* !!! FIXME: does this need to be here? Does the SDL version not work? */
|
||||||
static void
|
static void
|
||||||
QSA_ThreadInit(_THIS)
|
QSA_ThreadInit(_THIS)
|
||||||
{
|
{
|
||||||
struct sched_param param;
|
|
||||||
int status;
|
|
||||||
|
|
||||||
/* Increase default 10 priority to 25 to avoid jerky sound */
|
/* Increase default 10 priority to 25 to avoid jerky sound */
|
||||||
status = SchedGet(0, 0, ¶m);
|
struct sched_param param;
|
||||||
param.sched_priority = param.sched_curpriority + 15;
|
if (SchedGet(0, 0, ¶m) != -1) {
|
||||||
status = SchedSet(0, 0, SCHED_NOCHANGE, ¶m);
|
param.sched_priority = param.sched_curpriority + 15;
|
||||||
|
SchedSet(0, 0, SCHED_NOCHANGE, ¶m);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* PCM channel parameters initialize function */
|
/* PCM channel parameters initialize function */
|
||||||
@ -385,18 +343,6 @@ QSA_OpenDevice(_THIS, void *handle, const char *devname, int iscapture)
|
|||||||
return QSA_SetError("snd_pcm_open", status);
|
return QSA_SetError("snd_pcm_open", status);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
if (!QSA_CheckBuggyCards(this, QSA_MMAP_WORKAROUND)) {
|
|
||||||
/* Disable QSA MMAP plugin for buggy audio drivers */
|
|
||||||
status =
|
|
||||||
snd_pcm_plugin_set_disable(this->hidden->audio_handle,
|
|
||||||
PLUGIN_DISABLE_MMAP);
|
|
||||||
if (status < 0) {
|
|
||||||
return QSA_SetError("snd_pcm_plugin_set_disable", status);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Try for a closest match on audio format */
|
/* Try for a closest match on audio format */
|
||||||
format = 0;
|
format = 0;
|
||||||
/* can't use format as SND_PCM_SFMT_U8 = 0 in qsa */
|
/* can't use format as SND_PCM_SFMT_U8 = 0 in qsa */
|
||||||
@ -723,8 +669,6 @@ QSA_Deinitialize(void)
|
|||||||
static int
|
static int
|
||||||
QSA_Init(SDL_AudioDriverImpl * impl)
|
QSA_Init(SDL_AudioDriverImpl * impl)
|
||||||
{
|
{
|
||||||
snd_pcm_t *handle = NULL;
|
|
||||||
|
|
||||||
/* Clear devices array */
|
/* Clear devices array */
|
||||||
SDL_zero(qsa_playback_device);
|
SDL_zero(qsa_playback_device);
|
||||||
SDL_zero(qsa_capture_device);
|
SDL_zero(qsa_capture_device);
|
||||||
|
@ -227,13 +227,15 @@ glSetSwapInterval(_THIS, int interval)
|
|||||||
/**
|
/**
|
||||||
* Swaps the EGL buffers associated with the given window
|
* Swaps the EGL buffers associated with the given window
|
||||||
* @param _THIS
|
* @param _THIS
|
||||||
* @paran window Window to swap buffers for
|
* @param window Window to swap buffers for
|
||||||
|
* @return 0 if successful, -1 on error
|
||||||
*/
|
*/
|
||||||
void
|
int
|
||||||
glSwapWindow(_THIS, SDL_Window *window)
|
glSwapWindow(_THIS, SDL_Window *window)
|
||||||
{
|
{
|
||||||
|
/* !!! FIXME: should we migrate this all over to use SDL_egl.c? */
|
||||||
window_impl_t *impl = (window_impl_t *)window->driverdata;
|
window_impl_t *impl = (window_impl_t *)window->driverdata;
|
||||||
eglSwapBuffers(egl_disp, impl->surface);
|
return eglSwapBuffers(egl_disp, impl->surface) == EGL_TRUE ? 0 : -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -40,7 +40,7 @@ extern int glLoadLibrary(_THIS, const char *name);
|
|||||||
void *glGetProcAddress(_THIS, const char *proc);
|
void *glGetProcAddress(_THIS, const char *proc);
|
||||||
extern SDL_GLContext glCreateContext(_THIS, SDL_Window *window);
|
extern SDL_GLContext glCreateContext(_THIS, SDL_Window *window);
|
||||||
extern int glSetSwapInterval(_THIS, int interval);
|
extern int glSetSwapInterval(_THIS, int interval);
|
||||||
extern void glSwapWindow(_THIS, SDL_Window *window);
|
extern int glSwapWindow(_THIS, SDL_Window *window);
|
||||||
extern int glMakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context);
|
extern int glMakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context);
|
||||||
extern void glDeleteContext(_THIS, SDL_GLContext context);
|
extern void glDeleteContext(_THIS, SDL_GLContext context);
|
||||||
extern void glUnloadLibrary(_THIS);
|
extern void glUnloadLibrary(_THIS);
|
||||||
|
Loading…
Reference in New Issue
Block a user