Fix miscellaneous types and casts

This commit is contained in:
David Rowe 2015-01-08 13:44:51 -08:00
parent 0ac8f79d2e
commit 07b30da2ac
5 changed files with 8 additions and 8 deletions

View file

@ -60,7 +60,7 @@
#include "AudioMixer.h"
const float LOUDNESS_TO_DISTANCE_RATIO = 0.00001f;
const float DEFAULT_ATTENUATION_PER_DOUBLING_IN_DISTANCE = 0.18;
const float DEFAULT_ATTENUATION_PER_DOUBLING_IN_DISTANCE = 0.18f;
const float DEFAULT_NOISE_MUTING_THRESHOLD = 0.003f;
const QString AUDIO_MIXER_LOGGING_TARGET_NAME = "audio-mixer";
const QString AUDIO_ENV_GROUP_KEY = "audio_env";

View file

@ -26,8 +26,8 @@ namespace AudioConstants {
const int NETWORK_FRAME_BYTES_PER_CHANNEL = 512;
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
/ (float) AudioConstants::SAMPLE_RATE) * 1000.0;
const unsigned int NETWORK_FRAME_USECS = floorf(NETWORK_FRAME_MSECS * 1000.0);
/ (float)AudioConstants::SAMPLE_RATE) * 1000.0f;
const unsigned int NETWORK_FRAME_USECS = (int)floorf(NETWORK_FRAME_MSECS * 1000.0f);
const int MIN_SAMPLE_VALUE = std::numeric_limits<AudioSample>::min();
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();
} else {
colorContents = QByteArray(baseWidth * baseHeight * DataBlock::COLOR_BYTES, 0xFF);
colorContents = QByteArray(baseWidth * baseHeight * DataBlock::COLOR_BYTES, 0xFFu);
}
int materialWidth = baseWidth, materialHeight = baseHeight;
@ -1885,7 +1885,7 @@ HeightfieldNode* HeightfieldNode::clearAndFetchHeight(const glm::vec3& translati
spanner->setHeight(HeightfieldHeightPointer(new HeightfieldHeight(spannerHeightWidth,
QVector<quint16>(spannerHeightWidth * spannerHeightHeight))));
spanner->setColor(HeightfieldColorPointer(new HeightfieldColor(spannerColorWidth,
QByteArray(spannerColorWidth * spannerColorHeight * DataBlock::COLOR_BYTES, 0xFF))));
QByteArray(spannerColorWidth * spannerColorHeight * DataBlock::COLOR_BYTES, 0xFFu))));
spanner->setMaterial(HeightfieldMaterialPointer(new HeightfieldMaterial(spannerMaterialWidth,
QByteArray(spannerMaterialWidth * spannerMaterialHeight, 0), QVector<SharedObjectPointer>())));
}
@ -2358,7 +2358,7 @@ void HeightfieldNode::mergeChildren(bool height, bool colorMaterial) {
return;
}
if (colorWidth > 0) {
QByteArray colorContents(colorWidth * colorHeight * DataBlock::COLOR_BYTES, 0xFF);
QByteArray colorContents(colorWidth * colorHeight * DataBlock::COLOR_BYTES, 0xFFu);
for (int i = 0; i < CHILD_COUNT; i++) {
HeightfieldColorPointer childColor = _children[i]->getColor();
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)";
}
QByteArray extraContent;
extraContent.fill(0xba, 10);
extraContent.fill(0xbau, 10);
encoded.append(extraContent);
if (verbose) {

View file

@ -837,7 +837,7 @@ int TextTemplate::evalBlockGeneration(std::ostream& dst, const BlockPointer& blo
if (block->command.arguments.size()) {
// THe actual value of the var defined sneeds to be evaluated:
String val;
for (int t = 1; t < block->command.arguments.size(); t++) {
for (unsigned int t = 1; t < block->command.arguments.size(); t++) {
// detect if a param is a var
int len = block->command.arguments[t].length();
if ((block->command.arguments[t][0] == Tag::VAR)