Fix pulseaudio dynamic linking for Solaris builds.

Fix Solaris Studio compilation errors.
Fix sunaudio backend for SDL2.
This commit is contained in:
Shawn Walker 2013-02-25 22:46:21 +00:00
parent ac51aff110
commit 6398f00da7
6 changed files with 154 additions and 183 deletions

View file

@ -794,6 +794,14 @@ AC_HELP_STRING([--enable-pulseaudio-shared], [dynamically load PulseAudio suppor
test x$enable_pulseaudio_shared = xyes && test x$pulseaudio_lib != x; then test x$enable_pulseaudio_shared = xyes && test x$pulseaudio_lib != x; then
echo "-- dynamic libpulse-simple -> $pulseaudio_lib" echo "-- dynamic libpulse-simple -> $pulseaudio_lib"
AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC, "$pulseaudio_lib", [ ]) AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC, "$pulseaudio_lib", [ ])
case "$host" in
# On Solaris, pulseaudio must be linked deferred explicitly
# to prevent undefined symbol failures.
*-*-solaris*)
PULSEAUDIO_LIBS=`echo $PULSEAUDIO_LIBS | sed 's/\-l/-Wl,-l/g'`
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-zdeferred $PULSEAUDIO_LIBS -Wl,-znodeferred"
esac
else else
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $PULSEAUDIO_LIBS" EXTRA_LDFLAGS="$EXTRA_LDFLAGS $PULSEAUDIO_LIBS"
fi fi

View file

