mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-02-13 07:21:31 +00:00
restore compilability with g++. some whitespace tidy-ups.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@986 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
7c1e078b2a
commit
5b9140cb06
2 changed files with 39 additions and 43 deletions
|
@ -33,7 +33,7 @@ typedef struct stdio_buffer_s {
|
|||
|
||||
static stdio_buffer_t *Buf_Alloc(FILE *f)
|
||||
{
|
||||
stdio_buffer_t *buf = calloc(1, sizeof(stdio_buffer_t));
|
||||
stdio_buffer_t *buf = (stdio_buffer_t *) calloc(1, sizeof(stdio_buffer_t));
|
||||
buf->f = f;
|
||||
return buf;
|
||||
}
|
||||
|
@ -460,7 +460,6 @@ byte *Image_LoadPCX (FILE *f, int *width, int *height)
|
|||
}
|
||||
|
||||
Buf_Free(buf);
|
||||
|
||||
fclose(f);
|
||||
|
||||
*width = w;
|
||||
|
|
|
@ -215,8 +215,8 @@ static void S_UpdateFilter(filter_t *filter, int M, float f_c)
|
|||
filter->parity = 0;
|
||||
// M + 1 rounded up to the next multiple of 16
|
||||
filter->kernelsize = (M + 1) + 16 - ((M + 1) % 16);
|
||||
filter->memory = calloc(filter->kernelsize, sizeof(float));
|
||||
filter->kernel = calloc(filter->kernelsize, sizeof(float));
|
||||
filter->memory = (float *) calloc(filter->kernelsize, sizeof(float));
|
||||
filter->kernel = (float *) calloc(filter->kernelsize, sizeof(float));
|
||||
|
||||
S_MakeBlackmanWindowKernel(filter->kernel, M, f_c);
|
||||
}
|
||||
|
@ -242,11 +242,10 @@ static void S_ApplyFilter(filter_t *filter, int *data, int stride, int count)
|
|||
const float *kernel = filter->kernel;
|
||||
int parity;
|
||||
|
||||
input = malloc(sizeof(float) * (filter->kernelsize + count));
|
||||
input = (float *) malloc(sizeof(float) * (filter->kernelsize + count));
|
||||
|
||||
// set up the input buffer
|
||||
// memory holds the previous filter->kernelsize samples of input.
|
||||
|
||||
memcpy(input, filter->memory, filter->kernelsize * sizeof(float));
|
||||
|
||||
for (i=0; i<count; i++)
|
||||
|
@ -255,11 +254,9 @@ static void S_ApplyFilter(filter_t *filter, int *data, int stride, int count)
|
|||
}
|
||||
|
||||
// copy out the last filter->kernelsize samples to 'memory' for next time
|
||||
|
||||
memcpy(filter->memory, input + count, filter->kernelsize * sizeof(float));
|
||||
|
||||
// apply the filter
|
||||
|
||||
parity = filter->parity;
|
||||
|
||||
for (i=0; i<count; i++)
|
||||
|
|
Loading…
Reference in a new issue