Browse Source

Cleaned up a few 64-bit VC++ warnings.

tags/2021-05-28
jules 13 years ago
parent
commit
38703ee4c3
6 changed files with 17 additions and 14 deletions
  1. +7
    -4
      modules/juce_core/native/juce_win32_Files.cpp
  2. +1
    -1
      modules/juce_core/streams/juce_MemoryOutputStream.cpp
  3. +3
    -3
      modules/juce_core/zip/juce_GZIPCompressorOutputStream.cpp
  4. +1
    -1
      modules/juce_graphics/image_formats/pnglib/pngrutil.c
  5. +4
    -4
      modules/juce_graphics/native/juce_win32_DirectWriteTypeface.cpp
  6. +1
    -1
      modules/juce_gui_basics/native/juce_win32_Windowing.cpp

+ 7
- 4
modules/juce_core/native/juce_win32_Files.cpp View File

@@ -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<WCHAR> pathCopy;
pathCopy.calloc (numBytes, 1);
path.copyToUTF16 (pathCopy, numBytes);
path.copyToUTF16 (pathCopy, (int) numBytes);
if (PathStripToRoot (pathCopy))
path = static_cast <const WCHAR*> (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<WCHAR> 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)
{


+ 1
- 1
modules/juce_core/streams/juce_MemoryOutputStream.cpp View File

@@ -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;
}


+ 3
- 3
modules/juce_core/zip/juce_GZIPCompressorOutputStream.cpp View File

@@ -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());
}
}


+ 1
- 1
modules/juce_graphics/image_formats/pnglib/pngrutil.c View File

@@ -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));


+ 4
- 4
modules/juce_graphics/native/juce_win32_DirectWriteTypeface.cpp View File

@@ -136,10 +136,10 @@ public:
const size_t len = textUTF32.length();
HeapBlock <UINT16> glyphIndices (len);
dwFontFace->GetGlyphIndices (textUTF32, len, glyphIndices);
dwFontFace->GetGlyphIndices (textUTF32, (UINT32) len, glyphIndices);
HeapBlock <DWRITE_GLYPH_METRICS> 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 <UINT16> glyphIndices (len);
dwFontFace->GetGlyphIndices (textUTF32, len, glyphIndices);
dwFontFace->GetGlyphIndices (textUTF32, (UINT32) len, glyphIndices);
HeapBlock <DWRITE_GLYPH_METRICS> 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)


+ 1
- 1
modules/juce_gui_basics/native/juce_win32_Windowing.cpp View File

@@ -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();


Loading…
Cancel
Save