clean up various warnings

This commit is contained in:
Stephen Birarda 2015-05-01 16:49:11 -07:00
parent 7ce62f49e2
commit b9c9ff6a14
6 changed files with 11 additions and 11 deletions

View file

@ -723,11 +723,10 @@ void Avatar::renderDisplayName() {
.arg(getReceiveRate());
}
QByteArray ba = _displayName.toLocal8Bit();
const char* text = ba.data();
QByteArray nameUTF8 = renderedDisplayName.toLocal8Bit();
glDisable(GL_POLYGON_OFFSET_FILL);
textRenderer(DISPLAYNAME)->draw(text_x, text_y, renderedDisplayName, color);
textRenderer(DISPLAYNAME)->draw(text_x, text_y, nameUTF8.data(), color);
glPopMatrix();

View file

@ -796,8 +796,8 @@ void AudioClient::handleAudioInput() {
float loudness = 0.0f;
for (int i = 0; i < numNetworkSamples; i++) {
float thisSample = fabsf(networkAudioSamples[i]);
loudness += thisSample;
int thisSample = std::abs(networkAudioSamples[i]);
loudness += (float) thisSample;
if (thisSample > (AudioConstants::MAX_SAMPLE_VALUE * AudioNoiseGate::CLIPPING_THRESHOLD)) {
_timeSinceLastClip = 0.0f;

View file

@ -53,7 +53,7 @@ void AudioNoiseGate::gateSamples(int16_t* samples, int numSamples) {
float loudness = 0;
float thisSample = 0;
int thisSample = 0;
int samplesOverNoiseGate = 0;
const float NOISE_GATE_HEIGHT = 7.0f;
@ -69,7 +69,7 @@ void AudioNoiseGate::gateSamples(int16_t* samples, int numSamples) {
for (int i = 0; i < numSamples; i++) {
measuredDcOffset += samples[i];
samples[i] -= (int16_t) _dcOffset;
thisSample = fabsf(samples[i]);
thisSample = std::abs(samples[i]);
if (thisSample >= ((float) AudioConstants::MAX_SAMPLE_VALUE * CLIPPING_THRESHOLD)) {
_didClipInLastFrame = true;

View file

@ -121,8 +121,9 @@ public:
}
void render(const int16_t* in, int16_t* out, const uint32_t frameCount) {
if (!_buffer || (frameCount > _frameCount))
if (frameCount > _frameCount) {
return;
}
const int scale = (2 << ((8 * sizeof(int16_t)) - 1));

View file

@ -449,7 +449,7 @@ glm::vec2 Font::drawString(float x, float y, const QString & str,
advance.y -= _rowHeight;
// If we've wrapped right out of the bounds, then we're
// done with rendering the tokens
if (bounds.y > 0 && abs(advance.y) > bounds.y) {
if (bounds.y > 0 && std::abs(advance.y) > bounds.y) {
break;
}
continue;
@ -464,7 +464,7 @@ glm::vec2 Font::drawString(float x, float y, const QString & str,
advance.y -= _rowHeight;
// If we've wrapped right out of the bounds, then we're
// done with rendering the tokens
if (bounds.y > 0 && abs(advance.y) > bounds.y) {
if (bounds.y > 0 && std::abs(advance.y) > bounds.y) {
break;
}
}

View file

@ -871,7 +871,7 @@ int TextTemplate::evalBlockGeneration(std::ostream& dst, const BlockPointer& blo
case Command::INCLUDE: {
TextTemplatePointer include = _config->findInclude(block->command.arguments.front().c_str());
if (include && !include->_root->blocks.empty()) {
if (&include->_root) {
if (include->_root) {
generateTree(dst, include->_root, vars);
}
}