pkgsrc - initial commit
[pkgsrc.git] / audio / gramofile / patches / patch-ac
1 $NetBSD: patch-ac,v 1.3 2004/11/29 09:17:10 agc Exp $
2
3 Use fixed size fields
4
5 --- fmtheaders.h.orig   2000-03-28 22:07:26.000000000 +0100
6 +++ fmtheaders.h        2004-11-29 09:12:19.000000000 +0000
7 @@ -7,16 +7,16 @@
8  
9  #define VOC_MAGIC      "Creative Voice File\032"
10  
11 -#define DATALEN(bp)    ((u_long)(bp.BlockLen[0]) | \
12 -                         ((u_long)(bp.BlockLen[1]) << 8) | \
13 -                         ((u_long)(bp.BlockLen[2]) << 16) )
14 +#define DATALEN(bp)    ((u_int32_t)(bp.BlockLen[0]) | \
15 +                         ((u_int32_t)(bp.BlockLen[1]) << 8) | \
16 +                         ((u_int32_t)(bp.BlockLen[2]) << 16) )
17  
18  typedef struct vochead
19    {
20      u_char Magic[20];          /* must be VOC_MAGIC */
21 -    u_short BlockOffset;       /* Offset to first block from top of file */
22 -    u_short Version;           /* VOC-file version */
23 -    u_short IDCode;            /* complement of version + 0x1234 */
24 +    u_int16_t BlockOffset;     /* Offset to first block from top of file */
25 +    u_int16_t Version;         /* VOC-file version */
26 +    u_int16_t IDCode;          /* complement of version + 0x1234 */
27    }
28  vochead;
29  
30 @@ -36,7 +36,7 @@
31  
32  typedef struct blockT8
33    {
34 -    u_short TimeConstant;
35 +    u_int16_t TimeConstant;
36      u_char PackMethod;
37      u_char VoiceMode;
38    }
39 @@ -47,7 +47,7 @@
40      u_int SamplesPerSec;
41      u_char BitsPerSample;
42      u_char Channels;
43 -    u_short Format;
44 +    u_int16_t Format;
45      u_char reserved[4];
46    }
47  blockT9;
48 @@ -62,21 +62,21 @@
49   */
50  typedef struct wavhead
51    {
52 -    u_long main_chunk;         /* 'RIFF' */
53 -    u_long length;             /* Length of rest of file */
54 -    u_long chunk_type;         /* 'WAVE' */
55 -
56 -    u_long sub_chunk;          /* 'fmt ' */
57 -    u_long sc_len;             /* length of sub_chunk, =16 (rest of chunk) */
58 -    u_short format;            /* should be 1 for PCM-code */
59 -    u_short modus;             /* 1 Mono, 2 Stereo */
60 -    u_long sample_fq;          /* frequence of sample */
61 -    u_long byte_p_sec;
62 -    u_short byte_p_spl;                /* samplesize; 1 or 2 bytes */
63 -    u_short bit_p_spl;         /* 8, 12 or 16 bit */
64 +    u_int32_t main_chunk;              /* 'RIFF' */
65 +    u_int32_t length;          /* Length of rest of file */
66 +    u_int32_t chunk_type;              /* 'WAVE' */
67 +
68 +    u_int32_t sub_chunk;               /* 'fmt ' */
69 +    u_int32_t sc_len;          /* length of sub_chunk, =16 (rest of chunk) */
70 +    u_int16_t format;          /* should be 1 for PCM-code */
71 +    u_int16_t modus;           /* 1 Mono, 2 Stereo */
72 +    u_int32_t sample_fq;               /* frequence of sample */
73 +    u_int32_t byte_p_sec;
74 +    u_int16_t byte_p_spl;              /* samplesize; 1 or 2 bytes */
75 +    u_int16_t bit_p_spl;               /* 8, 12 or 16 bit */
76  
77 -    u_long data_chunk;         /* 'data' */
78 -    u_long data_length;                /* samplecount (lenth of rest of block?) */
79 +    u_int32_t data_chunk;              /* 'data' */
80 +    u_int32_t data_length;             /* samplecount (lenth of rest of block?) */
81    }
82  wavhead;
83