Skip to content

Commit d880d4f

Browse files
committed
fix warnings
git-svn-id: svn://svn.icculus.org/twilight/trunk/dpvideo@7585 d7cf8633-e32d-0410-b094-e92efae38249
1 parent 7e44a26 commit d880d4f

File tree

5 files changed

+9
-7
lines changed

5 files changed

+9
-7
lines changed

dpvencode.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ static void dpvencode_sound(dpvencodestream_t *s, short *sound, unsigned int sou
195195
static void dpvencode_compressimage(dpvencodestream_t *s, unsigned char *pixels, double quality)
196196
{
197197
int i, j, a, b, cr, cg, cb, x1, y1, width, height, bw, bh, palettebits, paletteuse[4096], best1, best2, best, bestscore, score, colors, rdist, gdist, bdist, threshold, deltablocks, deltablockthreshold;
198-
int deltapixelerror, deltablockerror;
198+
int deltapixelerror, deltablockerror = 0;
199199
unsigned char palette[4096 * 4], *pix, *p;
200200
double error, errorstart, errorblock, errorbiggest;
201201
dpvencodeblockinfo_t *block;

dpvplayer.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ static void dpvplayer(char *filename, void *stream, int fullscreen, int opengl,
246246
SDL_AudioSpec *desiredaudiospec = NULL;
247247
double soundmixahead;
248248
double soundprefetch;
249-
double soundlatency;
249+
double soundlatency = 0;
250250
int soundmixaheadsamples;
251251
int soundprefetchsamples;
252252
int soundlatencysamples;

file.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include <stdio.h>
44
#include "file.h"
55

6-
int readfile(char *filename, void **mem, int *size)
6+
int readfile(char *filename, void **mem, unsigned int *size)
77
{
88
FILE *file;
99
char *filemem;
@@ -35,7 +35,7 @@ int readfile(char *filename, void **mem, int *size)
3535
return 0;
3636
}
3737

38-
int writefile(char *filename, void *mem, int size)
38+
int writefile(char *filename, void *mem, unsigned int size)
3939
{
4040
FILE *file;
4141
int writesize;

file.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#ifndef FILE_H
33
#define FILE_H
44

5-
int readfile(char *filename, void **mem, int *size);
6-
int writefile(char *filename, void *mem, int size);
5+
int readfile(char *filename, void **mem, unsigned int *size);
6+
int writefile(char *filename, void *mem, unsigned int size);
77

88
#endif

tgafile.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ tgafile_t *loadtga(char *filename)
1616
int columns, rows, row, column;
1717
unsigned int datasize;
1818
unsigned char *pixbuf, *pixels, *fin, *data, *enddata;
19+
void *voiddata;
1920
// the contents of the targa header
2021
struct
2122
{
@@ -27,8 +28,9 @@ tgafile_t *loadtga(char *filename)
2728
}
2829
targa;
2930

30-
if (readfile(filename, (void **)&data, &datasize) || datasize < 18)
31+
if (readfile(filename, &voiddata, &datasize) || datasize < 18)
3132
return NULL;
33+
data = (unsigned char *)voiddata;
3234

3335
targa.id_length = data[0];
3436
targa.colormap_type = data[1];

0 commit comments

Comments
 (0)