Minor cleanups
authorSam Lantinga <slouken@libsdl.org>
Tue, 11 Sep 2001 19:33:01 +0000
changeset 11483ab4ef4458b
parent 113 c0c3018bd787
child 115 78d9aa904089
Minor cleanups
acinclude.m4
effect_position.c
effect_stereoreverse.c
load_aiff.c
load_voc.c
     1.1 --- a/acinclude.m4	Tue Sep 11 19:14:36 2001 +0000
     1.2 +++ b/acinclude.m4	Tue Sep 11 19:33:01 2001 +0000
     1.3 @@ -32,6 +32,7 @@
     1.4       fi
     1.5    fi
     1.6  
     1.7 +  AC_REQUIRE([AC_CANONICAL_TARGET])
     1.8    AC_PATH_PROG(SDL_CONFIG, sdl-config, no)
     1.9    min_sdl_version=ifelse([$1], ,0.11.0,$1)
    1.10    AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
     2.1 --- a/effect_position.c	Tue Sep 11 19:14:36 2001 +0000
     2.2 +++ b/effect_position.c	Tue Sep 11 19:33:01 2001 +0000
     2.3 @@ -26,8 +26,8 @@
     2.4  
     2.5  #include <stdio.h>
     2.6  #include <stdlib.h>
     2.7 -#include <sys/time.h>
     2.8 -#include <unistd.h>
     2.9 +#include <string.h>
    2.10 +
    2.11  #include "SDL.h"
    2.12  #include "SDL_mixer.h"
    2.13  
    2.14 @@ -438,8 +438,8 @@
    2.15  
    2.16      args->left_u8 = left;
    2.17      args->right_u8 = right;
    2.18 -    args->left_f = ((float) left) / 255.0;
    2.19 -    args->right_f = ((float) right) / 255.0;
    2.20 +    args->left_f = ((float) left) / 255.0f;
    2.21 +    args->right_f = ((float) right) / 255.0f;
    2.22      if (!args->in_use) {
    2.23          args->in_use = 1;
    2.24          return(Mix_RegisterEffect(channel, f, _Eff_PositionDone, (void *) args));
    2.25 @@ -474,7 +474,7 @@
    2.26      }
    2.27  
    2.28      args->distance_u8 = distance;
    2.29 -    args->distance_f = ((float) distance) / 255.0;
    2.30 +    args->distance_f = ((float) distance) / 255.0f;
    2.31      if (!args->in_use) {
    2.32          args->in_use = 1;
    2.33          return(Mix_RegisterEffect(channel, f, _Eff_PositionDone, (void *) args));
    2.34 @@ -491,8 +491,6 @@
    2.35      int channels;
    2.36      position_args *args = NULL;
    2.37      Uint8 left = 255, right = 255;
    2.38 -    int flip;
    2.39 -    float angle_f;
    2.40  
    2.41      Mix_QuerySpec(NULL, &format, &channels);
    2.42      f = get_position_effect_func(format);
    2.43 @@ -537,11 +535,11 @@
    2.44      distance = 255 - distance;  /* flip it to scale Mix_SetDistance() uses. */
    2.45  
    2.46      args->left_u8 = left;
    2.47 -    args->left_f = ((float) left) / 255.0;
    2.48 +    args->left_f = ((float) left) / 255.0f;
    2.49      args->right_u8 = right;
    2.50 -    args->right_f = ((float) right) / 255.0;
    2.51 +    args->right_f = ((float) right) / 255.0f;
    2.52      args->distance_u8 = distance;
    2.53 -    args->distance_f = ((float) distance) / 255.0;
    2.54 +    args->distance_f = ((float) distance) / 255.0f;
    2.55      if (!args->in_use) {
    2.56          args->in_use = 1;
    2.57          return(Mix_RegisterEffect(channel, f, _Eff_PositionDone, (void *) args));
     3.1 --- a/effect_stereoreverse.c	Tue Sep 11 19:14:36 2001 +0000
     3.2 +++ b/effect_stereoreverse.c	Tue Sep 11 19:33:01 2001 +0000
     3.3 @@ -26,8 +26,7 @@
     3.4  
     3.5  #include <stdio.h>
     3.6  #include <stdlib.h>
     3.7 -#include <sys/time.h>
     3.8 -#include <unistd.h>
     3.9 +
    3.10  #include "SDL.h"
    3.11  #include "SDL_mixer.h"
    3.12  
     4.1 --- a/load_aiff.c	Tue Sep 11 19:14:36 2001 +0000
     4.2 +++ b/load_aiff.c	Tue Sep 11 19:33:01 2001 +0000
     4.3 @@ -24,9 +24,7 @@
     4.4      This file by Torbjörn Andersson (torbjorn.andersson@eurotime.se)
     4.5  */
     4.6  
     4.7 -#include "SDL_mutex.h"
     4.8 -#include "SDL_endian.h"
     4.9 -#include "SDL_timer.h"
    4.10 +#include <string.h>
    4.11  
    4.12  #include "SDL_mixer.h"
    4.13  #include "load_aiff.h"
     5.1 --- a/load_voc.c	Tue Sep 11 19:14:36 2001 +0000
     5.2 +++ b/load_voc.c	Tue Sep 11 19:33:01 2001 +0000
     5.3 @@ -88,7 +88,7 @@
     5.4  #define VOC_DATA_16	9
     5.5  
     5.6  
     5.7 -static inline int voc_check_header(SDL_RWops *src)
     5.8 +static int voc_check_header(SDL_RWops *src)
     5.9  {
    5.10      /* VOC magic header */
    5.11      Uint8  signature[20];  /* "Creative Voice File\032" */
    5.12 @@ -127,7 +127,7 @@
    5.13      Uint32 new_rate_long;
    5.14      Uint8 trash[6];
    5.15      Uint16 period;
    5.16 -    int i;
    5.17 +    unsigned int i;
    5.18  
    5.19      v->silent = 0;
    5.20      while (v->rest == 0)
    5.21 @@ -167,7 +167,7 @@
    5.22                      }
    5.23  
    5.24                      v->rate = uc;
    5.25 -                    spec->freq = 1000000.0/(256 - v->rate);
    5.26 +                    spec->freq = (Uint16)(1000000.0/(256 - v->rate));
    5.27                      v->channels = 1;
    5.28                  }
    5.29