GCC compile fixes under Kubuntu 15.10

This commit is contained in:
Robert Beckebans 2016-07-03 22:51:11 +02:00
parent 8a99249cfd
commit 3d75dbcb4a
4 changed files with 9 additions and 84 deletions

View file

@ -100,12 +100,16 @@ bool AssertFailed( const char* file, int line, const char* expression );
#if !defined( __TYPEINFOGEN__ ) && !defined( _lint ) // pcLint has problems with assert_offsetof()
#if __cplusplus >= 201103L
#define compile_time_assert( x ) static_assert( x, "Assertion failure" )
#else
template<bool> struct compile_time_assert_failed;
template<> struct compile_time_assert_failed<true> {};
template<int x> struct compile_time_assert_test {};
#define compile_time_assert_join2( a, b ) a##b
#define compile_time_assert_join( a, b ) compile_time_assert_join2(a,b)
#define compile_time_assert( x ) typedef compile_time_assert_test<sizeof(compile_time_assert_failed<(bool)(x)>)> compile_time_assert_join(compile_time_assert_typedef_, __LINE__)
#endif
#define assert_sizeof( type, size ) compile_time_assert( sizeof( type ) == size )
#define assert_sizeof_8_byte_multiple( type ) compile_time_assert( ( sizeof( type ) & 7 ) == 0 )

View file

@ -826,77 +826,6 @@ void idSWF::SetBackgroundColor( idSWFBitStream& bitstream )
// RB begin
struct MyHandler
{
bool Null()
{
idLib::Printf( "Null()\n" );
return true;
}
bool Bool( bool b )
{
idLib::Printf( "Bool( %i )\n", b );
return true;
}
bool Int( int i )
{
idLib::Printf( "Int( %i )\n", i ) ;
return true;
}
bool Uint( unsigned u )
{
idLib::Printf( "Uint( %d )\n", u );
return true;
}
bool Int64( int64_t i )
{
idLib::Printf( "Int64( %i )\n", i );
return true;
}
bool Uint64( uint64_t u )
{
idLib::Printf( "Uint64( %d )\n", u );
return true;
}
bool Double( double d )
{
idLib::Printf( "Double( %f )\n", d );
return true;
}
bool String( const char* str, SizeType length, bool copy )
{
idLib::Printf( "String( %s, %i, %i )\n", str, length, copy );
return true;
}
bool StartObject()
{
idLib::Printf( "StartObject()\n" );
return true;
}
bool Key( const char* str, SizeType length, bool copy )
{
idLib::Printf( "Key( %s, %i, %i )\n", str, length, copy );
return true;
}
bool EndObject( SizeType memberCount )
{
idLib::Printf( "EndObject( %i )\n", memberCount );
return true;
}
bool StartArray()
{
idLib::Printf( "StartArray()\n" );
return true;
}
bool EndArray( SizeType elementCount )
{
idLib::Printf( "EndArray( %i )\n", elementCount );
return true;
}
};
/*
===================
idSWF::LoadJSON
@ -915,14 +844,6 @@ bool idSWF::LoadJSON( const char* filename )
size_t fileSize = f->Read( ( byte* ) fileData, fileLength );
delete f;
#if 0
Reader reader;
StringStream ss( fileData );
MyHandler handler;
reader.Parse( ss, handler );
#endif
rapidjson::Document d;
d.Parse( fileData );

View file

@ -2316,7 +2316,7 @@ idStr idSWFScriptFunction_Script::ExportToScript( idSWFScriptObject* thisObject,
}
else
{
line = va( "function %( ", functionName.c_str() );
line = va( "function %s( ", functionName.c_str() );
}
uint16 numParms = bitstream.ReadU16();
@ -2392,7 +2392,7 @@ idStr idSWFScriptFunction_Script::ExportToScript( idSWFScriptObject* thisObject,
}
else
{
line = va( "function %( ", functionName.c_str() );
line = va( "function %s( ", functionName.c_str() );
}
for( int i = 0; i < numParms; i++ )
@ -2584,7 +2584,7 @@ idStr idSWFScriptFunction_Script::ExportToScript( idSWFScriptObject* thisObject,
//actionScript += line;
//line.Empty();
idStr& member = stack.A().ToString();
const idStr& member = stack.A().ToString();
//if( stack.A().IsString() )
//{
// stack.B().SetResult( va( "%s[\"%s\"]", stack.B().ToString().c_str(), stack.A().ToString().c_str() ) );

View file

@ -453,7 +453,7 @@ void idSWFSprite::ReadJSON( rapidjson::Value& entry )
idFile_SWF file( new idFile_Memory() );
idBase64 base64 = command["stream"].GetString();
idBase64 base64( command["stream"].GetString() );
base64.Decode( file );
uint32 streamLength = file->Length() - 1; // skip trailing zero added by Decode()