# HG changeset patch # User chainsaw # Date 1179484865 25200 # Node ID 77dbd83ea6e42bc8dec440e2aba69198afe54ac8 # Parent 7d7f77129c7520ec36437ba7621eb7b95cb37a4e [svn] Use proper integer types in the code, patch by Pavel Vymetalek . diff -r 7d7f77129c75 -r 77dbd83ea6e4 ChangeLog --- a/ChangeLog Wed May 16 13:00:14 2007 -0700 +++ b/ChangeLog Fri May 18 03:41:05 2007 -0700 @@ -1,3 +1,14 @@ +2007-05-16 20:00:14 +0000 Ralf Ertzinger + revision [2248] + + - Do not complain about errors in the stream while testing a file + + trunk/src/flacng/flacng.h | 1 + + trunk/src/flacng/seekable_stream_callbacks.c | 10 +++++++++- + trunk/src/flacng/tools.c | 8 ++++++++ + 3 files changed, 18 insertions(+), 1 deletion(-) + + 2007-05-16 11:10:36 +0000 Ralf Ertzinger revision [2246] diff -r 7d7f77129c75 -r 77dbd83ea6e4 src/vtx/ay8912.c --- a/src/vtx/ay8912.c Wed May 16 13:00:14 2007 -0700 +++ b/src/vtx/ay8912.c Fri May 18 03:41:05 2007 -0700 @@ -1,5 +1,6 @@ /* AY/YM emulator implementation. */ +#include #include "ayemu.h" #define debuglog stderr; @@ -211,7 +212,7 @@ /** Set chip frequency. */ -void ayemu_set_chip_freq(ayemu_ay_t *ay, int chipfreq) +void ayemu_set_chip_freq(ayemu_ay_t *ay, int32_t chipfreq) { if (!check_magic(ay)) return; @@ -378,9 +379,8 @@ } } - /* ÄÉÎÁÍÉÞÅÓËÁÑ ÎÁÓÔÒÏÊËÁ ÇÌÏÂÁÌØÎÏÇÏ ËÏÜÆÆÉÃÉÅÎÔÁ ÕÓÉÌÅÎÉÑ - ÐÏÄÒÁÚÕÍÅ×ÁÅÔÓÑ, ÞÔÏ × vols [x][31] ÌÅÖÉÔ ÓÁÍÁÑ ÂÏÌØÛÁÑ ÇÒÏÍËÏÓÔØ - TODO: óÄÅÌÁÔØ ÐÒÏ×ÅÒËÕ ÎÁ ÜÔÏ ;-) + /* ������ ����������������� ���� + �������� ���vols [x][31] ��������������� TODO: �������� � ��;-) */ max_l = ay->vols[0][31] + ay->vols[2][31] + ay->vols[3][31]; max_r = ay->vols[1][31] + ay->vols[3][31] + ay->vols[5][31]; diff -r 7d7f77129c75 -r 77dbd83ea6e4 src/vtx/ayemu_8912.h --- a/src/vtx/ayemu_8912.h Wed May 16 13:00:14 2007 -0700 +++ b/src/vtx/ayemu_8912.h Fri May 18 03:41:05 2007 -0700 @@ -6,6 +6,7 @@ #define _AYEMU_ay8912_h #include +#include BEGIN_C_DECLS @@ -85,7 +86,7 @@ /* emulator settings */ int table[32]; /**< table of volumes for chip */ ayemu_chip_t type; /**< general chip type (\b AYEMU_AY or \b AYEMU_YM) */ - int ChipFreq; /**< chip emulator frequency */ + int32_t ChipFreq; /**< chip emulator frequency */ int eq[6]; /**< volumes for channels. Array contains 6 elements: A left, A right, B left, B right, C left and C right; diff -r 7d7f77129c75 -r 77dbd83ea6e4 src/vtx/ayemu_vtxfile.h --- a/src/vtx/ayemu_vtxfile.h Wed May 16 13:00:14 2007 -0700 +++ b/src/vtx/ayemu_vtxfile.h Fri May 18 03:41:05 2007 -0700 @@ -2,6 +2,7 @@ #define _AYEMU_vtxfile_h #include +#include #include #include "ayemu_8912.h" @@ -27,7 +28,7 @@ ayemu_chip_t chiptype; /**< Type of sound chip */ int stereo; /**< Type of stereo: 0-ABC, 1-BCA... (see VTX format description) */ int loop; /**< song loop */ - int chipFreq; /**< AY chip freq (1773400 for ZX) */ + int32_t chipFreq; /**< AY chip freq (1773400 for ZX) */ int playerFreq; /**< 50 Hz for ZX, 60 Hz for yamaha */ int year; /**< year song composed */ NTstring title; /**< song title */ diff -r 7d7f77129c75 -r 77dbd83ea6e4 src/vtx/vtxfile.c --- a/src/vtx/vtxfile.c Wed May 16 13:00:14 2007 -0700 +++ b/src/vtx/vtxfile.c Fri May 18 03:41:05 2007 -0700 @@ -3,6 +3,7 @@ #include #include #include +#include #include "ayemu.h" @@ -48,7 +49,7 @@ /* read 32-bit integer from file. * Returns 1 if error occurs */ -static int read_word32(VFSFile *fp, int *p) +static int read_word32(VFSFile *fp, int32_t *p) { int c; @@ -104,6 +105,7 @@ { char buf[2]; int error = 0; + int32_t int_regdata_size; vtx->regdata = NULL; @@ -135,7 +137,11 @@ if (!error) error = read_word32(vtx->fp, &vtx->hdr.chipFreq); if (!error) error = read_byte(vtx->fp, &vtx->hdr.playerFreq); if (!error) error = read_word16(vtx->fp, &vtx->hdr.year); - if (!error) error = read_word32(vtx->fp, &vtx->hdr.regdata_size); + if (!error) { + error = read_word32(vtx->fp, &int_regdata_size); + vtx->hdr.regdata_size = (size_t) int_regdata_size; + } + if (!error) error = read_NTstring(vtx->fp, vtx->hdr.title); if (!error) error = read_NTstring(vtx->fp, vtx->hdr.author); if (!error) error = read_NTstring(vtx->fp, vtx->hdr.from);