add some asserts

This commit is contained in:
Josh Coalson 2002-07-11 05:54:05 +00:00
parent 4b974e7c13
commit d8ab3468fa
2 changed files with 6 additions and 5 deletions

View File

@ -487,6 +487,7 @@ FLAC__bool FLAC__metadata_simple_iterator_set_block(FLAC__Metadata_SimpleIterato
FLAC__ASSERT(0 != iterator);
FLAC__ASSERT(0 != iterator->file);
FLAC__ASSERT(0 != block);
if(!iterator->is_writable) {
iterator->status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_NOT_WRITABLE;
@ -587,6 +588,7 @@ FLAC__bool FLAC__metadata_simple_iterator_insert_block_after(FLAC__Metadata_Simp
FLAC__ASSERT(0 != iterator);
FLAC__ASSERT(0 != iterator->file);
FLAC__ASSERT(0 != block);
if(!iterator->is_writable)
return false;

View File

@ -432,6 +432,9 @@ static FLAC__bool compare_block_data_vorbiscomment_(const FLAC__StreamMetadata_V
FLAC__bool FLAC__metadata_object_is_equal(const FLAC__StreamMetadata *block1, const FLAC__StreamMetadata *block2)
{
FLAC__ASSERT(0 != block1);
FLAC__ASSERT(0 != block2);
if(block1->type != block2->type) {
return false;
}
@ -458,15 +461,11 @@ FLAC__bool FLAC__metadata_object_is_equal(const FLAC__StreamMetadata *block1, co
}
}
/*@@@move
sets the application data to 'data'. if 'copy' is true, makes, copy, else takes ownership of pointer. returns false if copy==true and malloc fails.
FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_APPLICATION);
FLAC__ASSERT((0 != data && length > 0) || (0 == data && length == 0 && copy == false));
*/
FLAC__bool FLAC__metadata_object_application_set_data(FLAC__StreamMetadata *object, FLAC__byte *data, unsigned length, FLAC__bool copy)
{
FLAC__byte *save;
FLAC__ASSERT(0 != object);
FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_APPLICATION);
FLAC__ASSERT((0 != data && length > 0) || (0 == data && length == 0 && copy == false));