Code review

This commit is contained in:
David Rowe 2015-01-08 18:20:23 -08:00
parent 07b30da2ac
commit a5b3ae397a
3 changed files with 5 additions and 5 deletions

View file

@ -27,7 +27,7 @@ namespace AudioConstants {
const int NETWORK_FRAME_SAMPLES_PER_CHANNEL = NETWORK_FRAME_BYTES_PER_CHANNEL / sizeof(AudioSample); const int NETWORK_FRAME_SAMPLES_PER_CHANNEL = NETWORK_FRAME_BYTES_PER_CHANNEL / sizeof(AudioSample);
const float NETWORK_FRAME_MSECS = (AudioConstants::NETWORK_FRAME_SAMPLES_PER_CHANNEL const float NETWORK_FRAME_MSECS = (AudioConstants::NETWORK_FRAME_SAMPLES_PER_CHANNEL
/ (float)AudioConstants::SAMPLE_RATE) * 1000.0f; / (float)AudioConstants::SAMPLE_RATE) * 1000.0f;
const unsigned int NETWORK_FRAME_USECS = (int)floorf(NETWORK_FRAME_MSECS * 1000.0f); const unsigned int NETWORK_FRAME_USECS = (unsigned int)floorf(NETWORK_FRAME_MSECS * 1000.0f);
const int MIN_SAMPLE_VALUE = std::numeric_limits<AudioSample>::min(); const int MIN_SAMPLE_VALUE = std::numeric_limits<AudioSample>::min();
const int MAX_SAMPLE_VALUE = std::numeric_limits<AudioSample>::max(); const int MAX_SAMPLE_VALUE = std::numeric_limits<AudioSample>::max();
} }

View file

@ -1529,7 +1529,7 @@ HeightfieldNode* HeightfieldNode::paintMaterial(const glm::vec3& position, const
colorContents = _color->getContents(); colorContents = _color->getContents();
} else { } else {
colorContents = QByteArray(baseWidth * baseHeight * DataBlock::COLOR_BYTES, 0xFFu); colorContents = QByteArray(baseWidth * baseHeight * DataBlock::COLOR_BYTES, 0xffU);
} }
int materialWidth = baseWidth, materialHeight = baseHeight; int materialWidth = baseWidth, materialHeight = baseHeight;
@ -1885,7 +1885,7 @@ HeightfieldNode* HeightfieldNode::clearAndFetchHeight(const glm::vec3& translati
spanner->setHeight(HeightfieldHeightPointer(new HeightfieldHeight(spannerHeightWidth, spanner->setHeight(HeightfieldHeightPointer(new HeightfieldHeight(spannerHeightWidth,
QVector<quint16>(spannerHeightWidth * spannerHeightHeight)))); QVector<quint16>(spannerHeightWidth * spannerHeightHeight))));
spanner->setColor(HeightfieldColorPointer(new HeightfieldColor(spannerColorWidth, spanner->setColor(HeightfieldColorPointer(new HeightfieldColor(spannerColorWidth,
QByteArray(spannerColorWidth * spannerColorHeight * DataBlock::COLOR_BYTES, 0xFFu)))); QByteArray(spannerColorWidth * spannerColorHeight * DataBlock::COLOR_BYTES, 0xffU))));
spanner->setMaterial(HeightfieldMaterialPointer(new HeightfieldMaterial(spannerMaterialWidth, spanner->setMaterial(HeightfieldMaterialPointer(new HeightfieldMaterial(spannerMaterialWidth,
QByteArray(spannerMaterialWidth * spannerMaterialHeight, 0), QVector<SharedObjectPointer>()))); QByteArray(spannerMaterialWidth * spannerMaterialHeight, 0), QVector<SharedObjectPointer>())));
} }
@ -2358,7 +2358,7 @@ void HeightfieldNode::mergeChildren(bool height, bool colorMaterial) {
return; return;
} }
if (colorWidth > 0) { if (colorWidth > 0) {
QByteArray colorContents(colorWidth * colorHeight * DataBlock::COLOR_BYTES, 0xFFu); QByteArray colorContents(colorWidth * colorHeight * DataBlock::COLOR_BYTES, 0xffU);
for (int i = 0; i < CHILD_COUNT; i++) { for (int i = 0; i < CHILD_COUNT; i++) {
HeightfieldColorPointer childColor = _children[i]->getColor(); HeightfieldColorPointer childColor = _children[i]->getColor();
if (!childColor) { if (!childColor) {

View file

@ -802,7 +802,7 @@ void OctreeTests::propertyFlagsTests(bool verbose) {
qDebug() << "fill encoded byte array with extra garbage (as if it was bitstream with more content)"; qDebug() << "fill encoded byte array with extra garbage (as if it was bitstream with more content)";
} }
QByteArray extraContent; QByteArray extraContent;
extraContent.fill(0xbau, 10); extraContent.fill(0xbaU, 10);
encoded.append(extraContent); encoded.append(extraContent);
if (verbose) { if (verbose) {