1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-27 02:20:05 +00:00

Minor fixes to avoid compiler warnings

This commit is contained in:
Julian Storer 2010-01-15 15:06:24 +00:00
parent e61e8f6775
commit 55306275b1
8 changed files with 22 additions and 19 deletions

View file

@ -243,12 +243,12 @@ int MemoryBlock::getBitRange (const size_t bitRangeStart, size_t numBits) const
int res = 0;
size_t byte = bitRangeStart >> 3;
size_t offsetInByte = bitRangeStart & 7;
int offsetInByte = bitRangeStart & 7;
size_t bitsSoFar = 0;
while (numBits > 0 && (size_t) byte < size)
{
const size_t bitsThisTime = jmin (numBits, 8 - offsetInByte);
const int bitsThisTime = jmin ((int) numBits, 8 - offsetInByte);
const int mask = (0xff >> (8 - bitsThisTime)) << offsetInByte;
res |= (((data[byte] & mask) >> offsetInByte) << bitsSoFar);
@ -265,12 +265,12 @@ int MemoryBlock::getBitRange (const size_t bitRangeStart, size_t numBits) const
void MemoryBlock::setBitRange (const size_t bitRangeStart, size_t numBits, int bitsToSet) throw()
{
size_t byte = bitRangeStart >> 3;
size_t offsetInByte = bitRangeStart & 7;
int offsetInByte = bitRangeStart & 7;
unsigned int mask = ~((((unsigned int)0xffffffff) << (32 - numBits)) >> (32 - numBits));
while (numBits > 0 && (size_t) byte < size)
{
const size_t bitsThisTime = jmin (numBits, 8 - offsetInByte);
const int bitsThisTime = jmin ((int) numBits, 8 - offsetInByte);
const unsigned int tempMask = (mask << offsetInByte) | ~((((unsigned int)0xffffffff) >> offsetInByte) << offsetInByte);
const unsigned int tempBits = bitsToSet << offsetInByte;