Merge pull request #709 from rtollert/rtollert-buildfixes

Build fixes tested on Kubuntu 22.04 with clang 14 and gcc 11.
Thank you for your contribution!
This commit is contained in:
Robert Beckebans 2022-10-24 01:01:20 +02:00 committed by GitHub
commit 56a10e7136
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 70 additions and 4 deletions

View file

@ -104,6 +104,17 @@ private:
memcpy( data, other.data, other.dataSize );
return *this;
}
idBinaryImageData& operator=( idBinaryImageData&& other )
{
if( this == &other )
{
return *this;
}
dataSize = other.dataSize;
data = other.data;
other.data = NULL;
return *this;
}
void Free()
{
if( data != NULL )

View file

@ -2808,7 +2808,7 @@ fill_input_buffer( j_decompress_ptr cinfo )
*/
#ifdef USE_NEWER_JPEG
METHODDEF()
METHODDEF(void)
#else
METHODDEF void
#endif
@ -2836,7 +2836,7 @@ init_source( j_decompress_ptr cinfo )
*/
#ifdef USE_NEWER_JPEG
METHODDEF()
METHODDEF(void)
#else
METHODDEF void
#endif
@ -2876,7 +2876,7 @@ skip_input_data( j_decompress_ptr cinfo, long num_bytes )
*/
#ifdef USE_NEWER_JPEG
METHODDEF()
METHODDEF(void)
#else
METHODDEF void
#endif
@ -2887,7 +2887,7 @@ term_source( j_decompress_ptr cinfo )
}
#ifdef USE_NEWER_JPEG
GLOBAL()
GLOBAL(void)
#else
GLOBAL void
#endif

View file

@ -50,6 +50,7 @@ public:
idSWFDictionaryEntry();
~idSWFDictionaryEntry();
idSWFDictionaryEntry& operator=( idSWFDictionaryEntry& other );
idSWFDictionaryEntry& operator=( idSWFDictionaryEntry&& other );
swfDictType_t type;
const idMaterial* material;

View file

@ -84,6 +84,33 @@ idSWFBitStream& idSWFBitStream::operator=( idSWFBitStream& other )
return *this;
}
/*
========================
idSWFBitStream::operator=
========================
*/
idSWFBitStream& idSWFBitStream::operator=( idSWFBitStream&& other )
{
Free();
free = other.free;
startp = other.startp;
readp = other.readp;
endp = other.endp;
currentBit = other.currentBit;
currentByte = other.currentByte;
if( other.free )
{
// this is actually quite dangerous, but we need to do this
// because these things are copied around inside idList
other.free = false;
}
other.readp = NULL;
other.endp = NULL;
other.currentBit = 0;
other.currentByte = 0;
return *this;
}
/*
========================
idSWFBitStream::Free

View file

@ -43,6 +43,7 @@ public:
}
idSWFBitStream& operator=( idSWFBitStream& other );
idSWFBitStream& operator=( idSWFBitStream&& other );
void Load( const byte* data, uint32 len, bool copy );
void Free();

View file

@ -88,6 +88,32 @@ idSWFDictionaryEntry& idSWFDictionaryEntry::operator=( idSWFDictionaryEntry& oth
return *this;
}
/*
========================
idSWF::idSWFDictionaryEntry::operator= (move)
========================
*/
idSWFDictionaryEntry& idSWFDictionaryEntry::operator=( idSWFDictionaryEntry&& other )
{
type = other.type;
material = other.material;
shape = other.shape;
sprite = other.sprite;
font = other.font;
text = other.text;
edittext = other.edittext;
imageSize = other.imageSize;
imageAtlasOffset = other.imageAtlasOffset;
other.type = SWF_DICT_NULL;
other.material = NULL;
other.shape = NULL;
other.sprite = NULL;
other.font = NULL;
other.text = NULL;
other.edittext = NULL;
return *this;
}
/*
========================
idSWF::AddDictionaryEntry