From 62db29bfd4f3bbaeca508ef0b6f8979370aa94f2 Mon Sep 17 00:00:00 2001 From: engineer_apple Date: Tue, 3 May 2022 20:49:27 +0000 Subject: [PATCH] remove warnings git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6373 dfc29bdd-3216-0410-991c-e03cc46cb475 --- source/Irrlicht/CXMLReaderImpl.h | 2 +- source/Irrlicht/CXMLWriter.cpp | 4 ++-- source/Irrlicht/CZipReader.cpp | 2 +- source/Irrlicht/jpeglib/jdatadst.c | 2 +- source/Irrlicht/jpeglib/jmemmgr.c | 4 ++-- tools/GUIEditor/CMemoryReadWriteFile.cpp | 6 +++--- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/source/Irrlicht/CXMLReaderImpl.h b/source/Irrlicht/CXMLReaderImpl.h index d2b041b4..38e7e505 100644 --- a/source/Irrlicht/CXMLReaderImpl.h +++ b/source/Irrlicht/CXMLReaderImpl.h @@ -646,7 +646,7 @@ private: \param sizeWithoutHeader: Text size in characters without header */ template - void convertTextData(src_char_type* source, char* pointerToStore, int sizeWithoutHeader) + void convertTextData(src_char_type* source, char* pointerToStore, long sizeWithoutHeader) { // convert little to big endian if necessary if (sizeof(src_char_type) > 1 && diff --git a/source/Irrlicht/CXMLWriter.cpp b/source/Irrlicht/CXMLWriter.cpp index 4e9d6900..9a64e1d7 100644 --- a/source/Irrlicht/CXMLWriter.cpp +++ b/source/Irrlicht/CXMLWriter.cpp @@ -207,7 +207,7 @@ void CXMLWriter::writeText(const wchar_t* text) // Making a member-variable would work, but a lot of memory would stay around after writing. // So the correct solution is probably using fixed block here and always write when that is full. core::stringw s; - s.reserve(wcslen(text)+1); + s.reserve((u32)wcslen(text)+1); const wchar_t* p = text; while(*p) @@ -424,7 +424,7 @@ void CXMLWriterUTF8::writeText(const c8* text) // Making a member-variable would work, but a lot of memory would stay around after writing. // So the correct solution is probably using fixed block here and always write when that is full. core::stringc s; - s.reserve(strlen(text)+1); + s.reserve((u32)strlen(text)+1); const c8* p = text; while(*p) diff --git a/source/Irrlicht/CZipReader.cpp b/source/Irrlicht/CZipReader.cpp index 91574b5c..039d42db 100644 --- a/source/Irrlicht/CZipReader.cpp +++ b/source/Irrlicht/CZipReader.cpp @@ -809,7 +809,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index) pcData+4, propSize, e.header.GeneralBitFlag&0x1?LZMA_FINISH_END:LZMA_FINISH_ANY, &status, &lzmaAlloc); - uncompressedSize = tmpDstSize; // may be different to expected value + uncompressedSize = (u32)tmpDstSize; // may be different to expected value if (decrypted) decrypted->drop(); diff --git a/source/Irrlicht/jpeglib/jdatadst.c b/source/Irrlicht/jpeglib/jdatadst.c index 677e4634..502ec711 100644 --- a/source/Irrlicht/jpeglib/jdatadst.c +++ b/source/Irrlicht/jpeglib/jdatadst.c @@ -182,7 +182,7 @@ term_mem_destination (j_compress_ptr cinfo) my_mem_dest_ptr dest = (my_mem_dest_ptr) cinfo->dest; *dest->outbuffer = dest->buffer; - *dest->outsize = dest->bufsize - dest->pub.free_in_buffer; + *dest->outsize = (unsigned long)(dest->bufsize - dest->pub.free_in_buffer); } diff --git a/source/Irrlicht/jpeglib/jmemmgr.c b/source/Irrlicht/jpeglib/jmemmgr.c index ea934202..35b2e090 100644 --- a/source/Irrlicht/jpeglib/jmemmgr.c +++ b/source/Irrlicht/jpeglib/jmemmgr.c @@ -130,7 +130,7 @@ typedef struct { jvirt_barray_ptr virt_barray_list; /* This counts total space obtained from jpeg_get_small/large */ - long total_space_allocated; + size_t total_space_allocated; /* alloc_sarray and alloc_barray set this value for use by virtual * array routines. @@ -618,7 +618,7 @@ realize_virt_arrays (j_common_ptr cinfo) /* Determine amount of memory to actually use; this is system-dependent. */ avail_mem = jpeg_mem_available(cinfo, space_per_minheight, maximum_space, - mem->total_space_allocated); + (long)mem->total_space_allocated); /* If the maximum space needed is available, make all the buffers full * height; otherwise parcel it out with the same number of minheights diff --git a/tools/GUIEditor/CMemoryReadWriteFile.cpp b/tools/GUIEditor/CMemoryReadWriteFile.cpp index 7a803e0d..1916268f 100644 --- a/tools/GUIEditor/CMemoryReadWriteFile.cpp +++ b/tools/GUIEditor/CMemoryReadWriteFile.cpp @@ -21,12 +21,12 @@ size_t CMemoryReadWriteFile::write(const void* buffer, size_t sizeToWrite) // expand size if (Pos + sizeToWrite > Data.size()) - Data.set_used(Pos+sizeToWrite); + Data.set_used((u32)(Pos+sizeToWrite)); // copy data memcpy( (void*) &Data[Pos], buffer, sizeToWrite); - Pos += sizeToWrite; + Pos += (long)sizeToWrite; return sizeToWrite; @@ -46,7 +46,7 @@ bool CMemoryReadWriteFile::seek(long finalPos, bool relativeMovement) Pos = finalPos; } - if (Pos > (s32)Data.size()) + if (Pos > (long)Data.size()) Data.set_used(Pos+1); return true;