use char when unsigned char is not explicitly required

This commit is contained in:
Stephen Birarda 2013-03-15 12:26:34 -07:00
parent 14b23fc053
commit 3e36ba9265
2 changed files with 12 additions and 8 deletions

View file

@ -8,19 +8,20 @@
#include "VoxelTree.h"
const int MAX_VOXEL_PACKET_SIZE = 1492;
const int MAX_TREE_SIZE_BYTES = 26;
const int MAX_TREE_SLICE_BYTES = 26;
VoxelTree::VoxelTree() {
rootNode = new VoxelNode();
}
unsigned char * VoxelTree::loadBitstream(unsigned char * bitstreamBuffer, VoxelNode *bitstreamRootNode, unsigned char ** startSplitPtr) {
static unsigned char **packetSplitPtr = startSplitPtr;
char * VoxelTree::loadBitstream(char * bitstreamBuffer,
VoxelNode *bitstreamRootNode,
char ** startSplitPtr) {
static char **packetSplitPtr = startSplitPtr;
if (bitstreamRootNode->childMask != 0) {
if ((bitstreamBuffer + MAX_TREE_SIZE_BYTES - *packetSplitPtr) > MAX_VOXEL_PACKET_SIZE) {
if ((bitstreamBuffer + MAX_TREE_SLICE_BYTES - *packetSplitPtr) > MAX_VOXEL_PACKET_SIZE) {
// we need to add a packet split here
// add the octal code for the current root
@ -34,7 +35,7 @@ unsigned char * VoxelTree::loadBitstream(unsigned char * bitstreamBuffer, VoxelN
*(bitstreamBuffer++) = 0;
// keep a colorPointer so we can check how many colors were added
unsigned char *colorPointer = bitstreamBuffer;
char *colorPointer = bitstreamBuffer;
for (int i = 0; i < 8; i++) {
// grab this child

View file

@ -12,17 +12,20 @@
#include <iostream>
#include "VoxelNode.h"
const int MAX_VOXEL_PACKET_SIZE = 1492;
class VoxelTree {
public:
VoxelTree();
VoxelNode *rootNode;
void addBitstreamPacketMarker();
void outputDebugInformation(VoxelNode *currentRootNode = NULL);
unsigned char * loadBitstream(unsigned char * bitstreamBuffer, VoxelNode *bitstreamRootNode, unsigned char ** curPacketSplitPtr = NULL);
char * loadBitstream(char * bitstreamBuffer,
VoxelNode *bitstreamRootNode,
char ** curPacketSplitPtr = NULL);
};
#endif /* defined(__hifi__VoxelTree__) */