engine: libmpg: fix -Wmissing-prototypes

This commit is contained in:
Alibek Omarov 2024-01-27 20:17:42 +03:00
parent 75d476f9df
commit bf959da7ff
5 changed files with 21 additions and 18 deletions

View File

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

View File

@ -393,7 +393,7 @@ void frame_exit( mpg123_handle_t *fr )
bc_cleanup( &fr->rdat.buffer ); 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 ) if( mh == NULL )
return MPG123_BAD_HANDLE; 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
return gopos; 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; mpg_off_t outs = 0;

View File

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

View File

@ -68,7 +68,7 @@ void set_pointer( mpg123_handle_t *fr, long backstep )
fr->bitindex = 0; 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]; 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 )
// returns: 0: bad or just unparseable tag // returns: 0: bad or just unparseable tag
// 1: good, (possibly) new tag info // 1: good, (possibly) new tag info
// <0: reader error (may need more data feed, try again) // <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]; byte buf[6];
ulong length=0; ulong length=0;

View File

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