patch to gramofile 1.6:
Fix to read/write .wav files on Alpha and other LP64 machines

	endian.c 
	endian.h 
	fmtheaders.h 
	bplaysrc/fmtheaders.h




Index: endian.c
===================================================================
RCS file: /usr/home/share/cvs/audio/gramofile/endian.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- endian.c	2001/01/29 00:35:38	1.1.1.1
+++ endian.c	2001/01/29 06:57:46	1.2
@@ -24,10 +24,10 @@
   return (tmp);
 }
 
-u_long
-SwapFourBytes (u_long dw)
+uint32_t
+SwapFourBytes (uint32_t dw)
 {
-  register u_long tmp;
+  register uint32_t tmp;
   tmp = (dw & 0x000000FF);
   tmp = ((dw & 0x0000FF00) >> 0x08) | (tmp << 0x08);
   tmp = ((dw & 0x00FF0000) >> 0x10) | (tmp << 0x08);
Index: endian.h
===================================================================
RCS file: /usr/home/share/cvs/audio/gramofile/endian.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- endian.h	2001/01/29 00:35:38	1.1.1.1
+++ endian.h	2001/01/29 06:57:46	1.2
@@ -4,8 +4,10 @@
 #ifndef _GETBIG
 #define _GETBIG 1
 
+#include <inttypes.h>
+
 extern u_short SwapTwoBytes (u_short);
-extern u_long SwapFourBytes (u_long);
+extern uint32_t SwapFourBytes (uint32_t);
 extern sample_t SwapSample (sample_t);
 
 #endif
Index: fmtheaders.h
===================================================================
RCS file: /usr/home/share/cvs/audio/gramofile/fmtheaders.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- fmtheaders.h	2001/01/29 00:35:35	1.1.1.1
+++ fmtheaders.h	2001/01/29 06:57:47	1.2
@@ -2,14 +2,15 @@
 #define _FMTHEADERS_H	1
 
 #include <sys/types.h>
+#include <inttypes.h>
 
 /* Definitions for .VOC files */
 
 #define VOC_MAGIC	"Creative Voice File\032"
 
-#define DATALEN(bp)	((u_long)(bp.BlockLen[0]) | \
-                         ((u_long)(bp.BlockLen[1]) << 8) | \
-                         ((u_long)(bp.BlockLen[2]) << 16) )
+#define DATALEN(bp)	((uint32_t)(bp.BlockLen[0]) | \
+                         ((uint32_t)(bp.BlockLen[1]) << 8) | \
+                         ((uint32_t)(bp.BlockLen[2]) << 16) )
 
 typedef struct vochead
   {
@@ -62,21 +63,21 @@
  */
 typedef struct wavhead
   {
-    u_long main_chunk;		/* 'RIFF' */
-    u_long length;		/* Length of rest of file */
-    u_long chunk_type;		/* 'WAVE' */
+    uint32_t main_chunk;	/* 'RIFF' */
+    uint32_t length;		/* Length of rest of file */
+    uint32_t chunk_type;	/* 'WAVE' */
 
-    u_long sub_chunk;		/* 'fmt ' */
-    u_long sc_len;		/* length of sub_chunk, =16 (rest of chunk) */
+    uint32_t sub_chunk;		/* 'fmt ' */
+    uint32_t sc_len;		/* length of sub_chunk, =16 (rest of chunk) */
     u_short format;		/* should be 1 for PCM-code */
     u_short modus;		/* 1 Mono, 2 Stereo */
-    u_long sample_fq;		/* frequence of sample */
-    u_long byte_p_sec;
+    uint32_t sample_fq;		/* frequence of sample */
+    uint32_t byte_p_sec;
     u_short byte_p_spl;		/* samplesize; 1 or 2 bytes */
     u_short bit_p_spl;		/* 8, 12 or 16 bit */
 
-    u_long data_chunk;		/* 'data' */
-    u_long data_length;		/* samplecount (lenth of rest of block?) */
+    uint32_t data_chunk;	/* 'data' */
+    uint32_t data_length;	/* samplecount (lenth of rest of block?) */
   }
 wavhead;
 
Index: bplaysrc/fmtheaders.h
===================================================================
RCS file: /usr/home/share/cvs/audio/gramofile/bplaysrc/fmtheaders.h,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 fmtheaders.h
--- bplaysrc/fmtheaders.h	2001/01/29 00:35:39	1.1.1.1
+++ bplaysrc/fmtheaders.h	2001/01/29 04:17:46
@@ -2,14 +2,15 @@
 #define _FMTHEADERS_H	1
 
 #include <sys/types.h>
+#include <inttypes.h>
 
 /* Definitions for .VOC files */
 
 #define VOC_MAGIC	"Creative Voice File\032"
 
-#define DATALEN(bp)	((u_long)(bp.BlockLen[0]) | \
-                         ((u_long)(bp.BlockLen[1]) << 8) | \
-                         ((u_long)(bp.BlockLen[2]) << 16) )
+#define DATALEN(bp)	((uint32_t)(bp.BlockLen[0]) | \
+                         ((uint32_t)(bp.BlockLen[1]) << 8) | \
+                         ((uint32_t)(bp.BlockLen[2]) << 16) )
 
 typedef struct vochead {
   u_char  Magic[20];	/* must be VOC_MAGIC */
@@ -51,21 +52,21 @@
    it works on all WAVE-file I have
 */
 typedef struct wavhead {
-  u_long	main_chunk;	/* 'RIFF' */
-  u_long	length;		/* Length of rest of file */
-  u_long	chunk_type;	/* 'WAVE' */
+  uint32_t	main_chunk;	/* 'RIFF' */
+  uint32_t	length;		/* Length of rest of file */
+  uint32_t	chunk_type;	/* 'WAVE' */
 
-  u_long	sub_chunk;	/* 'fmt ' */
-  u_long	sc_len;		/* length of sub_chunk, =16 (rest of chunk) */
+  uint32_t	sub_chunk;	/* 'fmt ' */
+  uint32_t	sc_len;		/* length of sub_chunk, =16 (rest of chunk) */
   u_short	format;		/* should be 1 for PCM-code */
   u_short	modus;		/* 1 Mono, 2 Stereo */
-  u_long	sample_fq;	/* frequence of sample */
-  u_long	byte_p_sec;
+  uint32_t	sample_fq;	/* frequence of sample */
+  uint32_t	byte_p_sec;
   u_short	byte_p_spl;	/* samplesize; 1 or 2 bytes */
   u_short	bit_p_spl;	/* 8, 12 or 16 bit */ 
 
-  u_long	data_chunk;	/* 'data' */
-  u_long	data_length;	/* samplecount (lenth of rest of block?)*/
+  uint32_t	data_chunk;	/* 'data' */
+  uint32_t	data_length;	/* samplecount (lenth of rest of block?)*/
 } wavhead;
 
 #endif
