Skip to content

Commit

Permalink
fixed a bunch of signed comparison warnings on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
danomatika committed Jul 18, 2013
1 parent 3a8d94a commit 7d187fe
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions src/ofxKinect.cpp
Expand Up @@ -285,14 +285,9 @@ void ofxKinect::update() {
}

if(this->lock()) {
int n = width * height;

depthPixelsRaw = depthPixelsRawBack;
videoPixels = videoPixelsBack;

// we have done the update
bNeedsUpdate = false;

this->unlock();

updateDepthPixels();
Expand Down Expand Up @@ -628,7 +623,7 @@ void ofxKinect::updateDepthLookupTable() {
unsigned int maxDepthLevels = 10001;
depthLookupTable.resize(maxDepthLevels);
depthLookupTable[0] = 0;
for(int i = 1; i < maxDepthLevels; i++) {
for(unsigned int i = 1; i < maxDepthLevels; i++) {
depthLookupTable[i] = ofMap(i, nearClipping, farClipping, nearColor, farColor, true);
}
}
Expand All @@ -651,7 +646,6 @@ void ofxKinect::grabDepthFrame(freenect_device *dev, void *depth, uint32_t times

if(kinect->kinectDevice == dev) {
kinect->lock();
freenect_frame_mode curMode = freenect_get_current_depth_mode(dev);
kinect->depthPixelsRawBack.setFromPixels((unsigned short*) depth, width, height, 1);
kinect->bNeedsUpdate = true;
kinect->unlock();
Expand Down Expand Up @@ -925,17 +919,17 @@ void ofxKinectContext::listDevices(bool verbose) {
ofLog(OF_LOG_VERBOSE, stream.str());
}
else {
cout << stream.str() << endl;
ofLogNotice("ofxKinect") << stream.str();
}
stream.str("");

for(int i = 0; i < deviceList.size(); ++i) {
for(unsigned int i = 0; i < deviceList.size(); ++i) {
stream << " id: " << deviceList[i].id << " serial: " << deviceList[i].serial;
if(verbose) {
ofLog(OF_LOG_VERBOSE, stream.str());
}
else {
cout << stream.str() << endl;
ofLogNotice("ofxKinect") << stream.str();
}
stream.str("");
}
Expand Down Expand Up @@ -967,15 +961,15 @@ ofxKinect* ofxKinectContext::getKinect(freenect_device* dev) {
}

int ofxKinectContext::getDeviceIndex(int id) {
for(int i = 0; i < deviceList.size(); ++i) {
for(unsigned int i = 0; i < deviceList.size(); ++i) {
if(deviceList[i].id == id)
return i;
}
return -1;
}

int ofxKinectContext::getDeviceIndex(string serial) {
for(int i = 0; i < deviceList.size(); ++i) {
for(unsigned int i = 0; i < deviceList.size(); ++i) {
if(deviceList[i].serial == serial)
return i;
}
Expand All @@ -1002,7 +996,7 @@ int ofxKinectContext::nextAvailableId() {

// a brute force free index finder :D
std::map<int,ofxKinect*>::iterator iter;
for(int i = 0; i < deviceList.size(); ++i) {
for(unsigned int i = 0; i < deviceList.size(); ++i) {
iter = kinects.find(deviceList[i].id);
if(iter == kinects.end())
return deviceList[i].id;
Expand Down

0 comments on commit 7d187fe

Please sign in to comment.