From d30170d2bc1e0bc19304f00615740a4330687fd8 Mon Sep 17 00:00:00 2001 From: Christian Schneider Date: Tue, 19 Apr 2016 06:28:15 +0200 Subject: [PATCH] No more compiler warnings for pmp3tbl.h --- contrib/packmp3/pmp3tbl.h | 15 ++++++++++++--- contrib/packmp3/precomp_mp3.h | 2 ++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/contrib/packmp3/pmp3tbl.h b/contrib/packmp3/pmp3tbl.h index 5033014..faf2aaa 100644 --- a/contrib/packmp3/pmp3tbl.h +++ b/contrib/packmp3/pmp3tbl.h @@ -165,8 +165,11 @@ static const int samplerate_table[4][4] = {22050, 24000, 16000, -1}, // MPEG 2.0 {44100, 48000, 32000, -1} // MPEG 1.0 }; + +#ifndef PRECOMP_MP3 // shortcut for MPEG 1 LAYER III static const int* mp3_samplerate_table = samplerate_table[MP3_V1_0]; +#endif /* ----------------------------------------------- @@ -199,9 +202,11 @@ static const int bitrate_table[4][4][16] = {0, 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448, -1} // LAYER I } }; + +#ifndef PRECOMP_MP3 // shortcut for MPEG 1 LAYER III static const int* mp3_bitrate_table = bitrate_table[MP3_V1_0][LAYER_III]; - +#endif /* ----------------------------------------------- frame size table, indexed by MPEG, LAYER, SAMPLE, BITS @@ -313,6 +318,8 @@ static const int frame_size_table[4][4][4][16] = } } }; + +#ifndef PRECOMP_MP3 // shortcut for MPEG 1 LAYER III static const int* mp3_frame_size_table[ 4 ] = { @@ -321,7 +328,7 @@ static const int* mp3_frame_size_table[ 4 ] = frame_size_table[MP3_V1_0][LAYER_III][2], frame_size_table[MP3_V1_0][LAYER_III][3] }; - +#endif /* ----------------------------------------------- slength lo/hi table, indexed by slength @@ -489,6 +496,8 @@ static const int* mp3_bandwidth_table_short[4] = bandwidth_table_short[MP3_V1_0][2], bandwidth_table_short[MP3_V1_0][3] };*/ + +#ifndef PRECOMP_MP3 static const int* mp3_bandwidth_bounds[4] = { bandwidth_bounds[MP3_V1_0][0], @@ -503,7 +512,7 @@ static const int* mp3_bandwidth_bounds_short[4] = bandwidth_bounds_short[MP3_V1_0][2], bandwidth_bounds_short[MP3_V1_0][3] }; - +#endif /* ----------------------------------------------- crc calculation table diff --git a/contrib/packmp3/precomp_mp3.h b/contrib/packmp3/precomp_mp3.h index 8bcb933..2d7d621 100644 --- a/contrib/packmp3/precomp_mp3.h +++ b/contrib/packmp3/precomp_mp3.h @@ -1,5 +1,7 @@ #include "../packjpg/bitops.h" // for MBITS +#define PRECOMP_MP3 // to avoid compiler warnings (unused variables), use only a part of the header file #include "pmp3tbl.h" +#undef PRECOMP_MP3 #define MP3_MAX_MEMORY_SIZE 64 * 1024 * 1024