Skip to content

Commit dafebd6

Browse files
committed
stagefright amrnb: Remove extern from table definitions
Local prototype declarations are added where no suitable ones are available in headers. This fixes warnings when compiling as C - while the source files are named .cpp, they actually are compileable as pure C. This was committed on the master branch of the opencore repository in commit a0acb494ea6682ca966b5ebbd3676c89c56d63a6, based on AOSP contribution 10303. Change-Id: Ib4e27ea30302c66e0233e63e5a4652f6339bc940
1 parent 9cb864d commit dafebd6

24 files changed

+73
-62
lines changed

media/libstagefright/codecs/amrnb/common/src/bitno_tab.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ extern "C"
152152
; Variable declaration - defined here and used outside this module
153153
----------------------------------------------------------------------------*/
154154
/* number of parameters per modes (values must be <= MAX_PRM_SIZE!) */
155-
extern const Word16 prmno[N_MODES] =
155+
const Word16 prmno[N_MODES] =
156156
{
157157
PRMNO_MR475,
158158
PRMNO_MR515,
@@ -166,7 +166,7 @@ extern "C"
166166
};
167167

168168
/* number of parameters to first subframe per modes */
169-
extern const Word16 prmnofsf[N_MODES - 1] =
169+
const Word16 prmnofsf[N_MODES - 1] =
170170
{
171171
PRMNOFSF_MR475,
172172
PRMNOFSF_MR515,
@@ -179,7 +179,7 @@ extern "C"
179179
};
180180

181181
/* parameter sizes (# of bits), one table per mode */
182-
extern const Word16 bitno_MR475[PRMNO_MR475] =
182+
const Word16 bitno_MR475[PRMNO_MR475] =
183183
{
184184
8, 8, 7, /* LSP VQ */
185185
8, 7, 2, 8, /* first subframe */
@@ -188,7 +188,7 @@ extern "C"
188188
4, 7, 2, /* fourth subframe */
189189
};
190190

191-
extern const Word16 bitno_MR515[PRMNO_MR515] =
191+
const Word16 bitno_MR515[PRMNO_MR515] =
192192
{
193193
8, 8, 7, /* LSP VQ */
194194
8, 7, 2, 6, /* first subframe */
@@ -197,7 +197,7 @@ extern "C"
197197
4, 7, 2, 6, /* fourth subframe */
198198
};
199199

200-
extern const Word16 bitno_MR59[PRMNO_MR59] =
200+
const Word16 bitno_MR59[PRMNO_MR59] =
201201
{
202202
8, 9, 9, /* LSP VQ */
203203
8, 9, 2, 6, /* first subframe */
@@ -206,7 +206,7 @@ extern "C"
206206
4, 9, 2, 6, /* fourth subframe */
207207
};
208208

209-
extern const Word16 bitno_MR67[PRMNO_MR67] =
209+
const Word16 bitno_MR67[PRMNO_MR67] =
210210
{
211211
8, 9, 9, /* LSP VQ */
212212
8, 11, 3, 7, /* first subframe */
@@ -215,7 +215,7 @@ extern "C"
215215
4, 11, 3, 7, /* fourth subframe */
216216
};
217217

218-
extern const Word16 bitno_MR74[PRMNO_MR74] =
218+
const Word16 bitno_MR74[PRMNO_MR74] =
219219
{
220220
8, 9, 9, /* LSP VQ */
221221
8, 13, 4, 7, /* first subframe */
@@ -224,7 +224,7 @@ extern "C"
224224
5, 13, 4, 7, /* fourth subframe */
225225
};
226226

227-
extern const Word16 bitno_MR795[PRMNO_MR795] =
227+
const Word16 bitno_MR795[PRMNO_MR795] =
228228
{
229229
9, 9, 9, /* LSP VQ */
230230
8, 13, 4, 4, 5, /* first subframe */
@@ -233,7 +233,7 @@ extern "C"
233233
6, 13, 4, 4, 5, /* fourth subframe */
234234
};
235235

236-
extern const Word16 bitno_MR102[PRMNO_MR102] =
236+
const Word16 bitno_MR102[PRMNO_MR102] =
237237
{
238238
8, 9, 9, /* LSP VQ */
239239
8, 1, 1, 1, 1, 10, 10, 7, 7, /* first subframe */
@@ -242,7 +242,7 @@ extern "C"
242242
5, 1, 1, 1, 1, 10, 10, 7, 7, /* fourth subframe */
243243
};
244244

245-
extern const Word16 bitno_MR122[PRMNO_MR122] =
245+
const Word16 bitno_MR122[PRMNO_MR122] =
246246
{
247247
7, 8, 9, 8, 6, /* LSP VQ */
248248
9, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 5, /* first subframe */
@@ -251,15 +251,15 @@ extern "C"
251251
6, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 5 /* fourth subframe */
252252
};
253253

254-
extern const Word16 bitno_MRDTX[PRMNO_MRDTX] =
254+
const Word16 bitno_MRDTX[PRMNO_MRDTX] =
255255
{
256256
3,
257257
8, 9, 9,
258258
6
259259
};
260260

