Skip to content

Commit

Permalink
Minor cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Sep 11, 2001
1 parent d891338 commit 6896873
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 18 deletions.
1 change: 1 addition & 0 deletions acinclude.m4
Expand Up @@ -32,6 +32,7 @@ AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run
fi
fi
AC_REQUIRE([AC_CANONICAL_TARGET])
AC_PATH_PROG(SDL_CONFIG, sdl-config, no)
min_sdl_version=ifelse([$1], ,0.11.0,$1)
AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
Expand Down
18 changes: 8 additions & 10 deletions effect_position.c
Expand Up @@ -26,8 +26,8 @@

#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include <unistd.h>
#include <string.h>

#include "SDL.h"
#include "SDL_mixer.h"

Expand Down Expand Up @@ -438,8 +438,8 @@ int Mix_SetPanning(int channel, Uint8 left, Uint8 right)

args->left_u8 = left;
args->right_u8 = right;
args->left_f = ((float) left) / 255.0;
args->right_f = ((float) right) / 255.0;
args->left_f = ((float) left) / 255.0f;
args->right_f = ((float) right) / 255.0f;
if (!args->in_use) {
args->in_use = 1;
return(Mix_RegisterEffect(channel, f, _Eff_PositionDone, (void *) args));
Expand Down Expand Up @@ -474,7 +474,7 @@ int Mix_SetDistance(int channel, Uint8 distance)
}

args->distance_u8 = distance;
args->distance_f = ((float) distance) / 255.0;
args->distance_f = ((float) distance) / 255.0f;
if (!args->in_use) {
args->in_use = 1;
return(Mix_RegisterEffect(channel, f, _Eff_PositionDone, (void *) args));
Expand All @@ -491,8 +491,6 @@ int Mix_SetPosition(int channel, Sint16 angle, Uint8 distance)
int channels;
position_args *args = NULL;
Uint8 left = 255, right = 255;
int flip;
float angle_f;

Mix_QuerySpec(NULL, &format, &channels);
f = get_position_effect_func(format);
Expand Down Expand Up @@ -537,11 +535,11 @@ int Mix_SetPosition(int channel, Sint16 angle, Uint8 distance)
distance = 255 - distance; /* flip it to scale Mix_SetDistance() uses. */

args->left_u8 = left;
args->left_f = ((float) left) / 255.0;
args->left_f = ((float) left) / 255.0f;
args->right_u8 = right;
args->right_f = ((float) right) / 255.0;
args->right_f = ((float) right) / 255.0f;
args->distance_u8 = distance;
args->distance_f = ((float) distance) / 255.0;
args->distance_f = ((float) distance) / 255.0f;
if (!args->in_use) {
args->in_use = 1;
return(Mix_RegisterEffect(channel, f, _Eff_PositionDone, (void *) args));
Expand Down
3 changes: 1 addition & 2 deletions effect_stereoreverse.c
Expand Up @@ -26,8 +26,7 @@

#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include <unistd.h>

#include "SDL.h"
#include "SDL_mixer.h"

Expand Down
4 changes: 1 addition & 3 deletions load_aiff.c
Expand Up @@ -24,9 +24,7 @@
This file by Torbjörn Andersson (torbjorn.andersson@eurotime.se)
*/

#include "SDL_mutex.h"
#include "SDL_endian.h"
#include "SDL_timer.h"
#include <string.h>

#include "SDL_mixer.h"
#include "load_aiff.h"
Expand Down
6 changes: 3 additions & 3 deletions load_voc.c
Expand Up @@ -88,7 +88,7 @@ typedef struct vocstuff {
#define VOC_DATA_16 9


static inline int voc_check_header(SDL_RWops *src)
static int voc_check_header(SDL_RWops *src)
{
/* VOC magic header */
Uint8 signature[20]; /* "Creative Voice File\032" */
Expand Down Expand Up @@ -127,7 +127,7 @@ static int voc_get_block(SDL_RWops *src, vs_t *v, SDL_AudioSpec *spec)
Uint32 new_rate_long;
Uint8 trash[6];
Uint16 period;
int i;
unsigned int i;

v->silent = 0;
while (v->rest == 0)
Expand Down Expand Up @@ -167,7 +167,7 @@ static int voc_get_block(SDL_RWops *src, vs_t *v, SDL_AudioSpec *spec)
}

v->rate = uc;
spec->freq = 1000000.0/(256 - v->rate);
spec->freq = (Uint16)(1000000.0/(256 - v->rate));
v->channels = 1;
}

Expand Down

0 comments on commit 6896873

Please sign in to comment.