From 9a9656708cdfd0c7581f7c95c51860f0c097346b Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Wed, 8 May 2013 10:03:05 -0700 Subject: [PATCH] CR cleanup --- libraries/shared/src/SharedUtil.cpp | 4 ++-- libraries/shared/src/SharedUtil.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libraries/shared/src/SharedUtil.cpp b/libraries/shared/src/SharedUtil.cpp index ab445341fc..1ba8e8ddef 100644 --- a/libraries/shared/src/SharedUtil.cpp +++ b/libraries/shared/src/SharedUtil.cpp @@ -170,7 +170,7 @@ bool cmdOptionExists(int argc, const char * argv[],const char* option) { // Complaints: Brad :) #define GUESS_OF_VOXELCODE_SIZE 10 #define MAXIMUM_EDIT_VOXEL_MESSAGE_SIZE 1500 -#define SIZE_OF_COLOR_DATA 3 +#define SIZE_OF_COLOR_DATA sizeof(rgbColor) bool createVoxelEditMessage(unsigned char command, short int sequence, int voxelCount, VoxelDetail* voxelDetails, unsigned char*& bufferOut, int& sizeOut) { @@ -242,7 +242,7 @@ unsigned char* pointToVoxel(float x, float y, float z, float s, unsigned char r, } unsigned int voxelSizeInBytes = bytesRequiredForCodeLength(voxelSizeInOctets); // (voxelSizeInBits/8)+1; - unsigned int voxelBufferSize = voxelSizeInBytes+3; // 3 for color + unsigned int voxelBufferSize = voxelSizeInBytes + sizeof(rgbColor); // 3 for color // allocate our resulting buffer unsigned char* voxelOut = new unsigned char[voxelBufferSize]; diff --git a/libraries/shared/src/SharedUtil.h b/libraries/shared/src/SharedUtil.h index 1b40de5448..9d2fcb8799 100644 --- a/libraries/shared/src/SharedUtil.h +++ b/libraries/shared/src/SharedUtil.h @@ -18,6 +18,8 @@ #include #endif +typedef unsigned char rgbColor[3]; + static const float ZERO = 0.0f; static const float ONE = 1.0f; static const float ONE_HALF = 0.5f;