more type mismatch warning fixes

This commit is contained in:
Brad Hefta-Gaub 2014-01-13 00:46:43 -08:00
parent 55babbf7b6
commit a290017746
4 changed files with 15 additions and 15 deletions

View file

@ -76,7 +76,7 @@ void Oscilloscope::addSamples(const QByteArray& audioByteArray, bool isStereo, b
return;
}
int numSamplesPerChannel = audioByteArray.size() / (sizeof(int16_t) * (isStereo ? 2 : 1));
unsigned numSamplesPerChannel = audioByteArray.size() / (sizeof(int16_t) * (isStereo ? 2 : 1));
int16_t* samples = (int16_t*) audioByteArray.data();
for (int channel = 0; channel < (isStereo ? 2 : 1); channel++) {
@ -107,7 +107,7 @@ void Oscilloscope::addSamples(const QByteArray& audioByteArray, bool isStereo, b
}
} else {
// we have interleaved samples we need to separate into two channels
for (int i = 0; i < numSamplesPerChannel + n2; i++) {
for (unsigned i = 0; i < numSamplesPerChannel + n2; i++) {
if (i < numSamplesPerChannel - n2) {
_samples[writePos] = samples[(i * 2) + channel];
} else {

View file

@ -58,7 +58,7 @@ void JurisdictionMap::copyContents(unsigned char* rootCodeIn, const std::vector<
*rootCode = 0;
}
for (int i = 0; i < endNodesIn.size(); i++) {
for (size_t i = 0; i < endNodesIn.size(); i++) {
if (endNodesIn[i]) {
int bytes = bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(endNodesIn[i]));
unsigned char* endNodeCode = new unsigned char[bytes];
@ -84,7 +84,7 @@ void JurisdictionMap::clear() {
_rootOctalCode = NULL;
}
for (int i = 0; i < _endNodes.size(); i++) {
for (size_t i = 0; i < _endNodes.size(); i++) {
if (_endNodes[i]) {
delete[] _endNodes[i];
}
@ -193,7 +193,7 @@ JurisdictionMap::Area JurisdictionMap::isMyJurisdiction(const unsigned char* nod
bool isInJurisdiction = isAncestorOf(_rootOctalCode, nodeOctalCode, childIndex);
// if we're under the root, then we can't be under any of the endpoints
if (isInJurisdiction) {
for (int i = 0; i < _endNodes.size(); i++) {
for (size_t i = 0; i < _endNodes.size(); i++) {
bool isUnderEndNode = isAncestorOf(_endNodes[i], nodeOctalCode);
if (isUnderEndNode) {
isInJurisdiction = false;
@ -236,7 +236,7 @@ void JurisdictionMap::displayDebugDetails() const {
qDebug() << "root:" << rootNodeValue << "\n";
for (int i = 0; i < _endNodes.size(); i++) {
for (size_t i = 0; i < _endNodes.size(); i++) {
QString value = octalCodeToHexString(_endNodes[i]);
qDebug() << "End node[" << i << "]: " << rootNodeValue << "\n";
}
@ -253,7 +253,7 @@ bool JurisdictionMap::writeToFile(const char* filename) {
settings.setValue("root", rootNodeValue);
settings.beginGroup("endNodes");
for (int i = 0; i < _endNodes.size(); i++) {
for (size_t i = 0; i < _endNodes.size(); i++) {
QString key = QString("endnode%1").arg(i);
QString value = octalCodeToHexString(_endNodes[i]);
settings.setValue(key, value);

View file

@ -108,7 +108,7 @@ void OctreeSceneStats::copyFromOther(const OctreeSceneStats& other) {
delete[] _jurisdictionRoot;
_jurisdictionRoot = NULL;
}
for (int i=0; i < _jurisdictionEndNodes.size(); i++) {
for (size_t i = 0; i < _jurisdictionEndNodes.size(); i++) {
if (_jurisdictionEndNodes[i]) {
delete[] _jurisdictionEndNodes[i];
}
@ -121,7 +121,7 @@ void OctreeSceneStats::copyFromOther(const OctreeSceneStats& other) {
_jurisdictionRoot = new unsigned char[bytes];
memcpy(_jurisdictionRoot, other._jurisdictionRoot, bytes);
}
for (int i=0; i < other._jurisdictionEndNodes.size(); i++) {
for (size_t i = 0; i < other._jurisdictionEndNodes.size(); i++) {
unsigned char* endNodeCode = other._jurisdictionEndNodes[i];
if (endNodeCode) {
int bytes = bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(endNodeCode));
@ -161,7 +161,7 @@ void OctreeSceneStats::sceneStarted(bool isFullScene, bool isMoving, OctreeEleme
_jurisdictionRoot = NULL;
}
// clear existing endNodes before copying new ones...
for (int i=0; i < _jurisdictionEndNodes.size(); i++) {
for (size_t i=0; i < _jurisdictionEndNodes.size(); i++) {
if (_jurisdictionEndNodes[i]) {
delete[] _jurisdictionEndNodes[i];
}
@ -178,7 +178,7 @@ void OctreeSceneStats::sceneStarted(bool isFullScene, bool isMoving, OctreeEleme
}
// copy new endNodes...
for (int i=0; i < jurisdictionMap->getEndNodeCount(); i++) {
for (int i = 0; i < jurisdictionMap->getEndNodeCount(); i++) {
unsigned char* endNodeCode = jurisdictionMap->getEndNodeOctalCode(i);
if (endNodeCode) {
int bytes = bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(endNodeCode));
@ -268,7 +268,7 @@ void OctreeSceneStats::reset() {
delete[] _jurisdictionRoot;
_jurisdictionRoot = NULL;
}
for (int i=0; i < _jurisdictionEndNodes.size(); i++) {
for (size_t i = 0; i < _jurisdictionEndNodes.size(); i++) {
if (_jurisdictionEndNodes[i]) {
delete[] _jurisdictionEndNodes[i];
}
@ -577,7 +577,7 @@ int OctreeSceneStats::unpackFromMessage(unsigned char* sourceBuffer, int availab
}
// clear existing endNodes before copying new ones...
for (int i=0; i < _jurisdictionEndNodes.size(); i++) {
for (size_t i = 0; i < _jurisdictionEndNodes.size(); i++) {
if (_jurisdictionEndNodes[i]) {
delete[] _jurisdictionEndNodes[i];
}

View file

@ -180,7 +180,7 @@ int ParticleTree::processEditPacketData(PACKET_TYPE packetType, unsigned char* p
void ParticleTree::notifyNewlyCreatedParticle(const Particle& newParticle, Node* senderNode) {
_newlyCreatedHooksLock.lockForRead();
for (int i = 0; i < _newlyCreatedHooks.size(); i++) {
for (size_t i = 0; i < _newlyCreatedHooks.size(); i++) {
_newlyCreatedHooks[i]->particleCreated(newParticle, senderNode);
}
_newlyCreatedHooksLock.unlock();
@ -194,7 +194,7 @@ void ParticleTree::addNewlyCreatedHook(NewlyCreatedParticleHook* hook) {
void ParticleTree::removeNewlyCreatedHook(NewlyCreatedParticleHook* hook) {
_newlyCreatedHooksLock.lockForWrite();
for (int i = 0; i < _newlyCreatedHooks.size(); i++) {
for (size_t i = 0; i < _newlyCreatedHooks.size(); i++) {
if (_newlyCreatedHooks[i] == hook) {
_newlyCreatedHooks.erase(_newlyCreatedHooks.begin() + i);
break;