fmt= RAW;
}
else {
- if(!strncmp(lookahead, "RIFF", 4) && !strncmp(lookahead+8, "WAVE", 4))
+ if(!strncmp((const char *)lookahead, "RIFF", 4) && !strncmp((const char *)lookahead+8, "WAVE", 4))
fmt= WAV;
- else if(!strncmp(lookahead, "FORM", 4) && !strncmp(lookahead+8, "AIFF", 4))
+ else if(!strncmp((const char *)lookahead, "FORM", 4) && !strncmp((const char *)lookahead+8, "AIFF", 4))
fmt= AIF;
else {
if(fmt != RAW)
FLAC__ASSERT(0 != needs_write);
if(raw) {
- entry.entry = field->field;
+ entry.entry = (FLAC__byte *)field->field;
}
else if(utf8_encode(field->field, &converted) >= 0) {
- entry.entry = converted;
+ entry.entry = (FLAC__byte *)converted;
needs_free = true;
}
else {
return false;
}
- entry.length = strlen(entry.entry);
+ entry.length = strlen((const char *)entry.entry);
if(!FLAC__metadata_object_vorbiscomment_insert_comment(block, block->data.vorbis_comment.num_comments, entry, /*copy=*/true)) {
if(needs_free)
memset(obj, 0, sizeof(FLAC__StreamMetadata_CueSheet));
FLAC__ASSERT(FLAC__STREAM_METADATA_CUESHEET_MEDIA_CATALOG_NUMBER_LEN % 8 == 0);
- if(!FLAC__bitbuffer_read_byte_block_aligned_no_crc(decoder->private_->input, obj->media_catalog_number, FLAC__STREAM_METADATA_CUESHEET_MEDIA_CATALOG_NUMBER_LEN/8, read_callback_, decoder))
+ if(!FLAC__bitbuffer_read_byte_block_aligned_no_crc(decoder->private_->input, (FLAC__byte*)obj->media_catalog_number, FLAC__STREAM_METADATA_CUESHEET_MEDIA_CATALOG_NUMBER_LEN/8, read_callback_, decoder))
return false; /* the read_callback_ sets the state for us */
if(!FLAC__bitbuffer_read_raw_uint64(decoder->private_->input, &obj->lead_in, FLAC__STREAM_METADATA_CUESHEET_LEAD_IN_LEN, read_callback_, decoder))
track->number = (FLAC__byte)x;
FLAC__ASSERT(FLAC__STREAM_METADATA_CUESHEET_TRACK_ISRC_LEN % 8 == 0);
- if(!FLAC__bitbuffer_read_byte_block_aligned_no_crc(decoder->private_->input, track->isrc, FLAC__STREAM_METADATA_CUESHEET_TRACK_ISRC_LEN/8, read_callback_, decoder))
+ if(!FLAC__bitbuffer_read_byte_block_aligned_no_crc(decoder->private_->input, (FLAC__byte*)track->isrc, FLAC__STREAM_METADATA_CUESHEET_TRACK_ISRC_LEN/8, read_callback_, decoder))
return false; /* the read_callback_ sets the state for us */
if(!FLAC__bitbuffer_read_raw_uint32(decoder->private_->input, &x, FLAC__STREAM_METADATA_CUESHEET_TRACK_TYPE_LEN, read_callback_, decoder))
ogg_bytes_to_read = min(*bytes, OGG_BYTES_CHUNK);
oggbuf = ogg_sync_buffer(&decoder->private_->ogg.sync_state, ogg_bytes_to_read);
- if(decoder->private_->read_callback(decoder, oggbuf, &ogg_bytes_to_read, decoder->private_->client_data) != FLAC__STREAM_DECODER_READ_STATUS_CONTINUE) {
+ if(decoder->private_->read_callback(decoder, (FLAC__byte*)oggbuf, &ogg_bytes_to_read, decoder->private_->client_data) != FLAC__STREAM_DECODER_READ_STATUS_CONTINUE) {
decoder->protected_->state = OggFLAC__STREAM_DECODER_READ_ERROR;
return FLAC__STREAM_DECODER_READ_STATUS_ABORT;
}
FLAC__ASSERT(0 != needs_write);
if(raw) {
- entry.entry = field->field;
+ entry.entry = (FLAC__byte *)field->field;
}
else if(utf8_encode(field->field, &converted) >= 0) {
- entry.entry = converted;
+ entry.entry = (FLAC__byte *)converted;
needs_free = true;
}
else {
return false;
}
- entry.length = strlen(entry.entry);
+ entry.length = strlen((const char *)entry.entry);
if(!FLAC__metadata_object_vorbiscomment_insert_comment(block, block->data.vorbis_comment.num_comments, entry, /*copy=*/true)) {
if(needs_free)
outptr = out;
retry:
- if (iconv(cd, &input, &length, &outptr, &outleft) == -1)
+ if (iconv(cd, (char**)&input, &length, &outptr, &outleft) == -1)
{
int used;
switch (errno)
#endif
const FLAC__byte *eq = memchr(entry->entry, '=', entry->length);
const unsigned field_name_length = strlen(field_name);
- return (0 != eq && (unsigned)(eq-entry->entry) == field_name_length && 0 == FLAC__STRNCASECMP(field_name, entry->entry, field_name_length));
+ return (0 != eq && (unsigned)(eq-entry->entry) == field_name_length && 0 == FLAC__STRNCASECMP(field_name, (const char *)entry->entry, field_name_length));
}
static void local__vcentry_parse_value(const FLAC__StreamMetadata_VorbisComment_Entry *entry, char **dest)
sprintf(s, "%s=%s", name, value);
entry.length = strlen(s);
- entry.entry = s;
+ entry.entry = (FLAC__byte *)s;
if(l == -1)
FLAC__metadata_object_vorbiscomment_insert_comment(block, block->data.vorbis_comment.num_comments, entry, /*copy=*/true);
#endif
setlocale(LC_ALL, saved_locale);
- entry.entry = buffer;
+ entry.entry = (FLAC__byte *)buffer;
entry.length = strlen(buffer);
return FLAC__metadata_object_vorbiscomment_insert_comment(block, block->data.vorbis_comment.num_comments, entry, /*copy=*/true);
FLAC__ASSERT(block->type == FLAC__METADATA_TYPE_VORBIS_COMMENT);
if(
- FLAC__metadata_object_vorbiscomment_remove_entries_matching(block, tag_album_gain_) < 0 ||
- FLAC__metadata_object_vorbiscomment_remove_entries_matching(block, tag_album_peak_) < 0
+ FLAC__metadata_object_vorbiscomment_remove_entries_matching(block, (const char *)tag_album_gain_) < 0 ||
+ FLAC__metadata_object_vorbiscomment_remove_entries_matching(block, (const char *)tag_album_peak_) < 0
)
return "memory allocation error";
FLAC__ASSERT(block->type == FLAC__METADATA_TYPE_VORBIS_COMMENT);
if(
- FLAC__metadata_object_vorbiscomment_remove_entries_matching(block, tag_title_gain_) < 0 ||
- FLAC__metadata_object_vorbiscomment_remove_entries_matching(block, tag_title_peak_) < 0
+ FLAC__metadata_object_vorbiscomment_remove_entries_matching(block, (const char *)tag_title_gain_) < 0 ||
+ FLAC__metadata_object_vorbiscomment_remove_entries_matching(block, (const char *)tag_title_peak_) < 0
)
return "memory allocation error";
FLAC__ASSERT(0 != block);
FLAC__ASSERT(block->type == FLAC__METADATA_TYPE_VORBIS_COMMENT);
- if(0 > (gain_offset = FLAC__metadata_object_vorbiscomment_find_entry_from(block, /*offset=*/0, album_mode? tag_album_gain_ : tag_title_gain_)))
+ if(0 > (gain_offset = FLAC__metadata_object_vorbiscomment_find_entry_from(block, /*offset=*/0, (const char *)(album_mode? tag_album_gain_ : tag_title_gain_))))
return false;
- if(0 > (peak_offset = FLAC__metadata_object_vorbiscomment_find_entry_from(block, /*offset=*/0, album_mode? tag_album_peak_ : tag_title_peak_)))
+ if(0 > (peak_offset = FLAC__metadata_object_vorbiscomment_find_entry_from(block, /*offset=*/0, (const char *)(album_mode? tag_album_peak_ : tag_title_peak_))))
return false;
if(!parse_double_(block->data.vorbis_comment.comments + gain_offset, gain))
public:
inline OurFileDecoder(bool ignore_metadata): ignore_metadata_(ignore_metadata), error_occurred_(false) { }
- bool ignore_metadata_;;
+ bool ignore_metadata_;
bool error_occurred_;
protected:
::FLAC__StreamDecoderWriteStatus write_callback(const ::FLAC__Frame *frame, const FLAC__int32 * const buffer[]);
FLAC__StreamEncoderState state;
FLAC__StreamDecoderState dstate;
FLAC__int32 samples[1024];
- FLAC__int32 *samples_array[1] = { samples };
+ FLAC__int32 *samples_array[1];
unsigned i;
+ samples_array[0] = samples;
+
printf("\n+++ libFLAC unit test: FLAC__StreamEncoder\n\n");
printf("testing FLAC__stream_encoder_new()... ");
FLAC__StreamEncoderState state_;
FLAC__StreamDecoderState dstate;
FLAC__int32 samples[1024];
- FLAC__int32 *samples_array[1] = { samples };
+ FLAC__int32 *samples_array[1];
unsigned i;
+ samples_array[0] = samples;
+
printf("\n+++ libFLAC unit test: FLAC__SeekableStreamEncoder\n\n");
printf("testing FLAC__seekable_stream_encoder_new()... ");
FLAC__StreamEncoderState state__;
FLAC__StreamDecoderState dstate;
FLAC__int32 samples[1024];
- FLAC__int32 *samples_array[1] = { samples };
+ FLAC__int32 *samples_array[1];
unsigned i;
+ samples_array[0] = samples;
+
printf("\n+++ libFLAC unit test: FLAC__FileEncoder\n\n");
printf("testing FLAC__file_encoder_new()... ");
FLAC__StreamEncoderState state_;
FLAC__StreamDecoderState dstate;
FLAC__int32 samples[1024];
- FLAC__int32 *samples_array[1] = { samples };
+ FLAC__int32 *samples_array[1];
unsigned i;
+ samples_array[0] = samples;
+
printf("\n+++ libOggFLAC unit test: OggFLAC__StreamEncoder\n\n");
printf("testing OggFLAC__stream_encoder_new()... ");