summarylogtreecommitdiffstats
path: root/0001-Search-replace-of-extern-inline-static-inline.patch
blob: a8373b795636e84c17cac1abf031249060fedb21 (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
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
From 0f3a32b23c90a36f67683e7215d5b7e503eed2c5 Mon Sep 17 00:00:00 2001
From: Christian Vogel <vogelchr@vogel.cx>
Date: Sun, 24 May 2015 12:07:13 +0200
Subject: [PATCH] Search/replace of extern inline -> static inline.

Inline functions in header files are declared as 'extern inline'
which makes the compiler also emit a externally visible version
of the function. This gives us "multiple definition of..." errors
during compile.
---
 newqpsk/complex.h     | 14 +++++++-------
 newqpsk/fec.h         |  4 ++--
 newqpsk/filter-i386.h |  2 +-
 newqpsk/filter.h      |  2 +-
 newqpsk/genfilt.c     |  2 +-
 newqpsk/misc.h        | 18 +++++++++---------
 p3dmodem/genp3dtbl.c  |  2 +-
 pammodem/genpamtbl.c  |  2 +-
 pammodem/meas.c       |  2 +-
 pammodem/pammodem.c   |  4 ++--
 pskmodem/genpsktbl.c  |  2 +-
 pskmodem/measpsk.c    |  2 +-
 pskmodem/pskmlse.c    |  4 ++--
 pskmodem/pskmodem.c   |  2 +-
 soundcard/modem.h     |  2 +-
 soundcard/simd.h      | 18 +++++++++---------
 16 files changed, 41 insertions(+), 41 deletions(-)

diff --git a/newqpsk/complex.h b/newqpsk/complex.h
index 2353865..586572c 100644
--- a/newqpsk/complex.h
+++ b/newqpsk/complex.h
@@ -13,7 +13,7 @@ typedef struct {
 /*
  * Complex multiplication.
  */
-extern __inline__ complex cmul(complex x, complex y)
+static inline complex cmul(complex x, complex y)
 {
 	complex z;
 
@@ -27,7 +27,7 @@ extern __inline__ complex cmul(complex x, complex y)
  * Complex ... yeah, what??? Returns a complex number that has the
  * properties: |z| = |x| * |y|  and  arg(z) = arg(y) - arg(x)
  */
-extern __inline__ complex ccor(complex x, complex y)
+static inline complex ccor(complex x, complex y)
 {
 	complex z;
 
@@ -40,7 +40,7 @@ extern __inline__ complex ccor(complex x, complex y)
 /*
  * Real part of the complex ???
  */
-extern __inline__ float ccorI(complex x, complex y)
+static inline float ccorI(complex x, complex y)
 {
 	return x.re * y.re + x.im * y.im;
 }
@@ -48,7 +48,7 @@ extern __inline__ float ccorI(complex x, complex y)
 /*
  * Imaginary part of the complex ???
  */
-extern __inline__ float ccorQ(complex x, complex y)
+static inline float ccorQ(complex x, complex y)
 {
 	return x.re * y.im - x.im * y.re;
 }
@@ -56,7 +56,7 @@ extern __inline__ float ccorQ(complex x, complex y)
 /*
  * Modulo (absolute value) of a complex number.
  */
-extern __inline__ float cmod(complex x)
+static inline float cmod(complex x)
 {
 	return sqrt(x.re * x.re + x.im * x.im);
 }
@@ -64,7 +64,7 @@ extern __inline__ float cmod(complex x)
 /*
  * Square of the absolute value (power).
  */
-extern __inline__ float cpwr(complex x)
+static inline float cpwr(complex x)
 {
 	return (x.re * x.re + x.im * x.im);
 }
@@ -72,7 +72,7 @@ extern __inline__ float cpwr(complex x)
 /*
  * Argument of a complex number.
  */
-extern __inline__ float carg(complex x)
+static inline float carg(complex x)
 {
 	return atan2(x.im, x.re);
 }
diff --git a/newqpsk/fec.h b/newqpsk/fec.h
index 109ad51..409daf1 100644
--- a/newqpsk/fec.h
+++ b/newqpsk/fec.h
@@ -13,7 +13,7 @@ struct fecstate {
 
 /* --------------------------------------------------------------------- */
 
-extern inline void init_fec(struct fecstate *f)
+static inline void init_fec(struct fecstate *f)
 {
 	switch (f->feclevel) {
 	case 0:
@@ -33,7 +33,7 @@ extern inline void init_fec(struct fecstate *f)
 
 /* --------------------------------------------------------------------- */
 
-extern inline void init_inlv(struct fecstate *f)
+static inline void init_inlv(struct fecstate *f)
 {
         int i;
 
diff --git a/newqpsk/filter-i386.h b/newqpsk/filter-i386.h
index 01b3f5d..d881b2c 100644
--- a/newqpsk/filter-i386.h
+++ b/newqpsk/filter-i386.h
@@ -1,7 +1,7 @@
 #ifndef _FILTER_I386_H
 #define _FILTER_I386_H
 #define __HAVE_ARCH_MAC
-extern inline float mac(const float *a, const float *b, unsigned int size)
+static inline float mac(const float *a, const float *b, unsigned int size)
 {
 	float f;
 	asm volatile (
diff --git a/newqpsk/filter.h b/newqpsk/filter.h
index ae789fc..754811e 100644
--- a/newqpsk/filter.h
+++ b/newqpsk/filter.h
@@ -12,7 +12,7 @@
 /* ---------------------------------------------------------------------- */
 
 #ifndef __HAVE_ARCH_MAC
-extern inline float mac(const float *a, const float *b, unsigned int size)
+static inline float mac(const float *a, const float *b, unsigned int size)
 {
 	float sum = 0;
 	unsigned int i;
diff --git a/newqpsk/genfilt.c b/newqpsk/genfilt.c
index a2eb077..5aec7bf 100644
--- a/newqpsk/genfilt.c
+++ b/newqpsk/genfilt.c
@@ -18,7 +18,7 @@ int main(int argc, char **argv)
 	puts("#define _FILTER_I386_H");
 	puts("#define __HAVE_ARCH_MAC");
 
-	puts("extern inline float mac(const float *a, const float *b, unsigned int size)");
+	puts("static inline float mac(const float *a, const float *b, unsigned int size)");
 	puts("{");
 	puts("\tfloat f;");
 	puts("\tasm volatile (");
diff --git a/newqpsk/misc.h b/newqpsk/misc.h
index aa3dfc5..e80301d 100644
--- a/newqpsk/misc.h
+++ b/newqpsk/misc.h
@@ -10,7 +10,7 @@
 /*
  * Hamming weight (number of bits that are ones).
  */
-extern inline unsigned int hweight32(unsigned int w) 
+static inline unsigned int hweight32(unsigned int w) 
 {
 	w = (w & 0x55555555) + ((w >>  1) & 0x55555555);
 	w = (w & 0x33333333) + ((w >>  2) & 0x33333333);
@@ -20,7 +20,7 @@ extern inline unsigned int hweight32(unsigned int w)
 	return w;
 }
 
-extern inline unsigned int hweight16(unsigned short w)
+static inline unsigned int hweight16(unsigned short w)
 {
 	w = (w & 0x5555) + ((w >> 1) & 0x5555);
 	w = (w & 0x3333) + ((w >> 2) & 0x3333);
@@ -29,7 +29,7 @@ extern inline unsigned int hweight16(unsigned short w)
 	return w;
 }
 
-extern inline unsigned int hweight8(unsigned char w)
+static inline unsigned int hweight8(unsigned char w)
 {
 	w = (w & 0x55) + ((w >> 1) & 0x55);
 	w = (w & 0x33) + ((w >> 2) & 0x33);
@@ -42,7 +42,7 @@ extern inline unsigned int hweight8(unsigned char w)
 /*
  * Reverse order of bits.
  */
-extern inline unsigned int rbits32(unsigned int w)
+static inline unsigned int rbits32(unsigned int w)
 {
 	w = ((w >>  1) & 0x55555555) | ((w <<  1) & 0xaaaaaaaa);
 	w = ((w >>  2) & 0x33333333) | ((w <<  2) & 0xcccccccc);
@@ -52,7 +52,7 @@ extern inline unsigned int rbits32(unsigned int w)
 	return w;
 }
 
-extern inline unsigned short rbits16(unsigned short w)
+static inline unsigned short rbits16(unsigned short w)
 {
 	w = ((w >> 1) & 0x5555) | ((w << 1) & 0xaaaa);
 	w = ((w >> 2) & 0x3333) | ((w << 2) & 0xcccc);
@@ -61,7 +61,7 @@ extern inline unsigned short rbits16(unsigned short w)
 	return w;
 }
 
-extern inline unsigned char rbits8(unsigned char w)
+static inline unsigned char rbits8(unsigned char w)
 {
 	w = ((w >> 1) & 0x55) | ((w << 1) & 0xaa);
 	w = ((w >> 2) & 0x33) | ((w << 2) & 0xcc);
@@ -71,7 +71,7 @@ extern inline unsigned char rbits8(unsigned char w)
 
 /* ---------------------------------------------------------------------- */
 
-extern inline float avg(float average, float input, int scale)
+static inline float avg(float average, float input, int scale)
 {
 	int i;
 
@@ -82,12 +82,12 @@ extern inline float avg(float average, float input, int scale)
 	return (average + input);
 }
 
-extern inline float avg2(float average, float input, float weight)
+static inline float avg2(float average, float input, float weight)
 {
 	return input * weight + average * (1.0 - weight);
 }
 
-extern inline float phaseavg(float *data, int len)
+static inline float phaseavg(float *data, int len)
 {
 	float sum = 0.0;
 	float min = M_PI;
diff --git a/p3dmodem/genp3dtbl.c b/p3dmodem/genp3dtbl.c
index 4d8fbd5..2360995 100644
--- a/p3dmodem/genp3dtbl.c
+++ b/p3dmodem/genp3dtbl.c
@@ -41,7 +41,7 @@
 
 /* ---------------------------------------------------------------------- */
 
-extern inline unsigned int hweight32(unsigned int w)
+static inline unsigned int hweight32(unsigned int w)
 {
         unsigned int res = (w & 0x55555555) + ((w >> 1) & 0x55555555);
         res = (res & 0x33333333) + ((res >> 2) & 0x33333333);
diff --git a/pammodem/genpamtbl.c b/pammodem/genpamtbl.c
index a466f4d..2b00253 100644
--- a/pammodem/genpamtbl.c
+++ b/pammodem/genpamtbl.c
@@ -104,7 +104,7 @@
 
 /* ---------------------------------------------------------------------- */
 
-extern __inline__ unsigned int hweight32(unsigned int w)
+static inline unsigned int hweight32(unsigned int w)
 {
         unsigned int res = (w & 0x55555555) + ((w >> 1) & 0x55555555);
         res = (res & 0x33333333) + ((res >> 2) & 0x33333333);
diff --git a/pammodem/meas.c b/pammodem/meas.c
index 5c2b61a..609e681 100644
--- a/pammodem/meas.c
+++ b/pammodem/meas.c
@@ -240,7 +240,7 @@ int sound_init(int sample_rate, int *sr)
 
 /* ---------------------------------------------------------------------- */
 
-extern __inline__ unsigned int hweight32(unsigned int w)
+static inline unsigned int hweight32(unsigned int w)
 {
         unsigned int res = (w & 0x55555555) + ((w >> 1) & 0x55555555);
         res = (res & 0x33333333) + ((res >> 2) & 0x33333333);
diff --git a/pammodem/pammodem.c b/pammodem/pammodem.c
index 92077a3..c4afc40 100644
--- a/pammodem/pammodem.c
+++ b/pammodem/pammodem.c
@@ -160,7 +160,7 @@ struct rxstate {
 	unsigned int rxptr;
 };
 
-extern inline int rxgsfir(const int16_t *buf, const int *coeff)
+static inline int rxgsfir(const int16_t *buf, const int *coeff)
 {
 	unsigned int i;
 	int s;
@@ -207,7 +207,7 @@ static void rxrewindsamples(struct rxstate *rx, unsigned int nr, unsigned int ts
 	rx->rxphase -= ph;
 }
 
-extern inline int calcsync(int *toten, int *corren, int16_t *samples)
+static inline int calcsync(int *toten, int *corren, int16_t *samples)
 {
 	const int *tr = trainsyms;
 	unsigned int i;
diff --git a/pskmodem/genpsktbl.c b/pskmodem/genpsktbl.c
index 9612bc9..e8dd07d 100644
--- a/pskmodem/genpsktbl.c
+++ b/pskmodem/genpsktbl.c
@@ -106,7 +106,7 @@
 
 /* ---------------------------------------------------------------------- */
 
-extern __inline__ unsigned int hweight32(unsigned int w)
+static inline unsigned int hweight32(unsigned int w)
 {
         unsigned int res = (w & 0x55555555) + ((w >> 1) & 0x55555555);
         res = (res & 0x33333333) + ((res >> 2) & 0x33333333);
diff --git a/pskmodem/measpsk.c b/pskmodem/measpsk.c
index 88e0e36..d0a23de 100644
--- a/pskmodem/measpsk.c
+++ b/pskmodem/measpsk.c
@@ -271,7 +271,7 @@ int sound_init(int sample_rate, int *sr)
 
 /* ---------------------------------------------------------------------- */
 
-extern __inline__ unsigned int hweight32(unsigned int w)
+static inline unsigned int hweight32(unsigned int w)
 {
         unsigned int res = (w & 0x55555555) + ((w >> 1) & 0x55555555);
         res = (res & 0x33333333) + ((res >> 2) & 0x33333333);
diff --git a/pskmodem/pskmlse.c b/pskmodem/pskmlse.c
index 6fd1561..1649467 100644
--- a/pskmodem/pskmlse.c
+++ b/pskmodem/pskmlse.c
@@ -493,7 +493,7 @@ static void simdtrellis(unsigned int *nodemetric1, unsigned int *nodemetric2, un
 
 #else
 
-extern inline void simdtrellis(unsigned int *nodemetric1, unsigned int *nodemetric2, unsigned int *metrictab, unsigned short *backptr, int vr, int vi)
+static inline void simdtrellis(unsigned int *nodemetric1, unsigned int *nodemetric2, unsigned int *metrictab, unsigned short *backptr, int vr, int vi)
 {
 }
 
@@ -582,7 +582,7 @@ static void simdinitmetric(const cplxshort_t *channel, metrictab_t *metrictab)
 
 #else
 
-extern inline void simdinitmetric(const cplxshort_t *channel, metrictab_t *metrictab)
+static inline void simdinitmetric(const cplxshort_t *channel, metrictab_t *metrictab)
 {
 }
 
diff --git a/pskmodem/pskmodem.c b/pskmodem/pskmodem.c
index ffb1668..4161bc2 100644
--- a/pskmodem/pskmodem.c
+++ b/pskmodem/pskmodem.c
@@ -262,7 +262,7 @@ static void rxrotate(cplxshort_t *ptr, unsigned int nr, unsigned int carphase, u
 	}
 }
 
-extern inline int calcsync(int *toten, int *corren, cplxshort_t *samples)
+static inline int calcsync(int *toten, int *corren, cplxshort_t *samples)
 {
 	const cplxshort_t *tr = traincorrrotated;
 	unsigned int i;
diff --git a/soundcard/modem.h b/soundcard/modem.h
index b8c3a5f..375d07d 100644
--- a/soundcard/modem.h
+++ b/soundcard/modem.h
@@ -103,7 +103,7 @@ extern void logvprintf(unsigned int level, const char *fmt, va_list args);
 extern void logprintf(unsigned int level, const char *fmt, ...);
 extern void logerr(unsigned int level, const char *st);
 extern unsigned int log_verblevel;
-extern inline int logcheck(unsigned int vl)
+static inline int logcheck(unsigned int vl)
 {
 	return vl <= log_verblevel;
 }
diff --git a/soundcard/simd.h b/soundcard/simd.h
index 6b6ab3b..e49bdd7 100644
--- a/soundcard/simd.h
+++ b/soundcard/simd.h
@@ -54,16 +54,16 @@
 
 #if !defined(USEMMX) && !defined(USEVIS)
 
-extern inline void initsimd(int enable)
+static inline void initsimd(int enable)
 {
 }
 
-extern inline int checksimd(void)
+static inline int checksimd(void)
 {
 	return 0;
 }
 
-extern inline int simdfir16(const int16_t *p1, const int16_t *p2, unsigned int nr)
+static inline int simdfir16(const int16_t *p1, const int16_t *p2, unsigned int nr)
 {
 	int s = 0;
 
@@ -72,7 +72,7 @@ extern inline int simdfir16(const int16_t *p1, const int16_t *p2, unsigned int n
 	return s;
 }
 
-extern inline void simdpreparefpu(void)
+static inline void simdpreparefpu(void)
 {
 }
 
@@ -82,7 +82,7 @@ extern unsigned int simd_enabled;
 
 extern void initsimd(int enable);
 
-extern inline int checksimd(void)
+static inline int checksimd(void)
 {
 	return simd_enabled;
 }
@@ -91,7 +91,7 @@ extern inline int checksimd(void)
 
 #define MMXCLOBBER "st", "st(1)", "st(2)", "st(3)", "st(4)", "st(5)", "st(6)", "st(7)"
 
-extern inline int simdfir16(const int16_t *p1, const int16_t *p2, unsigned int nr)
+static inline int simdfir16(const int16_t *p1, const int16_t *p2, unsigned int nr)
 {
 	unsigned int i, j;
 	int s = 0;
@@ -114,7 +114,7 @@ extern inline int simdfir16(const int16_t *p1, const int16_t *p2, unsigned int n
 	return s;
 }
 
-extern inline void simdpreparefpu(void)
+static inline void simdpreparefpu(void)
 {
 	if (checksimd())
 		asm volatile("emms");
@@ -122,7 +122,7 @@ extern inline void simdpreparefpu(void)
 
 #elif defined(USEVIS)
 
-/*extern inline*/static int simdfir16(const int16_t *p1, const int16_t *p2, unsigned int nr)
+/*static inline*/static int simdfir16(const int16_t *p1, const int16_t *p2, unsigned int nr)
 {
 	double dsum1, dsum2, dsum3, dsum4, arg1, arg2, arg3, arg4;
 	float sum, sum1, sum2;
@@ -157,7 +157,7 @@ extern inline void simdpreparefpu(void)
 	return s;
 }
 
-extern inline void simdpreparefpu(void)
+static inline void simdpreparefpu(void)
 {
 }
 
-- 
2.4.1