1
# Patch by Tom Harvey <TomHarvey@IndustryFigure.com>
4
diff -ur gramofile-1.6.orig/bplaysrc/fmtheaders.h gramofile-1.6/bplaysrc/fmtheaders.h
5
--- gramofile-1.6.orig/bplaysrc/fmtheaders.h Sat May 5 15:52:25 2001
6
+++ gramofile-1.6/bplaysrc/fmtheaders.h Fri Jun 8 09:55:20 2001
8
#define _FMTHEADERS_H 1
10
#include <sys/types.h>
11
+#include <inttypes.h>
13
/* Definitions for .VOC files */
15
#define VOC_MAGIC "Creative Voice File\032"
17
-#define DATALEN(bp) ((u_long)(bp.BlockLen[0]) | \
18
- ((u_long)(bp.BlockLen[1]) << 8) | \
19
- ((u_long)(bp.BlockLen[2]) << 16) )
20
+#define DATALEN(bp) ((uint32_t)(bp.BlockLen[0]) | \
21
+ ((uint32_t)(bp.BlockLen[1]) << 8) | \
22
+ ((uint32_t)(bp.BlockLen[2]) << 16) )
24
typedef struct vochead {
25
u_char Magic[20]; /* must be VOC_MAGIC */
27
it works on all WAVE-file I have
29
typedef struct wavhead {
30
- u_long main_chunk; /* 'RIFF' */
31
- u_long length; /* Length of rest of file */
32
- u_long chunk_type; /* 'WAVE' */
33
+ uint32_t main_chunk; /* 'RIFF' */
34
+ uint32_t length; /* Length of rest of file */
35
+ uint32_t chunk_type; /* 'WAVE' */
37
- u_long sub_chunk; /* 'fmt ' */
38
- u_long sc_len; /* length of sub_chunk, =16 (rest of chunk) */
39
+ uint32_t sub_chunk; /* 'fmt ' */
40
+ uint32_t sc_len; /* length of sub_chunk, =16 (rest of chunk) */
41
u_short format; /* should be 1 for PCM-code */
42
u_short modus; /* 1 Mono, 2 Stereo */
43
- u_long sample_fq; /* frequence of sample */
45
+ uint32_t sample_fq; /* frequence of sample */
46
+ uint32_t byte_p_sec;
47
u_short byte_p_spl; /* samplesize; 1 or 2 bytes */
48
u_short bit_p_spl; /* 8, 12 or 16 bit */
50
- u_long data_chunk; /* 'data' */
51
- u_long data_length; /* samplecount (lenth of rest of block?)*/
52
+ uint32_t data_chunk; /* 'data' */
53
+ uint32_t data_length; /* samplecount (lenth of rest of block?)*/
57
diff -ur gramofile-1.6.orig/endian.c gramofile-1.6/endian.c
58
--- gramofile-1.6.orig/endian.c Sat May 5 15:52:25 2001
59
+++ gramofile-1.6/endian.c Fri Jun 8 09:51:44 2001
65
-SwapFourBytes (u_long dw)
67
+SwapFourBytes (uint32_t dw)
69
- register u_long tmp;
70
+ register uint32_t tmp;
71
tmp = (dw & 0x000000FF);
72
tmp = ((dw & 0x0000FF00) >> 0x08) | (tmp << 0x08);
73
tmp = ((dw & 0x00FF0000) >> 0x10) | (tmp << 0x08);
74
diff -ur gramofile-1.6.orig/endian.h gramofile-1.6/endian.h
75
--- gramofile-1.6.orig/endian.h Sat May 5 15:52:25 2001
76
+++ gramofile-1.6/endian.h Fri Jun 8 09:57:11 2001
81
+#include <inttypes.h>
83
extern u_short SwapTwoBytes (u_short);
84
-extern u_long SwapFourBytes (u_long);
85
+extern uint32_t SwapFourBytes (uint32_t);
86
extern sample_t SwapSample (sample_t);
89
diff -ur gramofile-1.6.orig/fmtheaders.h gramofile-1.6/fmtheaders.h
90
--- gramofile-1.6.orig/fmtheaders.h Sat May 5 15:52:25 2001
91
+++ gramofile-1.6/fmtheaders.h Fri Jun 8 09:59:02 2001
93
#define _FMTHEADERS_H 1
95
#include <sys/types.h>
96
+#include <inttypes.h>
98
/* Definitions for .VOC files */
100
#define VOC_MAGIC "Creative Voice File\032"
102
-#define DATALEN(bp) ((u_long)(bp.BlockLen[0]) | \
103
- ((u_long)(bp.BlockLen[1]) << 8) | \
104
- ((u_long)(bp.BlockLen[2]) << 16) )
105
+#define DATALEN(bp) ((uint32_t)(bp.BlockLen[0]) | \
106
+ ((uint32_t)(bp.BlockLen[1]) << 8) | \
107
+ ((uint32_t)(bp.BlockLen[2]) << 16) )
109
typedef struct vochead
113
typedef struct wavhead
115
- u_long main_chunk; /* 'RIFF' */
116
- u_long length; /* Length of rest of file */
117
- u_long chunk_type; /* 'WAVE' */
118
+ uint32_t main_chunk; /* 'RIFF' */
119
+ uint32_t length; /* Length of rest of file */
120
+ uint32_t chunk_type; /* 'WAVE' */
122
- u_long sub_chunk; /* 'fmt ' */
123
- u_long sc_len; /* length of sub_chunk, =16 (rest of chunk) */
124
+ uint32_t sub_chunk; /* 'fmt ' */
125
+ uint32_t sc_len; /* length of sub_chunk, =16 (rest of chunk) */
126
u_short format; /* should be 1 for PCM-code */
127
u_short modus; /* 1 Mono, 2 Stereo */
128
- u_long sample_fq; /* frequence of sample */
130
+ uint32_t sample_fq; /* frequence of sample */
131
+ uint32_t byte_p_sec;
132
u_short byte_p_spl; /* samplesize; 1 or 2 bytes */
133
u_short bit_p_spl; /* 8, 12 or 16 bit */
135
- u_long data_chunk; /* 'data' */
136
- u_long data_length; /* samplecount (lenth of rest of block?) */
137
+ uint32_t data_chunk; /* 'data' */
138
+ uint32_t data_length; /* samplecount (lenth of rest of block?) */