Fix pulseaudio dynamic linking for Solaris builds.
authorShawn Walker <eviltypeguy@icculus.org>
Mon, 25 Feb 2013 22:46:21 +0000
changeset 6967adc80d085ddf
parent 6966 090df160f6e0
child 6968 959d9bbbbea0
Fix pulseaudio dynamic linking for Solaris builds.
Fix Solaris Studio compilation errors.
Fix sunaudio backend for SDL2.
configure.in
src/audio/sun/SDL_sunaudio.c
src/audio/sun/SDL_sunaudio.h
src/video/SDL_blit_0.c
src/video/SDL_blit_1.c
src/video/x11/edid.h
     1.1 --- a/configure.in	Tue Mar 05 18:54:55 2013 -0500
     1.2 +++ b/configure.in	Mon Feb 25 22:46:21 2013 +0000
     1.3 @@ -794,6 +794,14 @@
     1.4                 test x$enable_pulseaudio_shared = xyes && test x$pulseaudio_lib != x; then
     1.5                  echo "-- dynamic libpulse-simple -> $pulseaudio_lib"
     1.6                  AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC, "$pulseaudio_lib", [ ])
     1.7 +
     1.8 +                case "$host" in
     1.9 +                    # On Solaris, pulseaudio must be linked deferred explicitly
    1.10 +                    # to prevent undefined symbol failures.
    1.11 +                    *-*-solaris*)
    1.12 +                        PULSEAUDIO_LIBS=`echo $PULSEAUDIO_LIBS | sed 's/\-l/-Wl,-l/g'`
    1.13 +                        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-zdeferred $PULSEAUDIO_LIBS -Wl,-znodeferred"
    1.14 +                esac
    1.15              else
    1.16                  EXTRA_LDFLAGS="$EXTRA_LDFLAGS $PULSEAUDIO_LIBS"
    1.17              fi
     2.1 --- a/src/audio/sun/SDL_sunaudio.c	Tue Mar 05 18:54:55 2013 -0500
     2.2 +++ b/src/audio/sun/SDL_sunaudio.c	Mon Feb 25 22:46:21 2013 +0000
     2.3 @@ -22,11 +22,6 @@
     2.4  
     2.5  #if SDL_AUDIO_DRIVER_SUNAUDIO
     2.6  
     2.7 -/* I'm gambling no one uses this audio backend...we'll see who emails.  :)  */
     2.8 -#error this code has not been updated for SDL 1.3.
     2.9 -#error if no one emails icculus at icculus.org and tells him that this
    2.10 -#error  code is needed, this audio backend will eventually be removed from SDL.
    2.11 -
    2.12  /* Allow access to a raw mixing buffer */
    2.13  
    2.14  #include <fcntl.h>
    2.15 @@ -51,84 +46,21 @@
    2.16  #include "SDL_sunaudio.h"
    2.17  
    2.18  /* Open the audio device for playback, and don't block if busy */
    2.19 -#define OPEN_FLAGS	(O_WRONLY|O_NONBLOCK)
    2.20  
    2.21  #if defined(AUDIO_GETINFO) && !defined(AUDIO_GETBUFINFO) 
    2.22  #define AUDIO_GETBUFINFO AUDIO_GETINFO
    2.23  #endif
    2.24  
    2.25  /* Audio driver functions */
    2.26 -static int DSP_OpenAudio(_THIS, SDL_AudioSpec * spec);
    2.27 -static void DSP_WaitAudio(_THIS);
    2.28 -static void DSP_PlayAudio(_THIS);
    2.29 -static Uint8 *DSP_GetAudioBuf(_THIS);
    2.30 -static void DSP_CloseAudio(_THIS);
    2.31 -
    2.32  static Uint8 snd2au(int sample);
    2.33  
    2.34  /* Audio driver bootstrap functions */
    2.35 -
    2.36 -static int
    2.37 -Audio_Available(void)
    2.38 -{
    2.39 -    int fd;
    2.40 -    int available;
    2.41 -
    2.42 -    available = 0;
    2.43 -    fd = SDL_OpenAudioPath(NULL, 0, OPEN_FLAGS, 1);
    2.44 -    if (fd >= 0) {
    2.45 -        available = 1;
    2.46 -        close(fd);
    2.47 -    }
    2.48 -    return (available);
    2.49 -}
    2.50 -
    2.51  static void
    2.52 -Audio_DeleteDevice(SDL_AudioDevice * device)
    2.53 -{
    2.54 -    SDL_free(device->hidden);
    2.55 -    SDL_free(device);
    2.56 -}
    2.57 -
    2.58 -static SDL_AudioDevice *
    2.59 -Audio_CreateDevice(int devindex)
    2.60 +SUNAUDIO_DetectDevices(int iscapture, SDL_AddAudioDevice addfn)
    2.61  {
    2.62 -    SDL_AudioDevice *this;
    2.63 -
    2.64 -    /* Initialize all variables that we clean on shutdown */
    2.65 -    this = (SDL_AudioDevice *) SDL_malloc(sizeof(SDL_AudioDevice));
    2.66 -    if (this) {
    2.67 -        SDL_memset(this, 0, (sizeof *this));
    2.68 -        this->hidden = (struct SDL_PrivateAudioData *)
    2.69 -            SDL_malloc((sizeof *this->hidden));
    2.70 -    }
    2.71 -    if ((this == NULL) || (this->hidden == NULL)) {
    2.72 -        SDL_OutOfMemory();
    2.73 -        if (this) {
    2.74 -            SDL_free(this);
    2.75 -        }
    2.76 -        return (0);
    2.77 -    }
    2.78 -    SDL_memset(this->hidden, 0, (sizeof *this->hidden));
    2.79 -    audio_fd = -1;
    2.80 -
    2.81 -    /* Set the function pointers */
    2.82 -    this->OpenAudio = DSP_OpenAudio;
    2.83 -    this->WaitAudio = DSP_WaitAudio;
    2.84 -    this->PlayAudio = DSP_PlayAudio;
    2.85 -    this->GetAudioBuf = DSP_GetAudioBuf;
    2.86 -    this->CloseAudio = DSP_CloseAudio;
    2.87 -
    2.88 -    this->free = Audio_DeleteDevice;
    2.89 -
    2.90 -    return this;
    2.91 +    SDL_EnumUnixAudioDevices(iscapture, 1, (int (*)(int fd)) NULL, addfn);
    2.92  }
    2.93  
    2.94 -AudioBootStrap SUNAUDIO_bootstrap = {
    2.95 -    "audio", "UNIX /dev/audio interface",
    2.96 -    Audio_Available, Audio_CreateDevice, 0
    2.97 -};
    2.98 -
    2.99  #ifdef DEBUG_AUDIO
   2.100  void
   2.101  CheckUnderflow(_THIS)
   2.102 @@ -137,29 +69,29 @@
   2.103      audio_info_t info;
   2.104      int left;
   2.105  
   2.106 -    ioctl(audio_fd, AUDIO_GETBUFINFO, &info);
   2.107 -    left = (written - info.play.samples);
   2.108 -    if (written && (left == 0)) {
   2.109 +    ioctl(this->hidden->audio_fd, AUDIO_GETBUFINFO, &info);
   2.110 +    left = (this->hidden->written - info.play.samples);
   2.111 +    if (this->hidden->written && (left == 0)) {
   2.112          fprintf(stderr, "audio underflow!\n");
   2.113      }
   2.114  #endif
   2.115  }
   2.116  #endif
   2.117  
   2.118 -void
   2.119 -DSP_WaitAudio(_THIS)
   2.120 +static void
   2.121 +SUNAUDIO_WaitDevice(_THIS)
   2.122  {
   2.123  #ifdef AUDIO_GETBUFINFO
   2.124  #define SLEEP_FUDGE	10      /* 10 ms scheduling fudge factor */
   2.125      audio_info_t info;
   2.126      Sint32 left;
   2.127  
   2.128 -    ioctl(audio_fd, AUDIO_GETBUFINFO, &info);
   2.129 -    left = (written - info.play.samples);
   2.130 -    if (left > fragsize) {
   2.131 +    ioctl(this->hidden->audio_fd, AUDIO_GETBUFINFO, &info);
   2.132 +    left = (this->hidden->written - info.play.samples);
   2.133 +    if (left > this->hidden->fragsize) {
   2.134          Sint32 sleepy;
   2.135  
   2.136 -        sleepy = ((left - fragsize) / frequency);
   2.137 +        sleepy = ((left - this->hidden->fragsize) / this->hidden->frequency);
   2.138          sleepy -= SLEEP_FUDGE;
   2.139          if (sleepy > 0) {
   2.140              SDL_Delay(sleepy);
   2.141 @@ -169,30 +101,30 @@
   2.142      fd_set fdset;
   2.143  
   2.144      FD_ZERO(&fdset);
   2.145 -    FD_SET(audio_fd, &fdset);
   2.146 -    select(audio_fd + 1, NULL, &fdset, NULL, NULL);
   2.147 +    FD_SET(this->hidden->audio_fd, &fdset);
   2.148 +    select(this->hidden->audio_fd + 1, NULL, &fdset, NULL, NULL);
   2.149  #endif
   2.150  }
   2.151  
   2.152 -void
   2.153 -DSP_PlayAudio(_THIS)
   2.154 +static void
   2.155 +SUNAUDIO_PlayDevice(_THIS)
   2.156  {
   2.157      /* Write the audio data */
   2.158 -    if (ulaw_only) {
   2.159 +    if (this->hidden->ulaw_only) {
   2.160          /* Assuming that this->spec.freq >= 8000 Hz */
   2.161          int accum, incr, pos;
   2.162          Uint8 *aubuf;
   2.163  
   2.164          accum = 0;
   2.165          incr = this->spec.freq / 8;
   2.166 -        aubuf = ulaw_buf;
   2.167 -        switch (audio_fmt & 0xFF) {
   2.168 +        aubuf = this->hidden->ulaw_buf;
   2.169 +        switch (this->hidden->audio_fmt & 0xFF) {
   2.170          case 8:
   2.171              {
   2.172                  Uint8 *sndbuf;
   2.173  
   2.174 -                sndbuf = mixbuf;
   2.175 -                for (pos = 0; pos < fragsize; ++pos) {
   2.176 +                sndbuf = this->hidden->mixbuf;
   2.177 +                for (pos = 0; pos < this->hidden->fragsize; ++pos) {
   2.178                      *aubuf = snd2au((0x80 - *sndbuf) * 64);
   2.179                      accum += incr;
   2.180                      while (accum > 0) {
   2.181 @@ -207,8 +139,8 @@
   2.182              {
   2.183                  Sint16 *sndbuf;
   2.184  
   2.185 -                sndbuf = (Sint16 *) mixbuf;
   2.186 -                for (pos = 0; pos < fragsize; ++pos) {
   2.187 +                sndbuf = (Sint16 *) this->hidden->mixbuf;
   2.188 +                for (pos = 0; pos < this->hidden->fragsize; ++pos) {
   2.189                      *aubuf = snd2au(*sndbuf / 4);
   2.190                      accum += incr;
   2.191                      while (accum > 0) {
   2.192 @@ -223,63 +155,96 @@
   2.193  #ifdef DEBUG_AUDIO
   2.194          CheckUnderflow(this);
   2.195  #endif
   2.196 -        if (write(audio_fd, ulaw_buf, fragsize) < 0) {
   2.197 +        if (write(this->hidden->audio_fd, this->hidden->ulaw_buf,
   2.198 +            this->hidden->fragsize) < 0) {
   2.199              /* Assume fatal error, for now */
   2.200              this->enabled = 0;
   2.201          }
   2.202 -        written += fragsize;
   2.203 +        this->hidden->written += this->hidden->fragsize;
   2.204      } else {
   2.205  #ifdef DEBUG_AUDIO
   2.206          CheckUnderflow(this);
   2.207  #endif
   2.208 -        if (write(audio_fd, mixbuf, this->spec.size) < 0) {
   2.209 +        if (write(this->hidden->audio_fd, this->hidden->mixbuf,
   2.210 +            this->spec.size) < 0) {
   2.211              /* Assume fatal error, for now */
   2.212              this->enabled = 0;
   2.213          }
   2.214 -        written += fragsize;
   2.215 +        this->hidden->written += this->hidden->fragsize;
   2.216 +    }
   2.217 +}
   2.218 +
   2.219 +static Uint8 *
   2.220 +SUNAUDIO_GetDeviceBuf(_THIS)
   2.221 +{
   2.222 +    return (this->hidden->mixbuf);
   2.223 +}
   2.224 +
   2.225 +static void
   2.226 +SUNAUDIO_CloseDevice(_THIS)
   2.227 +{
   2.228 +    if (this->hidden != NULL) {
   2.229 +        if (this->hidden->mixbuf != NULL) {
   2.230 +            SDL_FreeAudioMem(this->hidden->mixbuf);
   2.231 +            this->hidden->mixbuf = NULL;
   2.232 +        }
   2.233 +        if (this->hidden->ulaw_buf != NULL) {
   2.234 +            SDL_free(this->hidden->ulaw_buf);
   2.235 +            this->hidden->ulaw_buf = NULL;
   2.236 +        }
   2.237 +        if (this->hidden->audio_fd >= 0) {
   2.238 +            close(this->hidden->audio_fd);
   2.239 +            this->hidden->audio_fd = -1;
   2.240 +        }
   2.241 +        SDL_free(this->hidden);
   2.242 +        this->hidden = NULL;
   2.243      }
   2.244  }
   2.245  
   2.246 -Uint8 *
   2.247 -DSP_GetAudioBuf(_THIS)
   2.248 -{
   2.249 -    return (mixbuf);
   2.250 -}
   2.251 -
   2.252 -void
   2.253 -DSP_CloseAudio(_THIS)
   2.254 +static int
   2.255 +SUNAUDIO_OpenDevice(_THIS, const char *devname, int iscapture)
   2.256  {
   2.257 -    if (mixbuf != NULL) {
   2.258 -        SDL_FreeAudioMem(mixbuf);
   2.259 -        mixbuf = NULL;
   2.260 -    }
   2.261 -    if (ulaw_buf != NULL) {
   2.262 -        SDL_free(ulaw_buf);
   2.263 -        ulaw_buf = NULL;
   2.264 +    const int flags = ((iscapture) ? OPEN_FLAGS_INPUT : OPEN_FLAGS_OUTPUT);
   2.265 +    SDL_AudioFormat format = 0;
   2.266 +    audio_info_t info;
   2.267 +
   2.268 +    /* We don't care what the devname is...we'll try to open anything. */
   2.269 +    /*  ...but default to first name in the list... */
   2.270 +    if (devname == NULL) {
   2.271 +        devname = SDL_GetAudioDeviceName(0, iscapture);
   2.272 +        if (devname == NULL) {
   2.273 +            SDL_SetError("No such audio device");
   2.274 +            return 0;
   2.275 +        }
   2.276      }
   2.277 -    close(audio_fd);
   2.278 -}
   2.279  
   2.280 -int
   2.281 -DSP_OpenAudio(_THIS, SDL_AudioSpec * spec)
   2.282 -{
   2.283 -    char audiodev[1024];
   2.284 +    /* Initialize all variables that we clean on shutdown */
   2.285 +    this->hidden = (struct SDL_PrivateAudioData *)
   2.286 +        SDL_malloc((sizeof *this->hidden));
   2.287 +    if (this->hidden == NULL) {
   2.288 +        SDL_OutOfMemory();
   2.289 +        return 0;
   2.290 +    }
   2.291 +    SDL_memset(this->hidden, 0, (sizeof *this->hidden));
   2.292 +
   2.293 +    /* Open the audio device */
   2.294 +    this->hidden->audio_fd = open(devname, flags, 0);
   2.295 +    if (this->hidden->audio_fd < 0) {
   2.296 +        SDL_SetError("Couldn't open %s: %s", devname, strerror(errno));
   2.297 +        return 0;
   2.298 +    }
   2.299 +
   2.300  #ifdef AUDIO_SETINFO
   2.301      int enc;
   2.302  #endif
   2.303 -    int desired_freq = spec->freq;
   2.304 -
   2.305 -    /* Initialize our freeable variables, in case we fail */
   2.306 -    audio_fd = -1;
   2.307 -    mixbuf = NULL;
   2.308 -    ulaw_buf = NULL;
   2.309 +    int desired_freq = this->spec.freq;
   2.310  
   2.311      /* Determine the audio parameters from the AudioSpec */
   2.312 -    switch (SDL_AUDIO_BITSIZE(spec->format)) {
   2.313 +    switch (SDL_AUDIO_BITSIZE(this->spec.format)) {
   2.314  
   2.315      case 8:
   2.316          {                       /* Unsigned 8 bit audio data */
   2.317 -            spec->format = AUDIO_U8;
   2.318 +            this->spec.format = AUDIO_U8;
   2.319  #ifdef AUDIO_SETINFO
   2.320              enc = AUDIO_ENCODING_LINEAR8;
   2.321  #endif
   2.322 @@ -288,7 +253,7 @@
   2.323  
   2.324      case 16:
   2.325          {                       /* Signed 16 bit audio data */
   2.326 -            spec->format = AUDIO_S16SYS;
   2.327 +            this->spec.format = AUDIO_S16SYS;
   2.328  #ifdef AUDIO_SETINFO
   2.329              enc = AUDIO_ENCODING_LINEAR;
   2.330  #endif
   2.331 @@ -302,40 +267,33 @@
   2.332              return (-1);
   2.333          }
   2.334      }
   2.335 -    audio_fmt = spec->format;
   2.336 +    this->hidden->audio_fmt = this->spec.format;
   2.337  
   2.338 -    /* Open the audio device */
   2.339 -    audio_fd = SDL_OpenAudioPath(audiodev, sizeof(audiodev), OPEN_FLAGS, 1);
   2.340 -    if (audio_fd < 0) {
   2.341 -        SDL_SetError("Couldn't open %s: %s", audiodev, strerror(errno));
   2.342 -        return (-1);
   2.343 -    }
   2.344 -
   2.345 -    ulaw_only = 0;              /* modern Suns do support linear audio */
   2.346 +    this->hidden->ulaw_only = 0;    /* modern Suns do support linear audio */
   2.347  #ifdef AUDIO_SETINFO
   2.348      for (;;) {
   2.349          audio_info_t info;
   2.350          AUDIO_INITINFO(&info);  /* init all fields to "no change" */
   2.351  
   2.352          /* Try to set the requested settings */
   2.353 -        info.play.sample_rate = spec->freq;
   2.354 -        info.play.channels = spec->channels;
   2.355 +        info.play.sample_rate = this->spec.freq;
   2.356 +        info.play.channels = this->spec.channels;
   2.357          info.play.precision = (enc == AUDIO_ENCODING_ULAW)
   2.358 -            ? 8 : spec->format & 0xff;
   2.359 +            ? 8 : this->spec.format & 0xff;
   2.360          info.play.encoding = enc;
   2.361 -        if (ioctl(audio_fd, AUDIO_SETINFO, &info) == 0) {
   2.362 +        if (ioctl(this->hidden->audio_fd, AUDIO_SETINFO, &info) == 0) {
   2.363  
   2.364              /* Check to be sure we got what we wanted */
   2.365 -            if (ioctl(audio_fd, AUDIO_GETINFO, &info) < 0) {
   2.366 +            if (ioctl(this->hidden->audio_fd, AUDIO_GETINFO, &info) < 0) {
   2.367                  SDL_SetError("Error getting audio parameters: %s",
   2.368                               strerror(errno));
   2.369                  return -1;
   2.370              }
   2.371              if (info.play.encoding == enc
   2.372 -                && info.play.precision == (spec->format & 0xff)
   2.373 -                && info.play.channels == spec->channels) {
   2.374 +                && info.play.precision == (this->spec.format & 0xff)
   2.375 +                && info.play.channels == this->spec.channels) {
   2.376                  /* Yow! All seems to be well! */
   2.377 -                spec->freq = info.play.sample_rate;
   2.378 +                this->spec.freq = info.play.sample_rate;
   2.379                  break;
   2.380              }
   2.381          }
   2.382 @@ -344,16 +302,16 @@
   2.383          case AUDIO_ENCODING_LINEAR8:
   2.384              /* unsigned 8bit apparently not supported here */
   2.385              enc = AUDIO_ENCODING_LINEAR;
   2.386 -            spec->format = AUDIO_S16SYS;
   2.387 +            this->spec.format = AUDIO_S16SYS;
   2.388              break;              /* try again */
   2.389  
   2.390          case AUDIO_ENCODING_LINEAR:
   2.391              /* linear 16bit didn't work either, resort to -law */
   2.392              enc = AUDIO_ENCODING_ULAW;
   2.393 -            spec->channels = 1;
   2.394 -            spec->freq = 8000;
   2.395 -            spec->format = AUDIO_U8;
   2.396 -            ulaw_only = 1;
   2.397 +            this->spec.channels = 1;
   2.398 +            this->spec.freq = 8000;
   2.399 +            this->spec.format = AUDIO_U8;
   2.400 +            this->hidden->ulaw_only = 1;
   2.401              break;
   2.402  
   2.403          default:
   2.404 @@ -364,43 +322,44 @@
   2.405          }
   2.406      }
   2.407  #endif /* AUDIO_SETINFO */
   2.408 -    written = 0;
   2.409 +    this->hidden->written = 0;
   2.410  
   2.411      /* We can actually convert on-the-fly to U-Law */
   2.412 -    if (ulaw_only) {
   2.413 -        spec->freq = desired_freq;
   2.414 -        fragsize = (spec->samples * 1000) / (spec->freq / 8);
   2.415 -        frequency = 8;
   2.416 -        ulaw_buf = (Uint8 *) SDL_malloc(fragsize);
   2.417 -        if (ulaw_buf == NULL) {
   2.418 +    if (this->hidden->ulaw_only) {
   2.419 +        this->spec.freq = desired_freq;
   2.420 +        this->hidden->fragsize = (this->spec.samples * 1000) /
   2.421 +            (this->spec.freq / 8);
   2.422 +        this->hidden->frequency = 8;
   2.423 +        this->hidden->ulaw_buf = (Uint8 *) SDL_malloc(this->hidden->fragsize);
   2.424 +        if (this->hidden->ulaw_buf == NULL) {
   2.425              SDL_OutOfMemory();
   2.426              return (-1);
   2.427          }
   2.428 -        spec->channels = 1;
   2.429 +        this->spec.channels = 1;
   2.430      } else {
   2.431 -        fragsize = spec->samples;
   2.432 -        frequency = spec->freq / 1000;
   2.433 +        this->hidden->fragsize = this->spec.samples;
   2.434 +        this->hidden->frequency = this->spec.freq / 1000;
   2.435      }
   2.436  #ifdef DEBUG_AUDIO
   2.437      fprintf(stderr, "Audio device %s U-Law only\n",
   2.438 -            ulaw_only ? "is" : "is not");
   2.439 +            this->hidden->ulaw_only ? "is" : "is not");
   2.440      fprintf(stderr, "format=0x%x chan=%d freq=%d\n",
   2.441 -            spec->format, spec->channels, spec->freq);
   2.442 +            this->spec.format, this->spec.channels, this->spec.freq);
   2.443  #endif
   2.444  
   2.445      /* Update the fragment size as size in bytes */
   2.446 -    SDL_CalculateAudioSpec(spec);
   2.447 +    SDL_CalculateAudioSpec(&this->spec);
   2.448  
   2.449      /* Allocate mixing buffer */
   2.450 -    mixbuf = (Uint8 *) SDL_AllocAudioMem(spec->size);
   2.451 -    if (mixbuf == NULL) {
   2.452 +    this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->spec.size);
   2.453 +    if (this->hidden->mixbuf == NULL) {
   2.454          SDL_OutOfMemory();
   2.455          return (-1);
   2.456      }
   2.457 -    SDL_memset(mixbuf, spec->silence, spec->size);
   2.458 +    SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size);
   2.459  
   2.460      /* We're ready to rock and roll. :-) */
   2.461 -    return (0);
   2.462 +    return (1);
   2.463  }
   2.464  
   2.465  /************************************************************************/
   2.466 @@ -456,6 +415,24 @@
   2.467      return (mask & sample);
   2.468  }
   2.469  
   2.470 +static int
   2.471 +SUNAUDIO_Init(SDL_AudioDriverImpl * impl)
   2.472 +{
   2.473 +    /* Set the function pointers */
   2.474 +    impl->DetectDevices = SUNAUDIO_DetectDevices;
   2.475 +    impl->OpenDevice = SUNAUDIO_OpenDevice;
   2.476 +    impl->PlayDevice = SUNAUDIO_PlayDevice;
   2.477 +    impl->WaitDevice = SUNAUDIO_WaitDevice;
   2.478 +    impl->GetDeviceBuf = SUNAUDIO_GetDeviceBuf;
   2.479 +    impl->CloseDevice = SUNAUDIO_CloseDevice;
   2.480 +
   2.481 +    return 1; /* this audio target is available. */
   2.482 +}
   2.483 +
   2.484 +AudioBootStrap SUNAUDIO_bootstrap = {
   2.485 +    "audio", "UNIX /dev/audio interface", SUNAUDIO_Init, 0
   2.486 +};
   2.487 +
   2.488  #endif /* SDL_AUDIO_DRIVER_SUNAUDIO */
   2.489  
   2.490  /* vi: set ts=4 sw=4 expandtab: */
     3.1 --- a/src/audio/sun/SDL_sunaudio.h	Tue Mar 05 18:54:55 2013 -0500
     3.2 +++ b/src/audio/sun/SDL_sunaudio.h	Mon Feb 25 22:46:21 2013 +0000
     3.3 @@ -42,16 +42,6 @@
     3.4      int frequency;              /* The audio frequency in KHz */
     3.5  };
     3.6  
     3.7 -/* Old variable names */
     3.8 -#define audio_fd		(this->hidden->audio_fd)
     3.9 -#define audio_fmt		(this->hidden->audio_fmt)
    3.10 -#define mixbuf			(this->hidden->mixbuf)
    3.11 -#define ulaw_only		(this->hidden->ulaw_only)
    3.12 -#define ulaw_buf		(this->hidden->ulaw_buf)
    3.13 -#define written			(this->hidden->written)
    3.14 -#define fragsize		(this->hidden->fragsize)
    3.15 -#define frequency		(this->hidden->frequency)
    3.16 -
    3.17  #endif /* _SDL_sunaudio_h */
    3.18  
    3.19  /* vi: set ts=4 sw=4 expandtab: */
     4.1 --- a/src/video/SDL_blit_0.c	Tue Mar 05 18:54:55 2013 -0500
     4.2 +++ b/src/video/SDL_blit_0.c	Mon Feb 25 22:46:21 2013 +0000
     4.3 @@ -443,11 +443,11 @@
     4.4  }
     4.5  
     4.6  static const SDL_BlitFunc bitmap_blit[] = {
     4.7 -    NULL, BlitBto1, BlitBto2, BlitBto3, BlitBto4
     4.8 +    (SDL_BlitFunc) NULL, BlitBto1, BlitBto2, BlitBto3, BlitBto4
     4.9  };
    4.10  
    4.11  static const SDL_BlitFunc colorkey_blit[] = {
    4.12 -    NULL, BlitBto1Key, BlitBto2Key, BlitBto3Key, BlitBto4Key
    4.13 +    (SDL_BlitFunc) NULL, BlitBto1Key, BlitBto2Key, BlitBto3Key, BlitBto4Key
    4.14  };
    4.15  
    4.16  SDL_BlitFunc
    4.17 @@ -457,7 +457,7 @@
    4.18  
    4.19      if (surface->format->BitsPerPixel != 1) {
    4.20          /* We don't support sub 8-bit packed pixel modes */
    4.21 -        return NULL;
    4.22 +        return (SDL_BlitFunc) NULL;
    4.23      }
    4.24      if (surface->map->dst->format->BitsPerPixel < 8) {
    4.25          which = 0;
    4.26 @@ -472,12 +472,12 @@
    4.27          return colorkey_blit[which];
    4.28  
    4.29      case SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND:
    4.30 -        return which >= 2 ? BlitBtoNAlpha : NULL;
    4.31 +        return which >= 2 ? BlitBtoNAlpha : (SDL_BlitFunc) NULL;
    4.32  
    4.33      case SDL_COPY_COLORKEY | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND:
    4.34 -        return which >= 2 ? BlitBtoNAlphaKey : NULL;
    4.35 +        return which >= 2 ? BlitBtoNAlphaKey : (SDL_BlitFunc) NULL;
    4.36      }
    4.37 -    return NULL;
    4.38 +    return (SDL_BlitFunc) NULL;
    4.39  }
    4.40  
    4.41  /* vi: set ts=4 sw=4 expandtab: */
     5.1 --- a/src/video/SDL_blit_1.c	Tue Mar 05 18:54:55 2013 -0500
     5.2 +++ b/src/video/SDL_blit_1.c	Mon Feb 25 22:46:21 2013 +0000
     5.3 @@ -511,11 +511,11 @@
     5.4  }
     5.5  
     5.6  static const SDL_BlitFunc one_blit[] = {
     5.7 -    NULL, Blit1to1, Blit1to2, Blit1to3, Blit1to4
     5.8 +    (SDL_BlitFunc) NULL, Blit1to1, Blit1to2, Blit1to3, Blit1to4
     5.9  };
    5.10  
    5.11  static const SDL_BlitFunc one_blitkey[] = {
    5.12 -    NULL, Blit1to1Key, Blit1to2Key, Blit1to3Key, Blit1to4Key
    5.13 +    (SDL_BlitFunc) NULL, Blit1to1Key, Blit1to2Key, Blit1to3Key, Blit1to4Key
    5.14  };
    5.15  
    5.16  SDL_BlitFunc
    5.17 @@ -541,12 +541,12 @@
    5.18          /* Supporting 8bpp->8bpp alpha is doable but requires lots of
    5.19             tables which consume space and takes time to precompute,
    5.20             so is better left to the user */
    5.21 -        return which >= 2 ? Blit1toNAlpha : NULL;
    5.22 +        return which >= 2 ? Blit1toNAlpha : (SDL_BlitFunc) NULL;
    5.23  
    5.24      case SDL_COPY_COLORKEY | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND:
    5.25 -        return which >= 2 ? Blit1toNAlphaKey : NULL;
    5.26 +        return which >= 2 ? Blit1toNAlphaKey : (SDL_BlitFunc) NULL;
    5.27      }
    5.28 -    return NULL;
    5.29 +    return (SDL_BlitFunc) NULL;
    5.30  }
    5.31  
    5.32  /* vi: set ts=4 sw=4 expandtab: */
     6.1 --- a/src/video/x11/edid.h	Tue Mar 05 18:54:55 2013 -0500
     6.2 +++ b/src/video/x11/edid.h	Mon Feb 25 22:46:21 2013 +0000
     6.3 @@ -39,10 +39,6 @@
     6.4      int frequency;
     6.5  };
     6.6  
     6.7 -struct DisplayDescriptor
     6.8 -{
     6.9 -};
    6.10 -
    6.11  struct DetailedTiming
    6.12  {
    6.13      int		pixel_clock;