Browse Source

engine: libmpg: fix -Wmissing-prototypes

master
Alibek Omarov 5 months ago
parent
commit
bf959da7ff
  1. 8
      engine/common/soundlib/libmpg/format.c
  2. 4
      engine/common/soundlib/libmpg/frame.c
  3. 17
      engine/common/soundlib/libmpg/mpg123.c
  4. 4
      engine/common/soundlib/libmpg/parse.c
  5. 6
      engine/common/soundlib/libmpg/synth.c

8
engine/common/soundlib/libmpg/format.c

@ -56,20 +56,20 @@ static int good_enc( const int enc ) @@ -56,20 +56,20 @@ static int good_enc( const int enc )
return FALSE;
}
void mpg123_rates( const long **list, size_t *number )
static void mpg123_rates( const long **list, size_t *number )
{
if( number != NULL ) *number = sizeof( my_rates ) / sizeof( long );
if( list != NULL ) *list = my_rates;
}
// now that's a bit tricky... One build of the library knows only a subset of the encodings.
void mpg123_encodings( const int **list, size_t *number )
static void mpg123_encodings( const int **list, size_t *number )
{
if( number != NULL ) *number = sizeof( good_encodings ) / sizeof( int );
if( list != NULL ) *list = good_encodings;
}
int mpg123_encsize( int encoding )
static int mpg123_encsize( int encoding )
{
return sizeof( short );
}
@ -364,7 +364,7 @@ int mpg123_format( mpg123_handle_t *mh, long rate, int channels, int encodings ) @@ -364,7 +364,7 @@ int mpg123_format( mpg123_handle_t *mh, long rate, int channels, int encodings )
return r;
}
int mpg123_format_support( mpg123_handle_t *mh, long rate, int encoding )
static int mpg123_format_support( mpg123_handle_t *mh, long rate, int encoding )
{
if( mh == NULL )
return 0;

4
engine/common/soundlib/libmpg/frame.c

@ -393,7 +393,7 @@ void frame_exit( mpg123_handle_t *fr ) @@ -393,7 +393,7 @@ void frame_exit( mpg123_handle_t *fr )
bc_cleanup( &fr->rdat.buffer );
}
int mpg123_framedata( mpg123_handle_t *mh, ulong *header, byte **bodydata, size_t *bodybytes )
static int mpg123_framedata( mpg123_handle_t *mh, ulong *header, byte **bodydata, size_t *bodybytes )
{
if( mh == NULL )
return MPG123_BAD_HANDLE;
@ -512,7 +512,7 @@ mpg_off_t frame_index_find( mpg123_handle_t *fr, mpg_off_t want_frame, mpg_off_t @@ -512,7 +512,7 @@ mpg_off_t frame_index_find( mpg123_handle_t *fr, mpg_off_t want_frame, mpg_off_t
return gopos;
}
mpg_off_t frame_ins2outs( mpg123_handle_t *fr, mpg_off_t ins )
static mpg_off_t frame_ins2outs( mpg123_handle_t *fr, mpg_off_t ins )
{
mpg_off_t outs = 0;

17
engine/common/soundlib/libmpg/mpg123.c

@ -15,6 +15,7 @@ GNU General Public License for more details. @@ -15,6 +15,7 @@ GNU General Public License for more details.
#include "mpg123.h"
#include "sample.h"
#include "libmpg.h"
static int initialized = 0;
@ -83,7 +84,7 @@ mpg123_handle_t *mpg123_parnew( mpg123_parm_t *mp, int *error ) @@ -83,7 +84,7 @@ mpg123_handle_t *mpg123_parnew( mpg123_parm_t *mp, int *error )
return fr;
}
int mpg123_par( mpg123_parm_t *mp, enum mpg123_parms key, long val )
static int mpg123_par( mpg123_parm_t *mp, enum mpg123_parms key, long val )
{
int ret = MPG123_OK;
@ -189,7 +190,7 @@ int mpg123_param( mpg123_handle_t *mh, enum mpg123_parms key, long val ) @@ -189,7 +190,7 @@ int mpg123_param( mpg123_handle_t *mh, enum mpg123_parms key, long val )
}
}
int mpg123_close( mpg123_handle_t *mh )
static int mpg123_close( mpg123_handle_t *mh )
{
if( mh == NULL )
return MPG123_BAD_HANDLE;
@ -263,7 +264,7 @@ int mpg123_replace_reader_handle( mpg123_handle_t *mh, mpg_ssize_t (*fread)( voi @@ -263,7 +264,7 @@ int mpg123_replace_reader_handle( mpg123_handle_t *mh, mpg_ssize_t (*fread)( voi
// a) a new choice of decoder
// b) a changed native format of the MPEG stream
// ... calls are only valid after parsing some MPEG frame!
int decode_update( mpg123_handle_t *mh )
static int decode_update( mpg123_handle_t *mh )
{
long native_rate;
int b;
@ -320,13 +321,13 @@ int decode_update( mpg123_handle_t *mh ) @@ -320,13 +321,13 @@ int decode_update( mpg123_handle_t *mh )
return 0;
}
size_t mpg123_safe_buffer( void )
static size_t mpg123_safe_buffer( void )
{
// real is the largest possible output
return sizeof( float ) * 2 * 1152;
}
size_t mpg123_outblock( mpg123_handle_t *mh )
static size_t mpg123_outblock( mpg123_handle_t *mh )
{
// try to be helpful and never return zero output block size.
if( mh != NULL && mh->outblock > 0 )
@ -697,7 +698,7 @@ int mpg123_getformat( mpg123_handle_t *mh, int *rate, int *channels, int *encodi @@ -697,7 +698,7 @@ int mpg123_getformat( mpg123_handle_t *mh, int *rate, int *channels, int *encodi
return MPG123_OK;
}
int mpg123_scan( mpg123_handle_t *mh )
static int mpg123_scan( mpg123_handle_t *mh )
{
mpg_off_t track_frames = 0;
mpg_off_t track_samples = 0;
@ -963,8 +964,10 @@ const char *mpg123_plain_strerror( int errcode ) @@ -963,8 +964,10 @@ const char *mpg123_plain_strerror( int errcode )
}
}
const char *get_error( mpg123_handle_t *mh )
const char *get_error( void *handle )
{
mpg123_handle_t *mh = handle;
if( !mh ) return mpg123_plain_strerror( MPG123_BAD_HANDLE );
return mpg123_plain_strerror( mh->err );
}

4
engine/common/soundlib/libmpg/parse.c

@ -68,7 +68,7 @@ void set_pointer( mpg123_handle_t *fr, long backstep ) @@ -68,7 +68,7 @@ void set_pointer( mpg123_handle_t *fr, long backstep )
fr->bitindex = 0;
}
int frame_bitrate( mpg123_handle_t *fr )
static int frame_bitrate( mpg123_handle_t *fr )
{
return tabsel_123[fr->lsf][fr->lay-1][fr->bitrate_index];
}
@ -643,7 +643,7 @@ static int forget_head_shift( mpg123_handle_t *fr, ulong *newheadp, int forget ) @@ -643,7 +643,7 @@ static int forget_head_shift( mpg123_handle_t *fr, ulong *newheadp, int forget )
// returns: 0: bad or just unparseable tag
// 1: good, (possibly) new tag info
// <0: reader error (may need more data feed, try again)
int parse_new_id3( mpg123_handle_t *fr, ulong first4bytes )
static int parse_new_id3( mpg123_handle_t *fr, ulong first4bytes )
{
byte buf[6];
ulong length=0;

6
engine/common/soundlib/libmpg/synth.c

@ -25,7 +25,7 @@ GNU General Public License for more details. @@ -25,7 +25,7 @@ GNU General Public License for more details.
else { *(samples) = REAL_TO_SHORT( sum ); }
// main synth function, uses the plain dct64
int synth_1to1( float *bandPtr, int channel, mpg123_handle_t *fr, int final )
static int synth_1to1( float *bandPtr, int channel, mpg123_handle_t *fr, int final )
{
static const int step = 2;
short *samples = (short *) (fr->buffer.data + fr->buffer.fill);
@ -147,7 +147,7 @@ static int synth_stereo( float *bandPtr_l, float *bandPtr_r, mpg123_handle_t *fr @@ -147,7 +147,7 @@ static int synth_stereo( float *bandPtr_l, float *bandPtr_r, mpg123_handle_t *fr
}
// mono to stereo synth, wrapping over synth_1to1
int synth_1to1_m2s(float *bandPtr, mpg123_handle_t *fr )
static int synth_1to1_m2s(float *bandPtr, mpg123_handle_t *fr )
{
byte *samples = fr->buffer.data;
int i, ret;
@ -165,7 +165,7 @@ int synth_1to1_m2s(float *bandPtr, mpg123_handle_t *fr ) @@ -165,7 +165,7 @@ int synth_1to1_m2s(float *bandPtr, mpg123_handle_t *fr )
}
// mono synth, wrapping over synth_1to1
int synth_1to1_mono( float *bandPtr, mpg123_handle_t *fr )
static int synth_1to1_mono( float *bandPtr, mpg123_handle_t *fr )
{
short samples_tmp[BLOCK];
short *tmp1 = samples_tmp;

Loading…
Cancel
Save