summaryrefslogtreecommitdiff
blob: 1be9d55845eab1cc7a31421edbf1e9c125602402 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
Patch from Jason Allen to minimise memory usage marking constant reference
tables.
See http://bmaurer.blogspot.com/2006/03/memory-usage-with-smaps.html .

diff -ur audiofile-0.2.6-orig/libaudiofile/aiff.c audiofile-0.2.6-mine/libaudiofile/aiff.c
--- audiofile-0.2.6-orig/libaudiofile/aiff.c	2004-03-06 01:39:23.000000000 -0500
+++ audiofile-0.2.6-mine/libaudiofile/aiff.c	2006-03-22 02:15:50.058306000 -0500
@@ -64,7 +64,7 @@
 static status ParseSSND (AFfilehandle file, AFvirtualfile *fh, u_int32_t type,
 	size_t size);
 
-_InstParamInfo _af_aiff_inst_params[_AF_AIFF_NUM_INSTPARAMS] =
+const _InstParamInfo _af_aiff_inst_params[_AF_AIFF_NUM_INSTPARAMS] =
 {
 	{ AF_INST_MIDI_BASENOTE, AU_PVTYPE_LONG, "MIDI base note", {60} },
 	{ AF_INST_NUMCENTS_DETUNE, AU_PVTYPE_LONG, "Detune in cents", {0} },
@@ -77,7 +77,7 @@
 	{ AF_INST_RELLOOPID, AU_PVTYPE_LONG, "Release loop id", {0} }
 };
 
