changeset 1042:77dbd83ea6e4 trunk

[svn] Use proper integer types in the code, patch by Pavel Vymetalek <pvymetalek@seznam.cz>.
author chainsaw
date Fri, 18 May 2007 03:41:05 -0700
parents 7d7f77129c75
children f65aa5417221
files ChangeLog src/vtx/ay8912.c src/vtx/ayemu_8912.h src/vtx/ayemu_vtxfile.h src/vtx/vtxfile.c
diffstat 5 files changed, 27 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- 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 <ralf@skytale.net>
+  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 <ralf@skytale.net>
   revision [2246]
   
--- 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 <inttypes.h>
 #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];
--- 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 <stddef.h>
+#include <inttypes.h>
 
 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;
--- 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 <glib.h>
+#include <inttypes.h>
 #include <audacious/vfs.h>
 #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  */
--- 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 <errno.h>
 #include <assert.h>
 #include <ctype.h>
+#include <inttypes.h>
 
 #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);