mirror of
https://github.com/claunia/flac.git
synced 2025-12-16 18:54:26 +00:00
Rename all parameters and locals from 'index' to 'indx'.
This commit is contained in:
@@ -1327,7 +1327,7 @@ FLAC__double FLAC__lpc_compute_expected_bits_per_residual_sample_with_error_scal
|
||||
|
||||
unsigned FLAC__lpc_compute_best_order(const FLAC__double lpc_error[], unsigned max_order, unsigned total_samples, unsigned overhead_bits_per_order)
|
||||
{
|
||||
unsigned order, index, best_index; /* 'index' the index into lpc_error; index==order-1 since lpc_error[0] is for order==1, lpc_error[1] is for order==2, etc */
|
||||
unsigned order, indx, best_index; /* 'index' the index into lpc_error; index==order-1 since lpc_error[0] is for order==1, lpc_error[1] is for order==2, etc */
|
||||
FLAC__double bits, best_bits, error_scale;
|
||||
|
||||
FLAC__ASSERT(max_order > 0);
|
||||
@@ -1338,15 +1338,15 @@ unsigned FLAC__lpc_compute_best_order(const FLAC__double lpc_error[], unsigned m
|
||||
best_index = 0;
|
||||
best_bits = (unsigned)(-1);
|
||||
|
||||
for(index = 0, order = 1; index < max_order; index++, order++) {
|
||||
bits = FLAC__lpc_compute_expected_bits_per_residual_sample_with_error_scale(lpc_error[index], error_scale) * (FLAC__double)(total_samples - order) + (FLAC__double)(order * overhead_bits_per_order);
|
||||
for(indx = 0, order = 1; indx < max_order; indx++, order++) {
|
||||
bits = FLAC__lpc_compute_expected_bits_per_residual_sample_with_error_scale(lpc_error[indx], error_scale) * (FLAC__double)(total_samples - order) + (FLAC__double)(order * overhead_bits_per_order);
|
||||
if(bits < best_bits) {
|
||||
best_index = index;
|
||||
best_index = indx;
|
||||
best_bits = bits;
|
||||
}
|
||||
}
|
||||
|
||||
return best_index+1; /* +1 since index of lpc_error[] is order-1 */
|
||||
return best_index+1; /* +1 since indx of lpc_error[] is order-1 */
|
||||
}
|
||||
|
||||
#endif /* !defined FLAC__INTEGER_ONLY_LIBRARY */
|
||||
|
||||
@@ -2711,17 +2711,17 @@ FLAC__bool write_metadata_block_data_cuesheet_cb_(FLAC__IOHandle handle, FLAC__I
|
||||
return false;
|
||||
|
||||
for(j = 0; j < track->num_indices; j++) {
|
||||
FLAC__StreamMetadata_CueSheet_Index *index = track->indices + j;
|
||||
FLAC__StreamMetadata_CueSheet_Index *indx = track->indices + j;
|
||||
|
||||
FLAC__ASSERT(FLAC__STREAM_METADATA_CUESHEET_INDEX_OFFSET_LEN % 8 == 0);
|
||||
len = FLAC__STREAM_METADATA_CUESHEET_INDEX_OFFSET_LEN / 8;
|
||||
pack_uint64_(index->offset, buffer, len);
|
||||
pack_uint64_(indx->offset, buffer, len);
|
||||
if(write_cb(buffer, 1, len, handle) != len)
|
||||
return false;
|
||||
|
||||
FLAC__ASSERT(FLAC__STREAM_METADATA_CUESHEET_INDEX_NUMBER_LEN % 8 == 0);
|
||||
len = FLAC__STREAM_METADATA_CUESHEET_INDEX_NUMBER_LEN / 8;
|
||||
pack_uint32_(index->number, buffer, len);
|
||||
pack_uint32_(indx->number, buffer, len);
|
||||
if(write_cb(buffer, 1, len, handle) != len)
|
||||
return false;
|
||||
|
||||
|
||||
@@ -1272,19 +1272,19 @@ FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_replace_comment(FLAC__St
|
||||
|
||||
i = vorbiscomment_find_entry_from_(object, 0, (const char *)entry.entry, field_name_length);
|
||||
if(i >= 0) {
|
||||
unsigned index = (unsigned)i;
|
||||
if(!FLAC__metadata_object_vorbiscomment_set_comment(object, index, entry, copy))
|
||||
unsigned indx = (unsigned)i;
|
||||
if(!FLAC__metadata_object_vorbiscomment_set_comment(object, indx, entry, copy))
|
||||
return false;
|
||||
entry = object->data.vorbis_comment.comments[index];
|
||||
index++; /* skip over replaced comment */
|
||||
if(all && index < object->data.vorbis_comment.num_comments) {
|
||||
i = vorbiscomment_find_entry_from_(object, index, (const char *)entry.entry, field_name_length);
|
||||
entry = object->data.vorbis_comment.comments[indx];
|
||||
indx++; /* skip over replaced comment */
|
||||
if(all && indx < object->data.vorbis_comment.num_comments) {
|
||||
i = vorbiscomment_find_entry_from_(object, indx, (const char *)entry.entry, field_name_length);
|
||||
while(i >= 0) {
|
||||
index = (unsigned)i;
|
||||
if(!FLAC__metadata_object_vorbiscomment_delete_comment(object, index))
|
||||
indx = (unsigned)i;
|
||||
if(!FLAC__metadata_object_vorbiscomment_delete_comment(object, indx))
|
||||
return false;
|
||||
if(index < object->data.vorbis_comment.num_comments)
|
||||
i = vorbiscomment_find_entry_from_(object, index, (const char *)entry.entry, field_name_length);
|
||||
if(indx < object->data.vorbis_comment.num_comments)
|
||||
i = vorbiscomment_find_entry_from_(object, indx, (const char *)entry.entry, field_name_length);
|
||||
else
|
||||
i = -1;
|
||||
}
|
||||
@@ -1513,7 +1513,7 @@ FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_track_resize_indices(FLAC__St
|
||||
return true;
|
||||
}
|
||||
|
||||
FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_track_insert_index(FLAC__StreamMetadata *object, unsigned track_num, unsigned index_num, FLAC__StreamMetadata_CueSheet_Index index)
|
||||
FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_track_insert_index(FLAC__StreamMetadata *object, unsigned track_num, unsigned index_num, FLAC__StreamMetadata_CueSheet_Index indx)
|
||||
{
|
||||
FLAC__StreamMetadata_CueSheet_Track *track;
|
||||
|
||||
@@ -1530,16 +1530,16 @@ FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_track_insert_index(FLAC__Stre
|
||||
/* move all indices >= index_num forward one space */
|
||||
memmove(&track->indices[index_num+1], &track->indices[index_num], sizeof(FLAC__StreamMetadata_CueSheet_Index)*(track->num_indices-1-index_num));
|
||||
|
||||
track->indices[index_num] = index;
|
||||
track->indices[index_num] = indx;
|
||||
cuesheet_calculate_length_(object);
|
||||
return true;
|
||||
}
|
||||
|
||||
FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_track_insert_blank_index(FLAC__StreamMetadata *object, unsigned track_num, unsigned index_num)
|
||||
{
|
||||
FLAC__StreamMetadata_CueSheet_Index index;
|
||||
memset(&index, 0, sizeof(index));
|
||||
return FLAC__metadata_object_cuesheet_track_insert_index(object, track_num, index_num, index);
|
||||
FLAC__StreamMetadata_CueSheet_Index indx;
|
||||
memset(&indx, 0, sizeof(indx));
|
||||
return FLAC__metadata_object_cuesheet_track_insert_index(object, track_num, index_num, indx);
|
||||
}
|
||||
|
||||
FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_track_delete_index(FLAC__StreamMetadata *object, unsigned track_num, unsigned index_num)
|
||||
|
||||
@@ -1805,13 +1805,13 @@ FLAC__bool read_metadata_cuesheet_(FLAC__StreamDecoder *decoder, FLAC__StreamMet
|
||||
return false;
|
||||
}
|
||||
for(j = 0; j < track->num_indices; j++) {
|
||||
FLAC__StreamMetadata_CueSheet_Index *index = &track->indices[j];
|
||||
if(!FLAC__bitreader_read_raw_uint64(decoder->private_->input, &index->offset, FLAC__STREAM_METADATA_CUESHEET_INDEX_OFFSET_LEN))
|
||||
FLAC__StreamMetadata_CueSheet_Index *indx = &track->indices[j];
|
||||
if(!FLAC__bitreader_read_raw_uint64(decoder->private_->input, &indx->offset, FLAC__STREAM_METADATA_CUESHEET_INDEX_OFFSET_LEN))
|
||||
return false; /* read_callback_ sets the state for us */
|
||||
|
||||
if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, FLAC__STREAM_METADATA_CUESHEET_INDEX_NUMBER_LEN))
|
||||
return false; /* read_callback_ sets the state for us */
|
||||
index->number = (FLAC__byte)x;
|
||||
indx->number = (FLAC__byte)x;
|
||||
|
||||
if(!FLAC__bitreader_skip_bits_no_crc(decoder->private_->input, FLAC__STREAM_METADATA_CUESHEET_INDEX_RESERVED_LEN))
|
||||
return false; /* read_callback_ sets the state for us */
|
||||
|
||||
@@ -161,11 +161,11 @@ FLAC__bool FLAC__add_metadata_block(const FLAC__StreamMetadata *metadata, FLAC__
|
||||
if(!FLAC__bitwriter_write_raw_uint32(bw, track->num_indices, FLAC__STREAM_METADATA_CUESHEET_TRACK_NUM_INDICES_LEN))
|
||||
return false;
|
||||
for(j = 0; j < track->num_indices; j++) {
|
||||
const FLAC__StreamMetadata_CueSheet_Index *index = track->indices + j;
|
||||
const FLAC__StreamMetadata_CueSheet_Index *indx = track->indices + j;
|
||||
|
||||
if(!FLAC__bitwriter_write_raw_uint64(bw, index->offset, FLAC__STREAM_METADATA_CUESHEET_INDEX_OFFSET_LEN))
|
||||
if(!FLAC__bitwriter_write_raw_uint64(bw, indx->offset, FLAC__STREAM_METADATA_CUESHEET_INDEX_OFFSET_LEN))
|
||||
return false;
|
||||
if(!FLAC__bitwriter_write_raw_uint32(bw, index->number, FLAC__STREAM_METADATA_CUESHEET_INDEX_NUMBER_LEN))
|
||||
if(!FLAC__bitwriter_write_raw_uint32(bw, indx->number, FLAC__STREAM_METADATA_CUESHEET_INDEX_NUMBER_LEN))
|
||||
return false;
|
||||
if(!FLAC__bitwriter_write_zeroes(bw, FLAC__STREAM_METADATA_CUESHEET_INDEX_RESERVED_LEN))
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user