-int _af_aiffc_compression_types[_AF_AIFF_NUM_COMPTYPES] =
+const int _af_aiffc_compression_types[_AF_AIFF_NUM_COMPTYPES] =
 {
 	AF_COMPRESSION_G711_ULAW,
 	AF_COMPRESSION_G711_ALAW
diff -ur audiofile-0.2.6-orig/libaudiofile/compression.c audiofile-0.2.6-mine/libaudiofile/compression.c
--- audiofile-0.2.6-orig/libaudiofile/compression.c	2004-03-06 01:39:23.000000000 -0500
+++ audiofile-0.2.6-mine/libaudiofile/compression.c	2006-03-22 02:04:44.948739250 -0500
@@ -37,7 +37,7 @@
 #include "units.h"
 #include "util.h"
 
-extern _CompressionUnit _af_compression[];
+extern const _CompressionUnit _af_compression[];
 
 int _af_compression_index_from_id (int compressionid)
 {
@@ -54,7 +54,7 @@
 	return -1;
 }
 
-static _CompressionUnit *findCompression (int compressionid)
+static const _CompressionUnit *findCompression (int compressionid)
 {
 	int	compressionno;
 
diff -ur audiofile-0.2.6-orig/libaudiofile/debug.c audiofile-0.2.6-mine/libaudiofile/debug.c
--- audiofile-0.2.6-orig/libaudiofile/debug.c	2004-03-06 01:39:23.000000000 -0500
+++ audiofile-0.2.6-mine/libaudiofile/debug.c	2006-03-22 01:56:31.187180000 -0500
@@ -49,7 +49,7 @@
 #include "print.h"
 #include "debug.h"
 
-extern _CompressionUnit _af_compression[];
+extern const _CompressionUnit _af_compression[];
 
 void _af_printid (u_int32_t id)
 {
diff -ur audiofile-0.2.6-orig/libaudiofile/format.c audiofile-0.2.6-mine/libaudiofile/format.c
--- audiofile-0.2.6-orig/libaudiofile/format.c	2004-03-06 01:39:23.000000000 -0500
+++ audiofile-0.2.6-mine/libaudiofile/format.c	2006-03-22 01:56:21.586580000 -0500
@@ -43,7 +43,7 @@
 #include "units.h"
 #include "modules.h"
 
-extern _Unit _af_units[];
+extern const _Unit _af_units[];
 
 AFfileoffset afGetDataOffset (AFfilehandle file, int trackid)
 {
diff -ur audiofile-0.2.6-orig/libaudiofile/g711.c audiofile-0.2.6-mine/libaudiofile/g711.c
--- audiofile-0.2.6-orig/libaudiofile/g711.c	2004-03-06 01:39:23.000000000 -0500
+++ audiofile-0.2.6-mine/libaudiofile/g711.c	2006-03-21 22:57:37.356130750 -0500
@@ -38,7 +38,7 @@
 #define	SEG_MASK	(0x70)		/* Segment field mask. */
 
 /* copy from CCITT G.711 specifications */
-static unsigned char _u2a[128] = {		/* u- to A-law conversions */
+static const unsigned char _u2a[128] = {		/* u- to A-law conversions */
 	1,	1,	2,	2,	3,	3,	4,	4,
 	5,	5,	6,	6,	7,	7,	8,	8,
 	9,	10,	11,	12,	13,	14,	15,	16,
@@ -56,7 +56,7 @@
 	113,	114,	115,	116,	117,	118,	119,	120,
 	121,	122,	123,	124,	125,	126,	127,	128};
 
-static unsigned char _a2u[128] = {		/* A- to u-law conversions */
+static const unsigned char _a2u[128] = {		/* A- to u-law conversions */
 	1,	3,	5,	7,	9,	11,	13,	15,
 	16,	17,	18,	19,	20,	21,	22,	23,
 	24,	25,	26,	27,	28,	29,	30,	31,
@@ -77,7 +77,7 @@
 /* see libst.h */
 #ifdef	SUPERCEDED
 
-static short seg_end[8] = {0xFF, 0x1FF, 0x3FF, 0x7FF,
+static const short seg_end[8] = {0xFF, 0x1FF, 0x3FF, 0x7FF,
 			    0xFFF, 0x1FFF, 0x3FFF, 0x7FFF};
 
 static int
diff -ur audiofile-0.2.6-orig/libaudiofile/instrument.c audiofile-0.2.6-mine/libaudiofile/instrument.c
--- audiofile-0.2.6-orig/libaudiofile/instrument.c	2004-03-06 01:39:23.000000000 -0500
+++ audiofile-0.2.6-mine/libaudiofile/instrument.c	2006-03-22 01:56:12.642021000 -0500
@@ -55,7 +55,7 @@
 
 #include <stdio.h>
 
-extern _Unit _af_units[];
+extern const _Unit _af_units[];
 
 /*
 	Initialize instrument id list for audio file.
diff -ur audiofile-0.2.6-orig/libaudiofile/modules.c audiofile-0.2.6-mine/libaudiofile/modules.c
--- audiofile-0.2.6-orig/libaudiofile/modules.c	2004-03-06 01:39:23.000000000 -0500
+++ audiofile-0.2.6-mine/libaudiofile/modules.c	2006-03-22 02:07:29.411017500 -0500
@@ -56,15 +56,15 @@
 
 #define NULLMODULEPARAM
 
-extern _PCMInfo _af_default_signed_integer_pcm_mappings[];
-extern _PCMInfo _af_default_unsigned_integer_pcm_mappings[];
-extern _PCMInfo _af_default_float_pcm_mapping;
-extern _PCMInfo _af_default_double_pcm_mapping;
+extern const _PCMInfo _af_default_signed_integer_pcm_mappings[];
+extern const _PCMInfo _af_default_unsigned_integer_pcm_mappings[];
+extern const _PCMInfo _af_default_float_pcm_mapping;
+extern const _PCMInfo _af_default_double_pcm_mapping;
 
 extern _CompressionUnit _af_compression[];
 
 /* Define rebuffering modules. */
-extern _AFmodule int2rebufferv2f, int2rebufferf2v;
+extern const _AFmodule int2rebufferv2f, int2rebufferf2v;
 
 /*
 	module utility routines
@@ -1511,7 +1511,7 @@
 	}
 };
 
-static _PCMInfo *intmappings[6] =
+static const _PCMInfo *intmappings[6] =
 {
 	&_af_default_signed_integer_pcm_mappings[1],
 	&_af_default_signed_integer_pcm_mappings[2],
diff -ur audiofile-0.2.6-orig/libaudiofile/next.c audiofile-0.2.6-mine/libaudiofile/next.c
--- audiofile-0.2.6-orig/libaudiofile/next.c	2004-03-06 01:39:23.000000000 -0500
+++ audiofile-0.2.6-mine/libaudiofile/next.c	2006-03-22 02:15:59.742911250 -0500
@@ -47,7 +47,7 @@
 #include "setup.h"
 #include "byteorder.h"
 
-int _af_next_compression_types[_AF_NEXT_NUM_COMPTYPES] =
+const int _af_next_compression_types[_AF_NEXT_NUM_COMPTYPES] =
 {
 	AF_COMPRESSION_G711_ULAW,
 	AF_COMPRESSION_G711_ALAW
diff -ur audiofile-0.2.6-orig/libaudiofile/openclose.c audiofile-0.2.6-mine/libaudiofile/openclose.c
--- audiofile-0.2.6-orig/libaudiofile/openclose.c	2004-03-06 01:39:23.000000000 -0500
+++ audiofile-0.2.6-mine/libaudiofile/openclose.c	2006-03-22 01:55:33.067547750 -0500
@@ -45,7 +45,7 @@
 #define SETBINARYMODE(x)
 #endif /* WIN32 || __CYGWIN__ */
 
-extern _Unit _af_units[];
+extern const _Unit _af_units[];
 
 static void freeFileHandle (AFfilehandle filehandle);
 static void freeInstParams (AFPVu *values, int fileFormat);
diff -ur audiofile-0.2.6-orig/libaudiofile/pcm.c audiofile-0.2.6-mine/libaudiofile/pcm.c
--- audiofile-0.2.6-orig/libaudiofile/pcm.c	2004-03-06 01:39:23.000000000 -0500
+++ audiofile-0.2.6-mine/libaudiofile/pcm.c	2006-03-21 22:56:53.581395000 -0500
@@ -33,7 +33,7 @@
 #include "pcm.h"
 #include "util.h"
 
-_PCMInfo _af_default_signed_integer_pcm_mappings[] =
+const _PCMInfo _af_default_signed_integer_pcm_mappings[] =
 {
 	{0, 0, 0, 0},
 	{SLOPE_INT8, 0, MIN_INT8, MAX_INT8},
@@ -42,7 +42,7 @@
 	{SLOPE_INT32, 0, MIN_INT32, MAX_INT32}
 };
 
-_PCMInfo _af_default_unsigned_integer_pcm_mappings[] =
+const _PCMInfo _af_default_unsigned_integer_pcm_mappings[] =
 {
 	{0, 0, 0, 0},
 	{SLOPE_INT8, INTERCEPT_U_INT8, 0, MAX_U_INT8},
@@ -51,10 +51,10 @@
 	{SLOPE_INT32, INTERCEPT_U_INT32, 0, MAX_U_INT32}
 };
 
-_PCMInfo _af_default_float_pcm_mapping =
+const _PCMInfo _af_default_float_pcm_mapping =
 {1, 0, 0, 0};
 
-_PCMInfo _af_default_double_pcm_mapping =
+const _PCMInfo _af_default_double_pcm_mapping =
 {1, 0, 0, 0};
 
 /*
diff -ur audiofile-0.2.6-orig/libaudiofile/query.c audiofile-0.2.6-mine/libaudiofile/query.c
--- audiofile-0.2.6-orig/libaudiofile/query.c	2004-03-06 01:39:23.000000000 -0500
+++ audiofile-0.2.6-mine/libaudiofile/query.c	2006-03-22 01:55:23.070923000 -0500
@@ -43,8 +43,8 @@
 #include "compression.h"
 #include "instrument.h"
 
-extern _Unit _af_units[];
-extern _CompressionUnit _af_compression[];
+extern const _Unit _af_units[];
+extern const _CompressionUnit _af_compression[];
 
 AUpvlist _afQueryFileFormat (int arg1, int arg2, int arg3, int arg4);
 AUpvlist _afQueryInstrument (int arg1, int arg2, int arg3, int arg4);
diff -ur audiofile-0.2.6-orig/libaudiofile/raw.c audiofile-0.2.6-mine/libaudiofile/raw.c
--- audiofile-0.2.6-orig/libaudiofile/raw.c	2004-03-06 01:39:23.000000000 -0500
+++ audiofile-0.2.6-mine/libaudiofile/raw.c	2006-03-22 02:16:08.563462500 -0500
@@ -50,7 +50,7 @@
 	NULL			/* miscellaneous */
 };
 
-int _af_raw_compression_types[_AF_RAW_NUM_COMPTYPES] =
+const int _af_raw_compression_types[_AF_RAW_NUM_COMPTYPES] =
 {
 	AF_COMPRESSION_G711_ULAW,
 	AF_COMPRESSION_G711_ALAW
diff -ur audiofile-0.2.6-orig/libaudiofile/setup.c audiofile-0.2.6-mine/libaudiofile/setup.c
--- audiofile-0.2.6-orig/libaudiofile/setup.c	2004-03-06 01:39:23.000000000 -0500
+++ audiofile-0.2.6-mine/libaudiofile/setup.c	2006-03-22 02:16:14.567837750 -0500
@@ -39,7 +39,7 @@
 
 extern _Unit _af_units[];
 
-_AFfilesetup _af_default_file_setup =
+const _AFfilesetup _af_default_file_setup =
 {
 	_AF_VALID_FILESETUP,	/* valid */
 #if WORDS_BIGENDIAN
@@ -58,7 +58,7 @@
 	NULL		/* miscellaneous */
 };
 
-_InstrumentSetup _af_default_instrumentsetup =
+const _InstrumentSetup _af_default_instrumentsetup =
 {
 	0,		/* id */
 	2,		/* loopCount */
@@ -66,7 +66,7 @@
 	AF_FALSE	/* loopSet */
 };
 
-_TrackSetup _af_default_tracksetup =
+const _TrackSetup _af_default_tracksetup =
 {
 	0,
 	{
diff -ur audiofile-0.2.6-orig/libaudiofile/units.c audiofile-0.2.6-mine/libaudiofile/units.c
--- audiofile-0.2.6-orig/libaudiofile/units.c	2004-03-06 01:39:23.000000000 -0500
+++ audiofile-0.2.6-mine/libaudiofile/units.c	2006-03-22 02:02:12.335201500 -0500
@@ -56,7 +56,7 @@
 extern int _af_next_compression_types[];
 extern int _af_wave_compression_types[];
 
-_Unit _af_units[_AF_NUM_UNITS] =
+const _Unit _af_units[_AF_NUM_UNITS] =
 {
 	{
 		AF_FILE_RAWDATA,
@@ -221,7 +221,7 @@
 	}
 };
 
-_CompressionUnit _af_compression[_AF_NUM_COMPRESSION] =
+const _CompressionUnit _af_compression[_AF_NUM_COMPRESSION] =
 {
 	{
 		AF_COMPRESSION_NONE,
diff -ur audiofile-0.2.6-orig/libaudiofile/util.c audiofile-0.2.6-mine/libaudiofile/util.c
--- audiofile-0.2.6-orig/libaudiofile/util.c	2004-03-06 01:39:23.000000000 -0500
+++ audiofile-0.2.6-mine/libaudiofile/util.c	2006-03-22 01:54:41.944352750 -0500
@@ -46,12 +46,12 @@
 #include "byteorder.h"
 #include "aupvinternal.h"
 
-extern _PCMInfo _af_default_signed_integer_pcm_mappings[];
-extern _PCMInfo _af_default_unsigned_integer_pcm_mappings[];
-extern _PCMInfo _af_default_float_pcm_mapping;
-extern _PCMInfo _af_default_double_pcm_mapping;
+extern const _PCMInfo _af_default_signed_integer_pcm_mappings[];
+extern const _PCMInfo _af_default_unsigned_integer_pcm_mappings[];
+extern const _PCMInfo _af_default_float_pcm_mapping;
+extern const _PCMInfo _af_default_double_pcm_mapping;
 
-extern _CompressionUnit _af_compression[];
+extern const _CompressionUnit _af_compression[];
 
 /*
 	_af_filesetup_ok and _af_filehandle_ok are sanity check routines
diff -ur audiofile-0.2.6-orig/libaudiofile/wave.c audiofile-0.2.6-mine/libaudiofile/wave.c
--- audiofile-0.2.6-orig/libaudiofile/wave.c	2004-03-06 01:39:23.000000000 -0500
+++ audiofile-0.2.6-mine/libaudiofile/wave.c	2006-03-22 02:16:29.568775250 -0500
@@ -49,13 +49,13 @@
 #include "setup.h"
 #include "marker.h"
 
-int _af_wave_compression_types[_AF_WAVE_NUM_COMPTYPES] =
+const int _af_wave_compression_types[_AF_WAVE_NUM_COMPTYPES] =
 {
 	AF_COMPRESSION_G711_ULAW,
 	AF_COMPRESSION_G711_ALAW
 };
 
-_InstParamInfo _af_wave_inst_params[_AF_WAVE_NUM_INSTPARAMS] =
+const _InstParamInfo _af_wave_inst_params[_AF_WAVE_NUM_INSTPARAMS] =
 {
 	{ AF_INST_MIDI_BASENOTE, AU_PVTYPE_LONG, "MIDI base note", {60} },
 	{ AF_INST_NUMCENTS_DETUNE, AU_PVTYPE_LONG, "Detune in cents", {0} },