Browse Source

Removed a couple of minor compiler warnings

tags/2021-05-28
Julian Storer 15 years ago
parent
commit
9720e2deb0
4 changed files with 12 additions and 16 deletions
  1. +6
    -8
      juce_amalgamated.cpp
  2. +2
    -4
      src/io/files/juce_FileInputStream.cpp
  3. +1
    -1
      src/io/network/juce_URL.cpp
  4. +3
    -3
      src/io/streams/juce_MemoryOutputStream.cpp

+ 6
- 8
juce_amalgamated.cpp View File

@@ -8104,8 +8104,6 @@ int64 FileInputStream::getTotalLength()

int FileInputStream::read (void* buffer, int bytesToRead)
{
int num = 0;

if (needToSeek)
{
if (juce_fileSetPosition (fileHandle, currentPosition) < 0)
@@ -8114,10 +8112,10 @@ int FileInputStream::read (void* buffer, int bytesToRead)
needToSeek = false;
}

num = readInternal (buffer, bytesToRead);
const size_t num = readInternal (buffer, bytesToRead);
currentPosition += num;

return num;
return (int) num;
}

bool FileInputStream::isExhausted()
@@ -9279,7 +9277,7 @@ namespace URLHelpers

// just a short text attachment, so use simple url encoding..
headers << "Content-Type: application/x-www-form-urlencoded\r\nContent-length: "
<< postData.getSize() << "\r\n";
<< (unsigned int) postData.getSize() << "\r\n";
}
}
}
@@ -9984,7 +9982,7 @@ bool MemoryOutputStream::write (const void* const buffer, int howMany)
const size_t storageNeeded = position + howMany;

if (storageNeeded >= data.getSize())
data.ensureSize ((storageNeeded + jmin (storageNeeded / 2, (size_t) (1024 * 1024)) + 32) & ~31);
data.ensureSize ((storageNeeded + jmin ((int) (storageNeeded / 2), 1024 * 1024) + 32) & ~31);

memcpy (static_cast<char*> (data.getData()) + position, buffer, howMany);
position += howMany;
@@ -10042,12 +10040,12 @@ const String MemoryOutputStream::toUTF8() const

const String MemoryOutputStream::toString() const
{
return String::createStringFromData (getData(), getDataSize());
return String::createStringFromData (getData(), (int) getDataSize());
}

OutputStream& JUCE_CALLTYPE operator<< (OutputStream& stream, const MemoryOutputStream& streamToRead)
{
stream.write (streamToRead.getData(), streamToRead.getDataSize());
stream.write (streamToRead.getData(), (int) streamToRead.getDataSize());
return stream;
}



+ 2
- 4
src/io/files/juce_FileInputStream.cpp View File

@@ -58,8 +58,6 @@ int64 FileInputStream::getTotalLength()
int FileInputStream::read (void* buffer, int bytesToRead)
{
int num = 0;
if (needToSeek)
{
if (juce_fileSetPosition (fileHandle, currentPosition) < 0)
@@ -68,10 +66,10 @@ int FileInputStream::read (void* buffer, int bytesToRead)
needToSeek = false;
}
num = readInternal (buffer, bytesToRead);
const size_t num = readInternal (buffer, bytesToRead);
currentPosition += num;
return num;
return (int) num;
}
bool FileInputStream::isExhausted()


+ 1
- 1
src/io/network/juce_URL.cpp View File

@@ -179,7 +179,7 @@ namespace URLHelpers
// just a short text attachment, so use simple url encoding..
headers << "Content-Type: application/x-www-form-urlencoded\r\nContent-length: "
<< postData.getSize() << "\r\n";
<< (unsigned int) postData.getSize() << "\r\n";
}
}
}


+ 3
- 3
src/io/streams/juce_MemoryOutputStream.cpp View File

@@ -78,7 +78,7 @@ bool MemoryOutputStream::write (const void* const buffer, int howMany)
const size_t storageNeeded = position + howMany;
if (storageNeeded >= data.getSize())
data.ensureSize ((storageNeeded + jmin (storageNeeded / 2, (size_t) (1024 * 1024)) + 32) & ~31);
data.ensureSize ((storageNeeded + jmin ((int) (storageNeeded / 2), 1024 * 1024) + 32) & ~31);
memcpy (static_cast<char*> (data.getData()) + position, buffer, howMany);
position += howMany;
@@ -136,12 +136,12 @@ const String MemoryOutputStream::toUTF8() const
const String MemoryOutputStream::toString() const
{
return String::createStringFromData (getData(), getDataSize());
return String::createStringFromData (getData(), (int) getDataSize());
}
OutputStream& JUCE_CALLTYPE operator<< (OutputStream& stream, const MemoryOutputStream& streamToRead)
{
stream.write (streamToRead.getData(), streamToRead.getDataSize());
stream.write (streamToRead.getData(), (int) streamToRead.getDataSize());
return stream;
}


Loading…
Cancel
Save