fixes from compiling code and running all the tests on NT

This commit is contained in:
Josh Coalson
2002-06-11 06:15:28 +00:00
parent a6a773b3ae
commit d57c8d31e3
12 changed files with 88 additions and 54 deletions

View File

@@ -17,7 +17,7 @@
!include <win32.mak>
SUFFIXES = .cpp
SUFFIXES = .cc
!IFDEF DEBUG
.c.obj:
@@ -29,10 +29,10 @@ SUFFIXES = .cpp
!IFDEF DEBUG
.cc.obj:
$(cc) /D "_LIB" /GX $(cdebug) $(cflags) /I "..\..\include" -DSTRICT -YX /Od /D "_DEBUG" $<
$(cc) /GR /D "_LIB" /GX $(cdebug) $(cflags) /I "..\..\include" -DSTRICT -YX /Od /D "_DEBUG" $<
!else
.cc.obj:
$(cc) /D "_LIB" /O2 $(crelease) $(cflags) /I "..\..\include" -DSTRICT -YX -DNODEBUG $<
$(cc) /GR /D "_LIB" /O2 $(crelease) $(cflags) /I "..\..\include" -DSTRICT -YX -DNODEBUG $<
!endif
C_FILES= \
@@ -46,8 +46,10 @@ CC_FILES= \
metadata_manip.cc \
metadata_object.cc
OBJS= $(C_FILES:.c=.obj)
OBJS= $(CC_FILES:.cc=.obj)
C_OBJS= $(C_FILES:.c=.obj)
CC_OBJS= $(CC_FILES:.cc=.obj)
all: test_libFLAC++.exe
# can't figure out how to get it to take .cc so we just hack it for now:
decoders.obj: decoders.cc
@@ -63,10 +65,8 @@ metadata_manip.obj: metadata_manip.cc
metadata_object.obj: metadata_object.cc
$(cc) /D "_LIB" /O2 $(crelease) $(cflags) /I "..\..\include" -DSTRICT -YX -DNODEBUG /TP metadata_object.cc
all: test_libFLAC++.exe
test_libFLAC++.exe: $(OBJS)
link.exe /libpath:"..\..\obj\lib" -out:../../obj/bin/$*.exe $(OBJS) libFLAC++.lib libFLAC.lib
test_libFLAC++.exe: $(C_OBJS) $(CC_OBJS)
link.exe /libpath:"..\..\obj\lib" -out:../../obj/bin/$*.exe $(CC_OBJS) $(C_OBJS) libFLAC++.lib libFLAC.lib
clean:
-del *.obj *.pch

View File

@@ -258,12 +258,12 @@ public:
void StreamDecoder::metadata_callback(const ::FLAC__StreamMetadata *metadata)
{
return common_metadata_callback_(metadata);
common_metadata_callback_(metadata);
}
void StreamDecoder::error_callback(::FLAC__StreamDecoderErrorStatus status)
{
return common_error_callback_(status);
common_error_callback_(status);
}
bool StreamDecoder::die(const char *msg) const
@@ -830,7 +830,7 @@ public:
if(error_occurred_)
return ::FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_ERROR;
if(::fseek(file_, absolute_byte_offset, SEEK_SET) < 0) {
if(::fseek(file_, (long)absolute_byte_offset, SEEK_SET) < 0) {
error_occurred_ = true;
return ::FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_ERROR;
}
@@ -868,7 +868,7 @@ bool SeekableStreamDecoder::eof_callback()
if(error_occurred_)
return true;
return feof(file_);
return (bool)feof(file_);
}
::FLAC__StreamDecoderWriteStatus SeekableStreamDecoder::write_callback(const ::FLAC__Frame *frame, const FLAC__int32 * const buffer[])

View File