@ -22,11 +22,6 @@
#if SDL_AUDIO_DRIVER_SUNAUDIO #if SDL_AUDIO_DRIVER_SUNAUDIO
/* I'm gambling no one uses this audio backend...we'll see who emails. :) */
#error this code has not been updated for SDL 1.3.
#error if no one emails icculus at icculus.org and tells him that this
#error code is needed, this audio backend will eventually be removed from SDL.
/* Allow access to a raw mixing buffer */ /* Allow access to a raw mixing buffer */
#include <fcntl.h> #include <fcntl.h>
@ -51,84 +46,21 @@
#include "SDL_sunaudio.h" #include "SDL_sunaudio.h"
/* Open the audio device for playback, and don't block if busy */ /* Open the audio device for playback, and don't block if busy */
#define OPEN_FLAGS (O_WRONLY|O_NONBLOCK)
#if defined(AUDIO_GETINFO) && !defined(AUDIO_GETBUFINFO) #if defined(AUDIO_GETINFO) && !defined(AUDIO_GETBUFINFO)
#define AUDIO_GETBUFINFO AUDIO_GETINFO #define AUDIO_GETBUFINFO AUDIO_GETINFO
#endif #endif
/* Audio driver functions */ /* Audio driver functions */
static int DSP_OpenAudio(_THIS, SDL_AudioSpec * spec);
static void DSP_WaitAudio(_THIS);
static void DSP_PlayAudio(_THIS);
static Uint8 *DSP_GetAudioBuf(_THIS);
static void DSP_CloseAudio(_THIS);
static Uint8 snd2au(int sample); static Uint8 snd2au(int sample);
/* Audio driver bootstrap functions */ /* Audio driver bootstrap functions */
static int
Audio_Available(void)
{
int fd;
int available;
available = 0;
fd = SDL_OpenAudioPath(NULL, 0, OPEN_FLAGS, 1);
if (fd >= 0) {
available = 1;
close(fd);
}
return (available);
}
static void static void
Audio_DeleteDevice(SDL_AudioDevice * device) SUNAUDIO_DetectDevices(int iscapture, SDL_AddAudioDevice addfn)
{ {
SDL_free(device->hidden); SDL_EnumUnixAudioDevices(iscapture, 1, (int (*)(int fd)) NULL, addfn);
SDL_free(device);
} }
static SDL_AudioDevice *
Audio_CreateDevice(int devindex)
{
SDL_AudioDevice *this;
/* Initialize all variables that we clean on shutdown */
this = (SDL_AudioDevice *) SDL_malloc(sizeof(SDL_AudioDevice));
if (this) {
SDL_memset(this, 0, (sizeof *this));
this->hidden = (struct SDL_PrivateAudioData *)
SDL_malloc((sizeof *this->hidden));
}
if ((this == NULL) || (this->hidden == NULL)) {
SDL_OutOfMemory();
if (this) {
SDL_free(this);
}
return (0);
}
SDL_memset(this->hidden, 0, (sizeof *this->hidden));
audio_fd = -1;
/* Set the function pointers */
this->OpenAudio = DSP_OpenAudio;
this->WaitAudio = DSP_WaitAudio;
this->PlayAudio = DSP_PlayAudio;
this->GetAudioBuf = DSP_GetAudioBuf;
this->CloseAudio = DSP_CloseAudio;
this->free = Audio_DeleteDevice;
return this;
}
AudioBootStrap SUNAUDIO_bootstrap = {
"audio", "UNIX /dev/audio interface",
Audio_Available, Audio_CreateDevice, 0
};
#ifdef DEBUG_AUDIO #ifdef DEBUG_AUDIO
void void
CheckUnderflow(_THIS) CheckUnderflow(_THIS)
@ -137,29 +69,29 @@ CheckUnderflow(_THIS)
audio_info_t info; audio_info_t info;
int left; int left;
ioctl(audio_fd, AUDIO_GETBUFINFO, &info); ioctl(this->hidden->audio_fd, AUDIO_GETBUFINFO, &info);
left = (written - info.play.samples); left = (this->hidden->written - info.play.samples);
if (written && (left == 0)) { if (this->hidden->written && (left == 0)) {
fprintf(stderr, "audio underflow!\n"); fprintf(stderr, "audio underflow!\n");
} }
#endif #endif
} }
#endif #endif
void static void
DSP_WaitAudio(_THIS) SUNAUDIO_WaitDevice(_THIS)
{ {
#ifdef AUDIO_GETBUFINFO #ifdef AUDIO_GETBUFINFO
#define SLEEP_FUDGE 10 /* 10 ms scheduling fudge factor */ #define SLEEP_FUDGE 10 /* 10 ms scheduling fudge factor */
audio_info_t info; audio_info_t info;
Sint32 left; Sint32 left;
ioctl(audio_fd, AUDIO_GETBUFINFO, &info); ioctl(this->hidden->audio_fd, AUDIO_GETBUFINFO, &info);
left = (written - info.play.samples); left = (this->hidden->written - info.play.samples);
if (left > fragsize) { if (left > this->hidden->fragsize) {
Sint32 sleepy; Sint32 sleepy;
sleepy = ((left - fragsize) / frequency); sleepy = ((left - this->hidden->fragsize) / this->hidden->frequency);
sleepy -= SLEEP_FUDGE; sleepy -= SLEEP_FUDGE;
if (sleepy > 0) { if (sleepy > 0) {
SDL_Delay(sleepy); SDL_Delay(sleepy);
@ -169,30 +101,30 @@ DSP_WaitAudio(_THIS)
fd_set fdset; fd_set fdset;
FD_ZERO(&fdset); FD_ZERO(&fdset);
FD_SET(audio_fd, &fdset); FD_SET(this->hidden->audio_fd, &fdset);
select(audio_fd + 1, NULL, &fdset, NULL, NULL); select(this->hidden->audio_fd + 1, NULL, &fdset, NULL, NULL);
#endif #endif
} }
void static void
DSP_PlayAudio(_THIS) SUNAUDIO_PlayDevice(_THIS)
{ {
/* Write the audio data */ /* Write the audio data */
if (ulaw_only) { if (this->hidden->ulaw_only) {
/* Assuming that this->spec.freq >= 8000 Hz */ /* Assuming that this->spec.freq >= 8000 Hz */
int accum, incr, pos; int accum, incr, pos;
Uint8 *aubuf; Uint8 *aubuf;
accum = 0; accum = 0;
incr = this->spec.freq / 8; incr = this->spec.freq / 8;
aubuf = ulaw_buf; aubuf = this->hidden->ulaw_buf;
switch (audio_fmt & 0xFF) { switch (this->hidden->audio_fmt & 0xFF) {
case 8: case 8:
{ {
Uint8 *sndbuf; Uint8 *sndbuf;
sndbuf = mixbuf; sndbuf = this->hidden->mixbuf;
for (pos = 0; pos < fragsize; ++pos) { for (pos = 0; pos < this->hidden->fragsize; ++pos) {
*aubuf = snd2au((0x80 - *sndbuf) * 64); *aubuf = snd2au((0x80 - *sndbuf) * 64);
accum += incr; accum += incr;
while (accum > 0) { while (accum > 0) {
@ -207,8 +139,8 @@ DSP_PlayAudio(_THIS)
{ {
Sint16 *sndbuf; Sint16 *sndbuf;
sndbuf = (Sint16 *) mixbuf; sndbuf = (Sint16 *) this->hidden->mixbuf;
for (pos = 0; pos < fragsize; ++pos) { for (pos = 0; pos < this->hidden->fragsize; ++pos) {
*aubuf = snd2au(*sndbuf / 4); *aubuf = snd2au(*sndbuf / 4);
accum += incr; accum += incr;
while (accum > 0) { while (accum > 0) {
@ -223,63 +155,96 @@ DSP_PlayAudio(_THIS)
#ifdef DEBUG_AUDIO #ifdef DEBUG_AUDIO
CheckUnderflow(this); CheckUnderflow(this);
#endif #endif
if (write(audio_fd, ulaw_buf, fragsize) < 0) { if (write(this->hidden->audio_fd, this->hidden->ulaw_buf,
this->hidden->fragsize) < 0) {
/* Assume fatal error, for now */ /* Assume fatal error, for now */
this->enabled = 0; this->enabled = 0;
} }
written += fragsize; this->hidden->written += this->hidden->fragsize;
} else { } else {
#ifdef DEBUG_AUDIO #ifdef DEBUG_AUDIO
CheckUnderflow(this); CheckUnderflow(this);
#endif #endif
if (write(audio_fd, mixbuf, this->spec.size) < 0) { if (write(this->hidden->audio_fd, this->hidden->mixbuf,
this->spec.size) < 0) {
/* Assume fatal error, for now */ /* Assume fatal error, for now */
this->enabled = 0; this->enabled = 0;
} }
written += fragsize; this->hidden->written += this->hidden->fragsize;
} }
} }
Uint8 * static Uint8 *
DSP_GetAudioBuf(_THIS) SUNAUDIO_GetDeviceBuf(_THIS)
{ {
return (mixbuf); return (this->hidden->mixbuf);
} }
void static void
DSP_CloseAudio(_THIS) SUNAUDIO_CloseDevice(_THIS)
{ {
if (mixbuf != NULL) { if (this->hidden != NULL) {
SDL_FreeAudioMem(mixbuf); if (this->hidden->mixbuf != NULL) {
mixbuf = NULL; SDL_FreeAudioMem(this->hidden->mixbuf);
this->hidden->mixbuf = NULL;
} }
if (ulaw_buf != NULL) { if (this->hidden->ulaw_buf != NULL) {
SDL_free(ulaw_buf); SDL_free(this->hidden->ulaw_buf);
ulaw_buf = NULL; this->hidden->ulaw_buf = NULL;
}
if (this->hidden->audio_fd >= 0) {
close(this->hidden->audio_fd);
this->hidden->audio_fd = -1;
}
SDL_free(this->hidden);
this->hidden = NULL;
} }
close(audio_fd);
} }
int static int
DSP_OpenAudio(_THIS, SDL_AudioSpec * spec) SUNAUDIO_OpenDevice(_THIS, const char *devname, int iscapture)
{ {
char audiodev[1024]; const int flags = ((iscapture) ? OPEN_FLAGS_INPUT : OPEN_FLAGS_OUTPUT);
SDL_AudioFormat format = 0;
audio_info_t info;
/* We don't care what the devname is...we'll try to open anything. */
/* ...but default to first name in the list... */
if (devname == NULL) {
devname = SDL_GetAudioDeviceName(0, iscapture);
if (devname == NULL) {
SDL_SetError("No such audio device");
return 0;
}
}
/* Initialize all variables that we clean on shutdown */
this->hidden = (struct SDL_PrivateAudioData *)
SDL_malloc((sizeof *this->hidden));
if (this->hidden == NULL) {
SDL_OutOfMemory();
return 0;
}
SDL_memset(this->hidden, 0, (sizeof *this->hidden));
/* Open the audio device */
this->hidden->audio_fd = open(devname, flags, 0);
if (this->hidden->audio_fd < 0) {
SDL_SetError("Couldn't open %s: %s", devname, strerror(errno));
return 0;
}
#ifdef AUDIO_SETINFO #ifdef AUDIO_SETINFO
int enc; int enc;
#endif #endif
int desired_freq = spec->freq; int desired_freq = this->spec.freq;
/* Initialize our freeable variables, in case we fail */
audio_fd = -1;
mixbuf = NULL;
ulaw_buf = NULL;
/* Determine the audio parameters from the AudioSpec */ /* Determine the audio parameters from the AudioSpec */
switch (SDL_AUDIO_BITSIZE(spec->format)) { switch (SDL_AUDIO_BITSIZE(this->spec.format)) {
case 8: case 8:
{ /* Unsigned 8 bit audio data */ { /* Unsigned 8 bit audio data */
spec->format = AUDIO_U8; this->spec.format = AUDIO_U8;
#ifdef AUDIO_SETINFO #ifdef AUDIO_SETINFO
enc = AUDIO_ENCODING_LINEAR8; enc = AUDIO_ENCODING_LINEAR8;
#endif #endif
@ -288,7 +253,7 @@ DSP_OpenAudio(_THIS, SDL_AudioSpec * spec)
case 16: case 16:
{ /* Signed 16 bit audio data */ { /* Signed 16 bit audio data */
spec->format = AUDIO_S16SYS; this->spec.format = AUDIO_S16SYS;
#ifdef AUDIO_SETINFO #ifdef AUDIO_SETINFO
enc = AUDIO_ENCODING_LINEAR; enc = AUDIO_ENCODING_LINEAR;
#endif #endif
@ -302,40 +267,33 @@ DSP_OpenAudio(_THIS, SDL_AudioSpec * spec)
return (-1); return (-1);
} }
} }
audio_fmt = spec->format; this->hidden->audio_fmt = this->spec.format;
/* Open the audio device */ this->hidden->ulaw_only = 0; /* modern Suns do support linear audio */
audio_fd = SDL_OpenAudioPath(audiodev, sizeof(audiodev), OPEN_FLAGS, 1);
if (audio_fd < 0) {
SDL_SetError("Couldn't open %s: %s", audiodev, strerror(errno));
return (-1);
}
ulaw_only = 0; /* modern Suns do support linear audio */
#ifdef AUDIO_SETINFO #ifdef AUDIO_SETINFO
for (;;) { for (;;) {
audio_info_t info; audio_info_t info;
AUDIO_INITINFO(&info); /* init all fields to "no change" */ AUDIO_INITINFO(&info); /* init all fields to "no change" */
/* Try to set the requested settings */ /* Try to set the requested settings */
info.play.sample_rate = spec->freq; info.play.sample_rate = this->spec.freq;
info.play.channels = spec->channels; info.play.channels = this->spec.channels;
info.play.precision = (enc == AUDIO_ENCODING_ULAW) info.play.precision = (enc == AUDIO_ENCODING_ULAW)
? 8 : spec->format & 0xff; ? 8 : this->spec.format & 0xff;
info.play.encoding = enc; info.play.encoding = enc;
if (ioctl(audio_fd, AUDIO_SETINFO, &info) == 0) { if (ioctl(this->hidden->audio_fd, AUDIO_SETINFO, &info) == 0) {
/* Check to be sure we got what we wanted */ /* Check to be sure we got what we wanted */
if (ioctl(audio_fd, AUDIO_GETINFO, &info) < 0) { if (ioctl(this->hidden->audio_fd, AUDIO_GETINFO, &info) < 0) {
SDL_SetError("Error getting audio parameters: %s", SDL_SetError("Error getting audio parameters: %s",
strerror(errno)); strerror(errno));
return -1; return -1;
} }
if (info.play.encoding == enc if (info.play.encoding == enc
&& info.play.precision == (spec->format & 0xff) && info.play.precision == (this->spec.format & 0xff)
&& info.play.channels == spec->channels) { && info.play.channels == this->spec.channels) {
/* Yow! All seems to be well! */ /* Yow! All seems to be well! */
spec->freq = info.play.sample_rate; this->spec.freq = info.play.sample_rate;
break; break;
} }
} }
@ -344,16 +302,16 @@ DSP_OpenAudio(_THIS, SDL_AudioSpec * spec)
case AUDIO_ENCODING_LINEAR8: case AUDIO_ENCODING_LINEAR8:
/* unsigned 8bit apparently not supported here */ /* unsigned 8bit apparently not supported here */
enc = AUDIO_ENCODING_LINEAR; enc = AUDIO_ENCODING_LINEAR;
spec->format = AUDIO_S16SYS; this->spec.format = AUDIO_S16SYS;
break; /* try again */ break; /* try again */
case AUDIO_ENCODING_LINEAR: case AUDIO_ENCODING_LINEAR:
/* linear 16bit didn't work either, resort to µ-law */ /* linear 16bit didn't work either, resort to µ-law */
enc = AUDIO_ENCODING_ULAW; enc = AUDIO_ENCODING_ULAW;
spec->channels = 1; this->spec.channels = 1;
spec->freq = 8000; this->spec.freq = 8000;
spec->format = AUDIO_U8; this->spec.format = AUDIO_U8;
ulaw_only = 1; this->hidden->ulaw_only = 1;
break; break;
default: default:
@ -364,43 +322,44 @@ DSP_OpenAudio(_THIS, SDL_AudioSpec * spec)
} }
} }
#endif /* AUDIO_SETINFO */ #endif /* AUDIO_SETINFO */
written = 0; this->hidden->written = 0;
/* We can actually convert on-the-fly to U-Law */ /* We can actually convert on-the-fly to U-Law */
if (ulaw_only) { if (this->hidden->ulaw_only) {
spec->freq = desired_freq; this->spec.freq = desired_freq;
fragsize = (spec->samples * 1000) / (spec->freq / 8); this->hidden->fragsize = (this->spec.samples * 1000) /
frequency = 8; (this->spec.freq / 8);
ulaw_buf = (Uint8 *) SDL_malloc(fragsize); this->hidden->frequency = 8;
if (ulaw_buf == NULL) { this->hidden->ulaw_buf = (Uint8 *) SDL_malloc(this->hidden->fragsize);
if (this->hidden->ulaw_buf == NULL) {
SDL_OutOfMemory(); SDL_OutOfMemory();
return (-1); return (-1);
} }
spec->channels = 1; this->spec.channels = 1;
} else { } else {
fragsize = spec->samples; this->hidden->fragsize = this->spec.samples;
frequency = spec->freq / 1000; this->hidden->frequency = this->spec.freq / 1000;
} }
#ifdef DEBUG_AUDIO #ifdef DEBUG_AUDIO
fprintf(stderr, "Audio device %s U-Law only\n", fprintf(stderr, "Audio device %s U-Law only\n",
ulaw_only ? "is" : "is not"); this->hidden->ulaw_only ? "is" : "is not");
fprintf(stderr, "format=0x%x chan=%d freq=%d\n", fprintf(stderr, "format=0x%x chan=%d freq=%d\n",
spec->format, spec->channels, spec->freq); this->spec.format, this->spec.channels, this->spec.freq);
#endif #endif
/* Update the fragment size as size in bytes */ /* Update the fragment size as size in bytes */
SDL_CalculateAudioSpec(spec); SDL_CalculateAudioSpec(&this->spec);
/* Allocate mixing buffer */ /* Allocate mixing buffer */
mixbuf = (Uint8 *) SDL_AllocAudioMem(spec->size); this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->spec.size);
if (mixbuf == NULL) { if (this->hidden->mixbuf == NULL) {
SDL_OutOfMemory(); SDL_OutOfMemory();
return (-1); return (-1);
} }
SDL_memset(mixbuf, spec->silence, spec->size); SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size);
/* We're ready to rock and roll. :-) */ /* We're ready to rock and roll. :-) */
return (0); return (1);
} }
/************************************************************************/ /************************************************************************/
@ -456,6 +415,24 @@ snd2au(int sample)
return (mask & sample); return (mask & sample);
} }
static int
SUNAUDIO_Init(SDL_AudioDriverImpl * impl)
{
/* Set the function pointers */
impl->DetectDevices = SUNAUDIO_DetectDevices;
impl->OpenDevice = SUNAUDIO_OpenDevice;
impl->PlayDevice = SUNAUDIO_PlayDevice;
impl->WaitDevice = SUNAUDIO_WaitDevice;
impl->GetDeviceBuf = SUNAUDIO_GetDeviceBuf;
impl->CloseDevice = SUNAUDIO_CloseDevice;
return 1; /* this audio target is available. */
}
AudioBootStrap SUNAUDIO_bootstrap = {
"audio", "UNIX /dev/audio interface", SUNAUDIO_Init, 0
};
#endif /* SDL_AUDIO_DRIVER_SUNAUDIO */ #endif /* SDL_AUDIO_DRIVER_SUNAUDIO */
/* vi: set ts=4 sw=4 expandtab: */ /* vi: set ts=4 sw=4 expandtab: */

View file

@ -42,16 +42,6 @@ struct SDL_PrivateAudioData
int frequency; /* The audio frequency in KHz */ int frequency; /* The audio frequency in KHz */
}; };
/* Old variable names */
#define audio_fd (this->hidden->audio_fd)
#define audio_fmt (this->hidden->audio_fmt)
#define mixbuf (this->hidden->mixbuf)
#define ulaw_only (this->hidden->ulaw_only)
#define ulaw_buf (this->hidden->ulaw_buf)
#define written (this->hidden->written)
#define fragsize (this->hidden->fragsize)
#define frequency (this->hidden->frequency)
#endif /* _SDL_sunaudio_h */ #endif /* _SDL_sunaudio_h */
/* vi: set ts=4 sw=4 expandtab: */ /* vi: set ts=4 sw=4 expandtab: */

View file

@ -443,11 +443,11 @@ BlitBtoNAlphaKey(SDL_BlitInfo * info)
} }
static const SDL_BlitFunc bitmap_blit[] = { static const SDL_BlitFunc bitmap_blit[] = {
NULL, BlitBto1, BlitBto2, BlitBto3, BlitBto4 (SDL_BlitFunc) NULL, BlitBto1, BlitBto2, BlitBto3, BlitBto4
}; };
static const SDL_BlitFunc colorkey_blit[] = { static const SDL_BlitFunc colorkey_blit[] = {
NULL, BlitBto1Key, BlitBto2Key, BlitBto3Key, BlitBto4Key (SDL_BlitFunc) NULL, BlitBto1Key, BlitBto2Key, BlitBto3Key, BlitBto4Key
}; };
SDL_BlitFunc SDL_BlitFunc
@ -457,7 +457,7 @@ SDL_CalculateBlit0(SDL_Surface * surface)
if (surface->format->BitsPerPixel != 1) { if (surface->format->BitsPerPixel != 1) {
/* We don't support sub 8-bit packed pixel modes */ /* We don't support sub 8-bit packed pixel modes */
return NULL; return (SDL_BlitFunc) NULL;
} }
if (surface->map->dst->format->BitsPerPixel < 8) { if (surface->map->dst->format->BitsPerPixel < 8) {
which = 0; which = 0;
@ -472,12 +472,12 @@ SDL_CalculateBlit0(SDL_Surface * surface)
return colorkey_blit[which]; return colorkey_blit[which];
case SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND: case SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND:
return which >= 2 ? BlitBtoNAlpha : NULL; return which >= 2 ? BlitBtoNAlpha : (SDL_BlitFunc) NULL;
case SDL_COPY_COLORKEY | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND: case SDL_COPY_COLORKEY | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND:
return which >= 2 ? BlitBtoNAlphaKey : NULL; return which >= 2 ? BlitBtoNAlphaKey : (SDL_BlitFunc) NULL;
} }
return NULL; return (SDL_BlitFunc) NULL;
} }
/* vi: set ts=4 sw=4 expandtab: */ /* vi: set ts=4 sw=4 expandtab: */

View file

@ -511,11 +511,11 @@ Blit1toNAlphaKey(SDL_BlitInfo * info)
} }
static const SDL_BlitFunc one_blit[] = { static const SDL_BlitFunc one_blit[] = {
NULL, Blit1to1, Blit1to2, Blit1to3, Blit1to4 (SDL_BlitFunc) NULL, Blit1to1, Blit1to2, Blit1to3, Blit1to4
}; };
static const SDL_BlitFunc one_blitkey[] = { static const SDL_BlitFunc one_blitkey[] = {
NULL, Blit1to1Key, Blit1to2Key, Blit1to3Key, Blit1to4Key (SDL_BlitFunc) NULL, Blit1to1Key, Blit1to2Key, Blit1to3Key, Blit1to4Key
}; };
SDL_BlitFunc SDL_BlitFunc
@ -541,12 +541,12 @@ SDL_CalculateBlit1(SDL_Surface * surface)
/* Supporting 8bpp->8bpp alpha is doable but requires lots of /* Supporting 8bpp->8bpp alpha is doable but requires lots of
tables which consume space and takes time to precompute, tables which consume space and takes time to precompute,
so is better left to the user */ so is better left to the user */
return which >= 2 ? Blit1toNAlpha : NULL; return which >= 2 ? Blit1toNAlpha : (SDL_BlitFunc) NULL;
case SDL_COPY_COLORKEY | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND: case SDL_COPY_COLORKEY | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND:
return which >= 2 ? Blit1toNAlphaKey : NULL; return which >= 2 ? Blit1toNAlphaKey : (SDL_BlitFunc) NULL;
} }
return NULL; return (SDL_BlitFunc) NULL;
} }
/* vi: set ts=4 sw=4 expandtab: */ /* vi: set ts=4 sw=4 expandtab: */

View file

@ -39,10 +39,6 @@ struct Timing
int frequency; int frequency;
}; };
struct DisplayDescriptor
{
};
struct DetailedTiming struct DetailedTiming
{ {
int pixel_clock; int pixel_clock;