diff --git a/modules/juce_core/native/juce_win32_Files.cpp b/modules/juce_core/native/juce_win32_Files.cpp index 8dabf7db03..6dab87dcd4 100644 --- a/modules/juce_core/native/juce_win32_Files.cpp +++ b/modules/juce_core/native/juce_win32_Files.cpp @@ -52,10 +52,10 @@ namespace WindowsFileHelpers if (path.isNotEmpty() && path[1] == ':' && path[2] == 0) path << '\\'; - const int numBytes = CharPointer_UTF16::getBytesRequiredFor (path.getCharPointer()) + 4; + const size_t numBytes = CharPointer_UTF16::getBytesRequiredFor (path.getCharPointer()) + 4; HeapBlock pathCopy; pathCopy.calloc (numBytes, 1); - path.copyToUTF16 (pathCopy, numBytes); + path.copyToUTF16 (pathCopy, (int) numBytes); if (PathStripToRoot (pathCopy)) path = static_cast (pathCopy); @@ -169,10 +169,10 @@ bool File::moveToTrash() const return true; // The string we pass in must be double null terminated.. - const int numBytes = CharPointer_UTF16::getBytesRequiredFor (fullPath.getCharPointer()) + 8; + const size_t numBytes = CharPointer_UTF16::getBytesRequiredFor (fullPath.getCharPointer()) + 8; HeapBlock doubleNullTermPath; doubleNullTermPath.calloc (numBytes, 1); - fullPath.copyToUTF16 (doubleNullTermPath, numBytes); + fullPath.copyToUTF16 (doubleNullTermPath, (int) numBytes); SHFILEOPSTRUCT fos = { 0 }; fos.wFunc = FO_DELETE; @@ -704,7 +704,10 @@ bool Process::openDocument (const String& fileName, const String& parameters) void File::revealToUser() const { + #pragma warning (push) + #pragma warning (disable: 4090) // (alignment warning) ITEMIDLIST* const itemIDList = ILCreateFromPath (fullPath.toWideCharPointer()); + #pragma warning (pop) if (itemIDList != nullptr) { diff --git a/modules/juce_core/streams/juce_MemoryOutputStream.cpp b/modules/juce_core/streams/juce_MemoryOutputStream.cpp index 4ff05f9c2f..50536a54f6 100644 --- a/modules/juce_core/streams/juce_MemoryOutputStream.cpp +++ b/modules/juce_core/streams/juce_MemoryOutputStream.cpp @@ -162,7 +162,7 @@ String MemoryOutputStream::toString() const OutputStream& JUCE_CALLTYPE operator<< (OutputStream& stream, const MemoryOutputStream& streamToRead) { - stream.write (streamToRead.getData(), streamToRead.getDataSize()); + stream.write (streamToRead.getData(), (int) streamToRead.getDataSize()); return stream; } diff --git a/modules/juce_core/zip/juce_GZIPCompressorOutputStream.cpp b/modules/juce_core/zip/juce_GZIPCompressorOutputStream.cpp index abb6282a1a..858ceccc25 100644 --- a/modules/juce_core/zip/juce_GZIPCompressorOutputStream.cpp +++ b/modules/juce_core/zip/juce_GZIPCompressorOutputStream.cpp @@ -181,11 +181,11 @@ public: { MemoryBlock data (rng.nextInt (2000) + 1); - for (int k = data.getSize(); --k >= 0;) + for (int k = (int) data.getSize(); --k >= 0;) data[k] = (char) rng.nextInt (255); - original.write (data.getData(), data.getSize()); - zipper .write (data.getData(), data.getSize()); + original.write (data.getData(), (int) data.getSize()); + zipper .write (data.getData(), (int) data.getSize()); } } diff --git a/modules/juce_graphics/image_formats/pnglib/pngrutil.c b/modules/juce_graphics/image_formats/pnglib/pngrutil.c index f6973659ae..6a705a4a6f 100644 --- a/modules/juce_graphics/image_formats/pnglib/pngrutil.c +++ b/modules/juce_graphics/image_formats/pnglib/pngrutil.c @@ -3143,7 +3143,7 @@ defined(PNG_USER_TRANSFORM_PTR_SUPPORTED) if ((png_uint_32)png_ptr->rowbytes + 1 > (png_uint_32)65536L) png_error(png_ptr, "This image requires a row greater than 64KB"); #endif - if ((png_uint_32)png_ptr->rowbytes > (png_uint_32)(PNG_SIZE_MAX - 1)) + if ((png_uint_32)png_ptr->rowbytes > (png_uint_32) -2) png_error(png_ptr, "Row has too many bytes to allocate in memory."); png_ptr->prev_row = (png_bytep)png_malloc(png_ptr, (png_uint_32)( png_ptr->rowbytes + 1)); diff --git a/modules/juce_graphics/native/juce_win32_DirectWriteTypeface.cpp b/modules/juce_graphics/native/juce_win32_DirectWriteTypeface.cpp index 0ac1775d32..0f1869c7fe 100644 --- a/modules/juce_graphics/native/juce_win32_DirectWriteTypeface.cpp +++ b/modules/juce_graphics/native/juce_win32_DirectWriteTypeface.cpp @@ -136,10 +136,10 @@ public: const size_t len = textUTF32.length(); HeapBlock glyphIndices (len); - dwFontFace->GetGlyphIndices (textUTF32, len, glyphIndices); + dwFontFace->GetGlyphIndices (textUTF32, (UINT32) len, glyphIndices); HeapBlock dwGlyphMetrics (len); - dwFontFace->GetDesignGlyphMetrics (glyphIndices, len, dwGlyphMetrics, false); + dwFontFace->GetDesignGlyphMetrics (glyphIndices, (UINT32) len, dwGlyphMetrics, false); float x = 0; for (size_t i = 0; i < len; ++i) @@ -156,9 +156,9 @@ public: const size_t len = textUTF32.length(); HeapBlock glyphIndices (len); - dwFontFace->GetGlyphIndices (textUTF32, len, glyphIndices); + dwFontFace->GetGlyphIndices (textUTF32, (UINT32) len, glyphIndices); HeapBlock dwGlyphMetrics (len); - dwFontFace->GetDesignGlyphMetrics (glyphIndices, len, dwGlyphMetrics, false); + dwFontFace->GetDesignGlyphMetrics (glyphIndices, (UINT32) len, dwGlyphMetrics, false); float x = 0; for (size_t i = 0; i < len; ++i) diff --git a/modules/juce_gui_basics/native/juce_win32_Windowing.cpp b/modules/juce_gui_basics/native/juce_win32_Windowing.cpp index a7726d1ff6..feabc5169a 100644 --- a/modules/juce_gui_basics/native/juce_win32_Windowing.cpp +++ b/modules/juce_gui_basics/native/juce_win32_Windowing.cpp @@ -959,7 +959,7 @@ private: // this name has to be different for each app/dll instance because otherwise poor old Windows can // get a bit confused (even despite it not being a process-global window class). String windowClassName ("JUCE_"); - windowClassName << (int) (Time::currentTimeMillis() & 0x7fffffff); + windowClassName << String::toHexString (Time::currentTimeMillis()); HINSTANCE moduleHandle = (HINSTANCE) Process::getCurrentModuleInstanceHandle();