@@ -19,8 +19,8 @@
#include "metadata.h"
#include <stdio.h>
extern int test_metadata_object();
extern int test_metadata_file_manipulation();
extern bool test_metadata_object();
extern bool test_metadata_file_manipulation();
bool test_metadata()
{

View File

@@ -639,7 +639,7 @@ static bool test_level_1_()
return die_ss_("iterator.insert_block_after(app, true)", iterator);
if(!insert_to_our_metadata_(app, ++our_current_position, /*copy=*/true))
return false;
add_to_padding_length_(our_current_position+1, -((FLAC__STREAM_METADATA_APPLICATION_ID_LEN/8) + app->get_length()));
add_to_padding_length_(our_current_position+1, -((int)(FLAC__STREAM_METADATA_APPLICATION_ID_LEN/8) + (int)app->get_length()));
if(!test_file_(flacfile_, /*ignore_metadata=*/false))
return false;
@@ -655,7 +655,7 @@ static bool test_level_1_()
return die_ss_("iterator.set_block(app, true)", iterator);
if(!insert_to_our_metadata_(app, our_current_position, /*copy=*/true))
return false;
add_to_padding_length_(our_current_position+1, -((FLAC__STREAM_METADATA_APPLICATION_ID_LEN/8) + app->get_length()));
add_to_padding_length_(our_current_position+1, -((int)(FLAC__STREAM_METADATA_APPLICATION_ID_LEN/8) + (int)app->get_length()));
if(!test_file_(flacfile_, /*ignore_metadata=*/false))
return false;
@@ -690,7 +690,7 @@ static bool test_level_1_()
return die_("setting APPLICATION data");
if(!replace_in_our_metadata_(app, our_current_position, /*copy=*/true))
return die_("copying object");
add_to_padding_length_(our_current_position+1, -(sizeof(data) - 12));
add_to_padding_length_(our_current_position+1, -((int)sizeof(data) - 12));
if(!iterator.set_block(app, true))
return die_ss_("iterator.set_block(app, true)", iterator);

View File

@@ -271,7 +271,7 @@ bool test_metadata_object_streaminfo()
printf("OK\n");
printf("testing FLAC::Metadata::clone(const FLAC::Metadata::Prototype *)... ");
FLAC::Metadata::Prototype *clone_ = clone(&block);
FLAC::Metadata::Prototype *clone_ = FLAC::Metadata::clone(&block);
if(0 == clone_)
return die_("returned NULL");
if(0 == dynamic_cast<FLAC::Metadata::StreamInfo *>(clone_))
@@ -381,7 +381,7 @@ bool test_metadata_object_padding()
printf("OK\n");
printf("testing FLAC::Metadata::clone(const FLAC::Metadata::Prototype *)... ");
FLAC::Metadata::Prototype *clone_ = clone(&block);
FLAC::Metadata::Prototype *clone_ = FLAC::Metadata::clone(&block);
if(0 == clone_)
return die_("returned NULL");
if(0 == dynamic_cast<FLAC::Metadata::Padding *>(clone_))
@@ -500,7 +500,7 @@ bool test_metadata_object_application()
printf("OK\n");
printf("testing FLAC::Metadata::clone(const FLAC::Metadata::Prototype *)... ");
FLAC::Metadata::Prototype *clone_ = clone(&block);
FLAC::Metadata::Prototype *clone_ = FLAC::Metadata::clone(&block);
if(0 == clone_)
return die_("returned NULL");
if(0 == dynamic_cast<FLAC::Metadata::Application *>(clone_))
@@ -648,7 +648,7 @@ bool test_metadata_object_seektable()
printf("OK\n");
printf("testing FLAC::Metadata::clone(const FLAC::Metadata::Prototype *)... ");
FLAC::Metadata::Prototype *clone_ = clone(&block);
FLAC::Metadata::Prototype *clone_ = FLAC::Metadata::clone(&block);
if(0 == clone_)
return die_("returned NULL");
if(0 == dynamic_cast<FLAC::Metadata::SeekTable *>(clone_))
@@ -934,7 +934,7 @@ bool test_metadata_object_vorbiscomment()
printf("OK\n");
printf("testing FLAC::Metadata::clone(const FLAC::Metadata::Prototype *)... ");
FLAC::Metadata::Prototype *clone_ = clone(&block);
FLAC::Metadata::Prototype *clone_ = FLAC::Metadata::clone(&block);
if(0 == clone_)
return die_("returned NULL");
if(0 == dynamic_cast<FLAC::Metadata::VorbisComment *>(clone_))