261261
/* overall table with all parameter sizes for all modes */
262-
extern const Word16 * const bitno[N_MODES] =
262+
const Word16 * const bitno[N_MODES] =
263263
{
264264
bitno_MR475,
265265
bitno_MR515,

media/libstagefright/codecs/amrnb/common/src/bitreorder_tab.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ extern "C"
172172
; Variable declaration - defined here and used outside this module
173173
----------------------------------------------------------------------------*/
174174
/* number of parameters per modes (values must be <= MAX_PRM_SIZE!) */
175-
extern const Word16 numOfBits[NUM_MODES] =
175+
const Word16 numOfBits[NUM_MODES] =
176176
{
177177
NUMBIT_MR475,
178178
NUMBIT_MR515,
@@ -192,7 +192,7 @@ extern "C"
192192
NUMBIT_NO_DATA
193193
};
194194

195-
extern const Word16 reorderBits_MR475[NUMBIT_MR475] =
195+
const Word16 reorderBits_MR475[NUMBIT_MR475] =
196196
{
197197
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
198198
10, 11, 12, 13, 14, 15, 23, 24, 25, 26,
@@ -206,7 +206,7 @@ extern "C"
206206
92, 31, 52, 65, 86
207207
};
208208

209-
extern const Word16 reorderBits_MR515[NUMBIT_MR515] =
209+
const Word16 reorderBits_MR515[NUMBIT_MR515] =
210210
{
211211
7, 6, 5, 4, 3, 2, 1, 0, 15, 14,
212212
13, 12, 11, 10, 9, 8, 23, 24, 25, 26,
@@ -221,7 +221,7 @@ extern "C"
221221
53, 72, 91
222222
};
223223

224-
extern const Word16 reorderBits_MR59[NUMBIT_MR59] =
224+
const Word16 reorderBits_MR59[NUMBIT_MR59] =
225225
{
226226
0, 1, 4, 5, 3, 6, 7, 2, 13, 15,
227227
8, 9, 11, 12, 14, 10, 16, 28, 74, 29,
@@ -237,7 +237,7 @@ extern "C"
237237
38, 59, 84, 105, 37, 58, 83, 104
238238
};
239239

240-
extern const Word16 reorderBits_MR67[NUMBIT_MR67] =
240+
const Word16 reorderBits_MR67[NUMBIT_MR67] =
241241
{
242242
0, 1, 4, 3, 5, 6, 13, 7, 2, 8,
243243
9, 11, 15, 12, 14, 10, 28, 82, 29, 83,
@@ -255,7 +255,7 @@ extern "C"
255255
36, 61, 90, 115
256256
};
257257

258-
extern const Word16 reorderBits_MR74[NUMBIT_MR74] =
258+
const Word16 reorderBits_MR74[NUMBIT_MR74] =
259259
{
260260
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
261261
10, 11, 12, 13, 14, 15, 16, 26, 87, 27,
@@ -274,7 +274,7 @@ extern "C"
274274
39, 68, 100, 129, 40, 69, 101, 130
275275
};
276276

277-
extern const Word16 reorderBits_MR795[NUMBIT_MR795] =
277+
const Word16 reorderBits_MR795[NUMBIT_MR795] =
278278
{
279279
8, 7, 6, 5, 4, 3, 2, 14, 16, 9,
280280
10, 12, 13, 15, 11, 17, 20, 22, 24, 23,
@@ -294,7 +294,7 @@ extern "C"
294294
139, 37, 69, 103, 135, 38, 70, 104, 136
295295
};
296296

297-
extern const Word16 reorderBits_MR102[NUMBIT_MR102] =
297+
const Word16 reorderBits_MR102[NUMBIT_MR102] =
298298
{
299299
7, 6, 5, 4, 3, 2, 1, 0, 16, 15,
300300
14, 13, 12, 11, 10, 9, 8, 26, 27, 28,
@@ -319,7 +319,7 @@ extern "C"
319319
63, 46, 55, 56
320320
};
321321

322-
extern const Word16 reorderBits_MR122[NUMBIT_MR122] =
322+
const Word16 reorderBits_MR122[NUMBIT_MR122] =
323323
{
324324
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
325325
10, 11, 12, 13, 14, 23, 15, 16, 17, 18,
@@ -349,7 +349,7 @@ extern "C"
349349
};
350350

351351
/* overall table with all parameter sizes for all modes */
352-
extern const Word16 * const reorderBits[NUM_MODES-1] =
352+
const Word16 * const reorderBits[NUM_MODES-1] =
353353
{
354354
reorderBits_MR475,
355355
reorderBits_MR515,
@@ -362,7 +362,7 @@ extern "C"
362362
};
363363

364364
/* Number of Frames (16-bit segments sent for each mode */
365-
extern const Word16 numCompressedBytes[16] =
365+
const Word16 numCompressedBytes[16] =
366366
{
367367
13, /*4.75*/
368368
14, /*5.15*/

media/libstagefright/codecs/amrnb/common/src/bytesused.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ extern "C"
152152
; LOCAL STORE/BUFFER/POINTER DEFINITIONS
153153
; Variable declaration - defined here and used outside this module
154154
----------------------------------------------------------------------------*/
155-
extern const short BytesUsed[16] =
155+
const short BytesUsed[16] =
156156
{
157157
13, /* 4.75 */
158158
14, /* 5.15 */

media/libstagefright/codecs/amrnb/common/src/c2_9pf_tab.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ extern "C"
8686
; LOCAL VARIABLE DEFINITIONS
8787
; [Variable declaration - defined here and used outside this module]
8888
----------------------------------------------------------------------------*/
89-
extern const Word16 startPos[2*4*2] = {0, 2, 0, 3,
89+
extern const Word16 startPos[];
90+
const Word16 startPos[2*4*2] = {0, 2, 0, 3,
9091
0, 2, 0, 3,
9192
1, 3, 2, 4,
9293
1, 4, 1, 4

media/libstagefright/codecs/amrnb/common/src/gains_tbl.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,16 @@ extern "C"
8686
----------------------------------------------------------------------------*/
8787

8888

89-
extern const Word16 qua_gain_pitch[NB_QUA_PITCH] =
89+
extern const Word16 qua_gain_pitch[];
90+
const Word16 qua_gain_pitch[NB_QUA_PITCH] =
9091
{
9192
0, 3277, 6556, 8192, 9830, 11469, 12288, 13107,
9293
13926, 14746, 15565, 16384, 17203, 18022, 18842, 19661
9394
};
9495

9596

96-
extern const Word16 qua_gain_code[(NB_QUA_CODE+1)*3] =
97+
extern const Word16 qua_gain_code[];
98+
const Word16 qua_gain_code[(NB_QUA_CODE+1)*3] =
9799
{
98100
/* gain factor (g_fac) and quantized energy error (qua_ener_MR122, qua_ener)
99101
* are stored:

media/libstagefright/codecs/amrnb/common/src/gray_tbl.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,10 @@ extern "C"
8383
; [Variable declaration - defined here and used outside this module]
8484
----------------------------------------------------------------------------*/
8585

86-
extern const Word16 gray[8] = {0, 1, 3, 2, 6, 4, 5, 7};
87-
extern const Word16 dgray[8] = {0, 1, 3, 2, 5, 6, 4, 7};
86+
extern const Word16 gray[];
87+
extern const Word16 dgray[];
88+
const Word16 gray[8] = {0, 1, 3, 2, 6, 4, 5, 7};
89+
const Word16 dgray[8] = {0, 1, 3, 2, 5, 6, 4, 7};
8890

8991
/*--------------------------------------------------------------------------*/
9092
#ifdef __cplusplus

media/libstagefright/codecs/amrnb/common/src/grid_tbl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ extern "C"
9292
; LOCAL VARIABLE DEFINITIONS
9393
; [Variable declaration - defined here and used outside this module]
9494
----------------------------------------------------------------------------*/
95-
extern const Word16 grid[grid_points + 1] =
95+
const Word16 grid[grid_points + 1] =
9696
{
9797
32760, 32723, 32588, 32364, 32051, 31651,
9898
31164, 30591, 29935, 29196, 28377, 27481,

media/libstagefright/codecs/amrnb/common/src/inv_sqrt_tbl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ extern "C"
8383
; LOCAL VARIABLE DEFINITIONS
8484
; [Variable declaration - defined here and used outside this module]
8585
----------------------------------------------------------------------------*/
86-
extern const Word16 inv_sqrt_tbl[49] =
86+
const Word16 inv_sqrt_tbl[49] =
8787
{
8888

8989
32767, 31790, 30894, 30070, 29309, 28602, 27945, 27330, 26755, 26214,

media/libstagefright/codecs/amrnb/common/src/log2_tbl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ extern "C"
8383
; [Variable declaration - defined here and used outside this module]
8484
----------------------------------------------------------------------------*/
8585

86-
extern const Word16 log2_tbl[33] =
86+
const Word16 log2_tbl[33] =
8787
{
8888
0, 1455, 2866, 4236, 5568, 6863, 8124, 9352, 10549, 11716,
8989
12855, 13967, 15054, 16117, 17156, 18172, 19167, 20142, 21097, 22033,

media/libstagefright/codecs/amrnb/common/src/lsp_lsf_tbl.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ extern "C"
7777
; [Variable declaration - defined here and used outside this module]
7878
----------------------------------------------------------------------------*/
7979

80-
extern const Word16 table[65] =
80+
extern const Word16 table[];
81+
const Word16 table[65] =
8182
{
8283
32767, 32729, 32610, 32413, 32138, 31786, 31357, 30853,
8384
30274, 29622, 28899, 28106, 27246, 26320, 25330, 24279,
@@ -94,7 +95,8 @@ extern "C"
9495

9596
/* slope used to compute y = acos(x) */
9697

97-
extern const Word16 slope[64] =
98+
extern const Word16 slope[];
99+
const Word16 slope[64] =
98100
{
99101
-26887, -8812, -5323, -3813, -2979, -2444, -2081, -1811,
100102
-1608, -1450, -1322, -1219, -1132, -1059, -998, -946,

0 commit comments

Comments
 (0)