mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Avoided some pedantic GCC warnings.
This commit is contained in:
parent
664a585d19
commit
12a8dd3092
65 changed files with 595 additions and 614 deletions
|
|
@ -96,7 +96,7 @@ void FLAC__lpc_compute_autocorrelation(const FLAC__real data[], unsigned data_le
|
|||
FLAC__ASSERT(lag <= data_len);
|
||||
|
||||
for(coeff = 0; coeff < lag; coeff++)
|
||||
autoc[coeff] = 0.0;
|
||||
autoc[coeff] = 0.0f;
|
||||
for(sample = 0; sample <= limit; sample++) {
|
||||
d = data[sample];
|
||||
for(coeff = 0; coeff < lag; coeff++)
|
||||
|
|
|
|||
|
|
@ -786,10 +786,10 @@ static FLAC__StreamEncoderInitStatus init_stream_internal_enc(
|
|||
#endif
|
||||
/* keep track of any SEEKTABLE block */
|
||||
if(0 != encoder->protected_->metadata && encoder->protected_->num_metadata_blocks > 0) {
|
||||
unsigned i;
|
||||
for(i = 0; i < encoder->protected_->num_metadata_blocks; i++) {
|
||||
if(0 != encoder->protected_->metadata[i] && encoder->protected_->metadata[i]->type == FLAC__METADATA_TYPE_SEEKTABLE) {
|
||||
encoder->private_->seek_table = &encoder->protected_->metadata[i]->data.seek_table;
|
||||
unsigned j;
|
||||
for(j = 0; j < encoder->protected_->num_metadata_blocks; j++) {
|
||||
if(0 != encoder->protected_->metadata[j] && encoder->protected_->metadata[j]->type == FLAC__METADATA_TYPE_SEEKTABLE) {
|
||||
encoder->private_->seek_table = &encoder->protected_->metadata[j]->data.seek_table;
|
||||
break; /* take only the first one */
|
||||
}
|
||||
}
|
||||
|
|
@ -1485,7 +1485,7 @@ FLAC_API FLAC__bool FLAC__stream_encoder_set_compression_level(FLAC__StreamEncod
|
|||
#else
|
||||
encoder->protected_->num_apodizations = 1;
|
||||
encoder->protected_->apodizations[0].type = FLAC__APODIZATION_TUKEY;
|
||||
encoder->protected_->apodizations[0].parameters.tukey.p = 0.5;
|
||||
encoder->protected_->apodizations[0].parameters.tukey.p = 0.5f;
|
||||
#endif
|
||||
#endif
|
||||
ok &= FLAC__stream_encoder_set_max_lpc_order (encoder, compression_levels_[value].max_lpc_order);
|
||||
|
|
@ -1598,7 +1598,7 @@ FLAC_API FLAC__bool FLAC__stream_encoder_set_apodization(FLAC__StreamEncoder *en
|
|||
if(encoder->protected_->num_apodizations == 0) {
|
||||
encoder->protected_->num_apodizations = 1;
|
||||
encoder->protected_->apodizations[0].type = FLAC__APODIZATION_TUKEY;
|
||||
encoder->protected_->apodizations[0].parameters.tukey.p = 0.5;
|
||||
encoder->protected_->apodizations[0].parameters.tukey.p = 0.5f;
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
|
|
@ -2139,7 +2139,7 @@ void set_defaults_enc(FLAC__StreamEncoder *encoder)
|
|||
#ifndef FLAC__INTEGER_ONLY_LIBRARY
|
||||
encoder->protected_->num_apodizations = 1;
|
||||
encoder->protected_->apodizations[0].type = FLAC__APODIZATION_TUKEY;
|
||||
encoder->protected_->apodizations[0].parameters.tukey.p = 0.5;
|
||||
encoder->protected_->apodizations[0].parameters.tukey.p = 0.5f;
|
||||
#endif
|
||||
encoder->protected_->max_lpc_order = 0;
|
||||
encoder->protected_->qlp_coeff_precision = 0;
|
||||
|
|
|
|||
|
|
@ -39,16 +39,16 @@ void vorbis_bitrate_init(vorbis_info *vi,bitrate_manager_state *bm){
|
|||
bm->short_per_long=ci->blocksizes[1]/ci->blocksizes[0];
|
||||
bm->managed=1;
|
||||
|
||||
bm->avg_bitsper= rint(1.*bi->avg_rate*halfsamples/ratesamples);
|
||||
bm->min_bitsper= rint(1.*bi->min_rate*halfsamples/ratesamples);
|
||||
bm->max_bitsper= rint(1.*bi->max_rate*halfsamples/ratesamples);
|
||||
bm->avg_bitsper= (int) rint(1.*bi->avg_rate*halfsamples/ratesamples);
|
||||
bm->min_bitsper= (int) rint(1.*bi->min_rate*halfsamples/ratesamples);
|
||||
bm->max_bitsper= (int) rint(1.*bi->max_rate*halfsamples/ratesamples);
|
||||
|
||||
bm->avgfloat=PACKETBLOBS/2;
|
||||
|
||||
/* not a necessary fix, but one that leads to a more balanced
|
||||
typical initialization */
|
||||
{
|
||||
long desired_fill=bi->reservoir_bits*bi->reservoir_bias;
|
||||
long desired_fill = (long) (bi->reservoir_bits*bi->reservoir_bias);
|
||||
bm->minmax_reservoir=desired_fill;
|
||||
bm->avg_reservoir=desired_fill;
|
||||
}
|
||||
|
|
@ -80,12 +80,12 @@ int vorbis_bitrate_addblock(vorbis_block *vb){
|
|||
codec_setup_info *ci=(codec_setup_info*)vi->codec_setup;
|
||||
bitrate_manager_info *bi=&ci->bi;
|
||||
|
||||
int choice=rint(bm->avgfloat);
|
||||
int choice = (int) rint(bm->avgfloat);
|
||||
long this_bits=oggpack_bytes(vbi->packetblob[choice])*8;
|
||||
long min_target_bits=(vb->W?bm->min_bitsper*bm->short_per_long:bm->min_bitsper);
|
||||
long max_target_bits=(vb->W?bm->max_bitsper*bm->short_per_long:bm->max_bitsper);
|
||||
int samples=ci->blocksizes[vb->W]>>1;
|
||||
long desired_fill=bi->reservoir_bits*bi->reservoir_bias;
|
||||
long desired_fill = (long) (bi->reservoir_bits*bi->reservoir_bias);
|
||||
if(!bm->managed){
|
||||
/* not a bitrate managed stream, but for API simplicity, we'll
|
||||
buffer the packet to keep the code path clean */
|
||||
|
|
@ -132,7 +132,7 @@ int vorbis_bitrate_addblock(vorbis_block *vb){
|
|||
slew=rint(choice-bm->avgfloat)/samples*vi->rate;
|
||||
if(slew<-slewlimit)slew=-slewlimit;
|
||||
if(slew>slewlimit)slew=slewlimit;
|
||||
choice=rint(bm->avgfloat+= slew/vi->rate*samples);
|
||||
choice = (int) rint(bm->avgfloat+= slew/vi->rate*samples);
|
||||
this_bits=oggpack_bytes(vbi->packetblob[choice])*8;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -169,7 +169,6 @@ int vorbis_block_clear(vorbis_block *vb){
|
|||
The init is here because some of it is shared */
|
||||
|
||||
static int _vds_shared_init(vorbis_dsp_state *v,vorbis_info *vi,int encp){
|
||||
int i;
|
||||
codec_setup_info *ci=(codec_setup_info*)vi->codec_setup;
|
||||
private_state *b=NULL;
|
||||
int hs;
|
||||
|
|
@ -206,12 +205,12 @@ static int _vds_shared_init(vorbis_dsp_state *v,vorbis_info *vi,int encp){
|
|||
/* finish the codebooks */
|
||||
if(!ci->fullbooks){
|
||||
ci->fullbooks=(codebook*) _ogg_calloc(ci->books,sizeof(*ci->fullbooks));
|
||||
for(i=0;i<ci->books;i++)
|
||||
for(int i=0;i<ci->books;i++)
|
||||
vorbis_book_init_encode(ci->fullbooks+i,ci->book_param[i]);
|
||||
}
|
||||
|
||||
b->psy=(vorbis_look_psy*)_ogg_calloc(ci->psys,sizeof(*b->psy));
|
||||
for(i=0;i<ci->psys;i++){
|
||||
for(int i=0;i<ci->psys;i++){
|
||||
_vp_psy_init(b->psy+i,
|
||||
ci->psy_param[i],
|
||||
&ci->psy_g_param,
|
||||
|
|
@ -224,7 +223,7 @@ static int _vds_shared_init(vorbis_dsp_state *v,vorbis_info *vi,int encp){
|
|||
/* finish the codebooks */
|
||||
if(!ci->fullbooks){
|
||||
ci->fullbooks=(codebook*) _ogg_calloc(ci->books,sizeof(*ci->fullbooks));
|
||||
for(i=0;i<ci->books;i++){
|
||||
for(int i=0;i<ci->books;i++){
|
||||
if(ci->book_param[i]==NULL)
|
||||
goto abort_books;
|
||||
if(vorbis_book_init_decode(ci->fullbooks+i,ci->book_param[i]))
|
||||
|
|
@ -261,17 +260,17 @@ static int _vds_shared_init(vorbis_dsp_state *v,vorbis_info *vi,int encp){
|
|||
b->flr=(vorbis_look_floor**)_ogg_calloc(ci->floors,sizeof(*b->flr));
|
||||
b->residue=(vorbis_look_residue**)_ogg_calloc(ci->residues,sizeof(*b->residue));
|
||||
|
||||
for(i=0;i<ci->floors;i++)
|
||||
for(int i=0;i<ci->floors;i++)
|
||||
b->flr[i]=_floor_P[ci->floor_type[i]]->
|
||||
look(v,ci->floor_param[i]);
|
||||
|
||||
for(i=0;i<ci->residues;i++)
|
||||
for(int i=0;i<ci->residues;i++)
|
||||
b->residue[i]=_residue_P[ci->residue_type[i]]->
|
||||
look(v,ci->residue_param[i]);
|
||||
|
||||
return 0;
|
||||
abort_books:
|
||||
for(i=0;i<ci->books;i++){
|
||||
for(int i=0;i<ci->books;i++){
|
||||
if(ci->book_param[i]!=NULL){
|
||||
vorbis_staticbook_destroy(ci->book_param[i]);
|
||||
ci->book_param[i]=NULL;
|
||||
|
|
@ -850,7 +849,7 @@ int vorbis_synthesis_blockin(vorbis_dsp_state *v,vorbis_block *vb){
|
|||
if(b->sample_count>v->granulepos){
|
||||
/* corner case; if this is both the first and last audio page,
|
||||
then spec says the end is cut, not beginning */
|
||||
long extra=b->sample_count-vb->granulepos;
|
||||
long extra = (long) (b->sample_count-vb->granulepos);
|
||||
|
||||
/* we use ogg_int64_t for granule positions because a
|
||||
uint64 isn't universally available. Unfortunately,
|
||||
|
|
@ -958,7 +957,6 @@ int vorbis_synthesis_lapout(vorbis_dsp_state *v,float ***pcm){
|
|||
int n=ci->blocksizes[v->W]>>(hs+1);
|
||||
int n0=ci->blocksizes[0]>>(hs+1);
|
||||
int n1=ci->blocksizes[1]>>(hs+1);
|
||||
int i,j;
|
||||
|
||||
if(v->pcm_returned<0)return 0;
|
||||
|
||||
|
|
@ -975,9 +973,9 @@ int vorbis_synthesis_lapout(vorbis_dsp_state *v,float ***pcm){
|
|||
if(v->centerW==n1){
|
||||
/* the data buffer wraps; swap the halves */
|
||||
/* slow, sure, small */
|
||||
for(j=0;j<vi->channels;j++){
|
||||
for(int j=0;j<vi->channels;j++){
|
||||
float *p=v->pcm[j];
|
||||
for(i=0;i<n1;i++){
|
||||
for(int i=0;i<n1;i++){
|
||||
float temp=p[i];
|
||||
p[i]=p[i+n1];
|
||||
p[i+n1]=temp;
|
||||
|
|
@ -992,10 +990,10 @@ int vorbis_synthesis_lapout(vorbis_dsp_state *v,float ***pcm){
|
|||
/* solidify buffer into contiguous space */
|
||||
if((v->lW^v->W)==1){
|
||||
/* long/short or short/long */
|
||||
for(j=0;j<vi->channels;j++){
|
||||
for(int j=0;j<vi->channels;j++){
|
||||
float *s=v->pcm[j];
|
||||
float *d=v->pcm[j]+(n1-n0)/2;
|
||||
for(i=(n1+n0)/2-1;i>=0;--i)
|
||||
for(int i=(n1+n0)/2-1;i>=0;--i)
|
||||
d[i]=s[i];
|
||||
}
|
||||
v->pcm_returned+=(n1-n0)/2;
|
||||
|
|
@ -1003,10 +1001,10 @@ int vorbis_synthesis_lapout(vorbis_dsp_state *v,float ***pcm){
|
|||
}else{
|
||||
if(v->lW==0){
|
||||
/* short/short */
|
||||
for(j=0;j<vi->channels;j++){
|
||||
for(int j=0;j<vi->channels;j++){
|
||||
float *s=v->pcm[j];
|
||||
float *d=v->pcm[j]+n1-n0;
|
||||
for(i=n0-1;i>=0;--i)
|
||||
for(int i=n0-1;i>=0;--i)
|
||||
d[i]=s[i];
|
||||
}
|
||||
v->pcm_returned+=n1-n0;
|
||||
|
|
@ -1015,8 +1013,7 @@ int vorbis_synthesis_lapout(vorbis_dsp_state *v,float ***pcm){
|
|||
}
|
||||
|
||||
if(pcm){
|
||||
int i;
|
||||
for(i=0;i<vi->channels;i++)
|
||||
for(int i=0;i<vi->channels;i++)
|
||||
v->pcmret[i]=v->pcm[i]+v->pcm_returned;
|
||||
*pcm=v->pcmret;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -426,7 +426,7 @@ static long **_01class(vorbis_block *vb,vorbis_look_residue *vl,
|
|||
|
||||
int partvals=n/samples_per_partition;
|
||||
long **partword=(long**)_vorbis_block_alloc(vb,ch*sizeof(*partword));
|
||||
float scale=100./samples_per_partition;
|
||||
float scale=100.0f/samples_per_partition;
|
||||
|
||||
/* we find the partition type for each partition of each
|
||||
channel. We'll go back and do the interleaved encoding in a
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue