diff --git a/shared/src/OctalCode.cpp b/shared/src/OctalCode.cpp index 9535402f77..8ba41ea0d9 100644 --- a/shared/src/OctalCode.cpp +++ b/shared/src/OctalCode.cpp @@ -108,7 +108,7 @@ float * firstVertexForCode(unsigned char * octalCode) { memset(firstVertex, 0, 3 * sizeof(float)); for (int i = 0; i < numberOfThreeBitSectionsInCode(octalCode); i++) { - int8_t sectionIndex = sectionValue(octalCode + 1 + (3 * i / 8), (3 * i) % 8); + int sectionIndex = sectionValue(octalCode + 1 + (3 * i / 8), (3 * i) % 8); for (int j = 0; j < 3; j++) { firstVertex[j] += 0.5 * (int)oneAtBit(sectionIndex, 7 -j); } diff --git a/shared/src/SharedUtil.cpp b/shared/src/SharedUtil.cpp index 54b1c75e4f..04e517fe9a 100644 --- a/shared/src/SharedUtil.cpp +++ b/shared/src/SharedUtil.cpp @@ -24,7 +24,7 @@ float randFloat () { return (rand() % 10000)/10000.f; } -unsigned char randomColorValue(uint8_t miniumum) { +unsigned char randomColorValue(int miniumum) { return miniumum + (rand() % (255 - miniumum)); } @@ -42,7 +42,7 @@ void outputBits(unsigned char byte) { printf("\n"); } -int8_t numberOfOnes(unsigned char byte) { +int numberOfOnes(unsigned char byte) { return (byte >> 7) + ((byte >> 6) & 1) + ((byte >> 5) & 1) @@ -53,6 +53,6 @@ int8_t numberOfOnes(unsigned char byte) { + (byte & 1); } -bool oneAtBit(unsigned char byte, int8_t bitIndex) { +bool oneAtBit(unsigned char byte, int bitIndex) { return (byte >> (7 - bitIndex) & 1); } diff --git a/shared/src/SharedUtil.h b/shared/src/SharedUtil.h index c7f8261070..967d0e9786 100644 --- a/shared/src/SharedUtil.h +++ b/shared/src/SharedUtil.h @@ -22,11 +22,11 @@ double usecTimestamp(timeval *time); double usecTimestampNow(); float randFloat(); -unsigned char randomColorValue(uint8_t minimum); +unsigned char randomColorValue(int minimum); bool randomBoolean(); void outputBits(unsigned char byte); -int8_t numberOfOnes(unsigned char byte); -bool oneAtBit(unsigned char byte, int8_t bitIndex); +int numberOfOnes(unsigned char byte); +bool oneAtBit(unsigned char byte, int bitIndex); #endif /* defined(__hifi__SharedUtil__) */ diff --git a/shared/src/VoxelNode.cpp b/shared/src/VoxelNode.cpp index 62c0756ea2..32b86ff2b6 100644 --- a/shared/src/VoxelNode.cpp +++ b/shared/src/VoxelNode.cpp @@ -30,7 +30,7 @@ VoxelNode::~VoxelNode() { } } -void VoxelNode::addChildAtIndex(int8_t childIndex) { +void VoxelNode::addChildAtIndex(int childIndex) { children[childIndex] = new VoxelNode(); // give this child its octal code diff --git a/shared/src/VoxelNode.h b/shared/src/VoxelNode.h index 4efe7e0dec..bdd7428f6d 100644 --- a/shared/src/VoxelNode.h +++ b/shared/src/VoxelNode.h @@ -16,7 +16,7 @@ public: VoxelNode(); ~VoxelNode(); - void addChildAtIndex(int8_t childIndex); + void addChildAtIndex(int childIndex); void setColorFromAverageOfChildren(int * colorArray = NULL); void setRandomColor(int minimumBrightness); diff --git a/shared/src/VoxelTree.cpp b/shared/src/VoxelTree.cpp index 4efaaac9c2..83d0eaa067 100644 --- a/shared/src/VoxelTree.cpp +++ b/shared/src/VoxelTree.cpp @@ -31,7 +31,7 @@ VoxelNode * VoxelTree::nodeForOctalCode(VoxelNode *ancestorNode, unsigned char * if (*needleCode == 0) { return ancestorNode; } else if (ancestorNode->childMask != 0) { - int8_t branchForNeedle = branchIndexWithDescendant(ancestorNode->octalCode, needleCode); + int branchForNeedle = branchIndexWithDescendant(ancestorNode->octalCode, needleCode); VoxelNode *childNode = ancestorNode->children[branchForNeedle]; if (childNode != NULL) { @@ -53,7 +53,7 @@ VoxelNode * VoxelTree::nodeForOctalCode(VoxelNode *ancestorNode, unsigned char * } VoxelNode * VoxelTree::createMissingNode(VoxelNode *lastParentNode, unsigned char *codeToReach) { - uint8_t indexOfNewChild = branchIndexWithDescendant(lastParentNode->octalCode, codeToReach); + int indexOfNewChild = branchIndexWithDescendant(lastParentNode->octalCode, codeToReach); lastParentNode->addChildAtIndex(indexOfNewChild); if (*lastParentNode->children[indexOfNewChild]->octalCode == *codeToReach) { @@ -139,7 +139,7 @@ unsigned char * VoxelTree::loadBitstreamBuffer(unsigned char *& bitstreamBuffer, { static unsigned char *initialBitstreamPos = bitstreamBuffer; - uint8_t firstIndexToCheck = 0; + int firstIndexToCheck = 0; // we'll only be writing data if we're lower than // or at the same level as the stopOctalCode @@ -224,7 +224,7 @@ unsigned char * VoxelTree::loadBitstreamBuffer(unsigned char *& bitstreamBuffer, } void VoxelTree::printTreeForDebugging(VoxelNode *startNode) { - uint8_t colorMask = 0; + int colorMask = 0; // create the color mask for (int i = 0; i < 8; i++) {