quiet compiler

This commit is contained in:
Seth Alves 2015-09-12 09:59:25 -07:00
parent e65ef93663
commit 49ee251238
20 changed files with 86 additions and 84 deletions

View file

@ -5070,7 +5070,7 @@ void Application::emulateMouse(Hand* hand, float click, float shift, int index)
glm::vec3 direction = glm::inverse(_myAvatar->getOrientation()) * palm->getFingerDirection();
// Get the angles, scaled between (-0.5,0.5)
float xAngle = (atan2(direction.z, direction.x) + M_PI_2);
float xAngle = (atan2f(direction.z, direction.x) + (float)M_PI_2);
float yAngle = 0.5f - ((atan2f(direction.z, direction.y) + (float)M_PI_2));
auto canvasSize = qApp->getCanvasSize();
// Get the pixel range over which the xAngle and yAngle are scaled

View file

@ -53,7 +53,7 @@ public:
protected:
void rollFileIfNecessary(QFile& file) {
uint64_t now = usecTimestampNow();
if ((file.size() > MAX_LOG_SIZE) || (now - _lastRollTime) > MAX_LOG_AGE_USECS) {
if ((file.size() > (qint64)MAX_LOG_SIZE) || (now - _lastRollTime) > MAX_LOG_AGE_USECS) {
QString newFileName = getLogRollerFilename();
if (file.copy(newFileName)) {
_lastRollTime = now;

View file

@ -6,7 +6,6 @@
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#include "OpenGLDisplayPlugin.h"
#include <QOpenGLContext>
#include <QCoreApplication>

View file

@ -21,8 +21,20 @@
#include <oglplus/opt/list_init.hpp>
#include <oglplus/shapes/vector.hpp>
#include <oglplus/opt/list_init.hpp>
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdouble-promotion"
#endif
#include <oglplus/shapes/obj_mesh.hpp>
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic pop
#endif
#include <PerfStat.h>
#include <plugins/PluginContainer.h>
#include <ViewFrustum.h>

View file

@ -184,7 +184,10 @@ void OculusLegacyDisplayPlugin::activate() {
}
});
ovrBool result = ovrHmd_ConfigureRendering(_hmd, &config.Config, distortionCaps, _eyeFovs, _eyeRenderDescs);
#ifndef QT_NO_DEBUG
ovrBool result =
#endif
ovrHmd_ConfigureRendering(_hmd, &config.Config, distortionCaps, _eyeFovs, _eyeRenderDescs);
Q_ASSERT(result);
#endif
}

View file

@ -18,7 +18,7 @@
#include "EntitiesLogging.h"
#include "EntityTreeElement.h"
EntityTreeElement::EntityTreeElement(unsigned char* octalCode) : OctreeElement(), _entityItems(NULL) {
EntityTreeElement::EntityTreeElement(unsigned char* octalCode) : OctreeElement() {
init(octalCode);
};

View file

@ -73,34 +73,9 @@ EntityItemPointer ParticleEffectEntityItem::factory(const EntityItemID& entityID
// our non-pure virtual subclass for now...
ParticleEffectEntityItem::ParticleEffectEntityItem(const EntityItemID& entityItemID, const EntityItemProperties& properties) :
EntityItem(entityItemID),
_maxParticles(DEFAULT_MAX_PARTICLES),
_lifespan(DEFAULT_LIFESPAN),
_emitRate(DEFAULT_EMIT_RATE),
_emitVelocity(DEFAULT_EMIT_VELOCITY),
_velocitySpread(DEFAULT_VELOCITY_SPREAD),
_emitAcceleration(DEFAULT_EMIT_ACCELERATION),
_accelerationSpread(DEFAULT_ACCELERATION_SPREAD),
_particleRadius(DEFAULT_PARTICLE_RADIUS),
_radiusSpread(DEFAULT_RADIUS_SPREAD),
_radiusStart(DEFAULT_RADIUS_START),
_radiusFinish(DEFAULT_RADIUS_FINISH),
_lastAnimated(usecTimestampNow()),
_animationLoop(),
_animationSettings(),
_textures(DEFAULT_TEXTURES),
_texturesChangedFlag(false),
_shapeType(SHAPE_TYPE_NONE),
_colorSpread(DEFAULT_COLOR_SPREAD),
_colorStart(DEFAULT_COLOR),
_colorFinish(DEFAULT_COLOR),
_isColorStartInitialized(false),
_isColorFinishInitialized(false),
_alpha(DEFAULT_ALPHA),
_alphaSpread(DEFAULT_ALPHA_SPREAD),
_alphaStart(DEFAULT_ALPHA_START),
_alphaFinish(DEFAULT_ALPHA_FINISH),
_isAlphaStartInitialized(false),
_isAlphaFinishInitialized(false),
_particleLifetimes(DEFAULT_MAX_PARTICLES, 0.0f),
_particlePositions(DEFAULT_MAX_PARTICLES, glm::vec3(0.0f, 0.0f, 0.0f)),
_particleVelocities(DEFAULT_MAX_PARTICLES, glm::vec3(0.0f, 0.0f, 0.0f)),
@ -117,9 +92,6 @@ ParticleEffectEntityItem::ParticleEffectEntityItem(const EntityItemID& entityIte
_alphaStarts(DEFAULT_MAX_PARTICLES, DEFAULT_ALPHA),
_alphaMiddles(DEFAULT_MAX_PARTICLES, DEFAULT_ALPHA),
_alphaFinishes(DEFAULT_MAX_PARTICLES, DEFAULT_ALPHA),
_timeUntilNextEmit(0.0f),
_particleHeadIndex(0),
_particleTailIndex(0),
_particleMaxBound(glm::vec3(1.0f, 1.0f, 1.0f)),
_particleMinBound(glm::vec3(-1.0f, -1.0f, -1.0f)) {

View file

@ -56,11 +56,11 @@ public:
_color[BLUE_INDEX] = value.blue;
}
bool _isColorStartInitialized;
bool _isColorStartInitialized = false;
void setColorStart(const xColor& colorStart) { _colorStart = colorStart; _isColorStartInitialized = true; }
xColor getColorStart() const { return _isColorStartInitialized ? _colorStart : getXColor(); }
bool _isColorFinishInitialized;
bool _isColorFinishInitialized = false;
void setColorFinish(const xColor& colorFinish) { _colorFinish = colorFinish; _isColorFinishInitialized = true; }
xColor getColorFinish() const { return _isColorFinishInitialized ? _colorFinish : getXColor(); }
@ -73,12 +73,12 @@ public:
float getAlpha() const { return _alpha; }
static const float DEFAULT_ALPHA_START;
bool _isAlphaStartInitialized;
bool _isAlphaStartInitialized = false;
void setAlphaStart(float alphaStart) { _alphaStart = alphaStart; _isAlphaStartInitialized = true; }
float getAlphaStart() const { return _isAlphaStartInitialized ? _alphaStart : _alpha; }
static const float DEFAULT_ALPHA_FINISH;
bool _isAlphaFinishInitialized;
bool _isAlphaFinishInitialized = false;
void setAlphaFinish(float alphaFinish) { _alphaFinish = alphaFinish; _isAlphaFinishInitialized = true; }
float getAlphaFinish() const { return _isAlphaFinishInitialized ? _alphaFinish : _alpha; }
@ -192,29 +192,29 @@ protected:
// the properties of this entity
rgbColor _color;
xColor _colorStart;
xColor _colorFinish;
xColor _colorSpread;
float _alpha;
float _alphaStart;
float _alphaFinish;
float _alphaSpread;
quint32 _maxParticles;
float _lifespan;
float _emitRate;
glm::vec3 _emitVelocity;
glm::vec3 _velocitySpread;
glm::vec3 _emitAcceleration;
glm::vec3 _accelerationSpread;
float _particleRadius;
float _radiusStart;
float _radiusFinish;
float _radiusSpread;
xColor _colorStart = DEFAULT_COLOR;
xColor _colorFinish = DEFAULT_COLOR;
xColor _colorSpread = DEFAULT_COLOR_SPREAD;
float _alpha = DEFAULT_ALPHA;
float _alphaStart = DEFAULT_ALPHA_START;
float _alphaFinish = DEFAULT_ALPHA_FINISH;
float _alphaSpread = DEFAULT_ALPHA_SPREAD;
quint32 _maxParticles = DEFAULT_MAX_PARTICLES;
float _lifespan = DEFAULT_LIFESPAN;
float _emitRate = DEFAULT_EMIT_RATE;
glm::vec3 _emitVelocity = DEFAULT_EMIT_VELOCITY;
glm::vec3 _velocitySpread = DEFAULT_VELOCITY_SPREAD;
glm::vec3 _emitAcceleration = DEFAULT_EMIT_ACCELERATION;
glm::vec3 _accelerationSpread = DEFAULT_ACCELERATION_SPREAD;
float _particleRadius = DEFAULT_PARTICLE_RADIUS;
float _radiusStart = DEFAULT_RADIUS_START;
float _radiusFinish = DEFAULT_RADIUS_FINISH;
float _radiusSpread = DEFAULT_RADIUS_SPREAD;
quint64 _lastAnimated;
AnimationLoop _animationLoop;
QString _animationSettings;
QString _textures;
bool _texturesChangedFlag;
QString _textures = DEFAULT_TEXTURES;
bool _texturesChangedFlag = false;
ShapeType _shapeType = SHAPE_TYPE_NONE;
// all the internals of running the particle sim
@ -235,12 +235,12 @@ protected:
QVector<float> _alphaMiddles;
QVector<float> _alphaFinishes;
float _timeUntilNextEmit;
float _timeUntilNextEmit = 0.0f;
// particle arrays are a ring buffer, use these indices
// to keep track of the living particles.
quint32 _particleHeadIndex;
quint32 _particleTailIndex;
quint32 _particleHeadIndex = 0;
quint32 _particleTailIndex = 0;
// bounding volume
glm::vec3 _particleMaxBound;

View file

@ -1129,6 +1129,8 @@ ExtractedMesh extractMesh(const FBXNode& object, unsigned int& meshIndex) {
if (isMaterialPerPolygon) {
isMultiMaterial = true;
}
// TODO: make excellent use of isMultiMaterial
Q_UNUSED(isMultiMaterial);
// convert the polygons to quads and triangles
int polygonIndex = 0;

View file

@ -33,6 +33,7 @@ HifiSockAddr::HifiSockAddr(const QHostAddress& address, quint16 port) :
}
HifiSockAddr::HifiSockAddr(const HifiSockAddr& otherSockAddr) :
QObject(),
_address(otherSockAddr._address),
_port(otherSockAddr._port)
{

View file

@ -202,8 +202,8 @@ static void addBone(const AnimPose& rootPose, const AnimPose& pose, float radius
glm::vec3 zRing[NUM_CIRCLE_SLICES + 1];
const float dTheta = (2.0f * (float)M_PI) / NUM_CIRCLE_SLICES;
for (int i = 0; i < NUM_CIRCLE_SLICES + 1; i++) {
float rCosTheta = radius * cos(dTheta * i);
float rSinTheta = radius * sin(dTheta * i);
float rCosTheta = radius * cosf(dTheta * i);
float rSinTheta = radius * sinf(dTheta * i);
xRing[i] = finalPose * glm::vec3(0.0f, rCosTheta, rSinTheta);
yRing[i] = finalPose * glm::vec3(rCosTheta, 0.0f, rSinTheta);
zRing[i] = finalPose * glm::vec3(rCosTheta, rSinTheta, 0.0f);

View file

@ -110,10 +110,10 @@ void Antialiasing::run(const render::SceneContextPointer& sceneContext, const re
QSize framebufferSize = framebufferCache->getFrameBufferSize();
float fbWidth = framebufferSize.width();
float fbHeight = framebufferSize.height();
float sMin = args->_viewport.x / fbWidth;
float sWidth = args->_viewport.z / fbWidth;
float tMin = args->_viewport.y / fbHeight;
float tHeight = args->_viewport.w / fbHeight;
// float sMin = args->_viewport.x / fbWidth;
// float sWidth = args->_viewport.z / fbWidth;
// float tMin = args->_viewport.y / fbHeight;
// float tHeight = args->_viewport.w / fbHeight;
glm::mat4 projMat;
Transform viewMat;
@ -136,14 +136,14 @@ void Antialiasing::run(const render::SceneContextPointer& sceneContext, const re
args->_viewFrustum->computeOffAxisFrustum(left, right, bottom, top, nearVal, farVal, nearClipPlane, farClipPlane);
float depthScale = (farVal - nearVal) / farVal;
float nearScale = -1.0f / nearVal;
float depthTexCoordScaleS = (right - left) * nearScale / sWidth;
float depthTexCoordScaleT = (top - bottom) * nearScale / tHeight;
float depthTexCoordOffsetS = left * nearScale - sMin * depthTexCoordScaleS;
float depthTexCoordOffsetT = bottom * nearScale - tMin * depthTexCoordScaleT;
// float depthScale = (farVal - nearVal) / farVal;
// float nearScale = -1.0f / nearVal;
// float depthTexCoordScaleS = (right - left) * nearScale / sWidth;
// float depthTexCoordScaleT = (top - bottom) * nearScale / tHeight;
// float depthTexCoordOffsetS = left * nearScale - sMin * depthTexCoordScaleS;
// float depthTexCoordOffsetT = bottom * nearScale - tMin * depthTexCoordScaleT;
batch._glUniform2f(_texcoordOffsetLoc, 1.0 / fbWidth, 1.0 / fbHeight);
batch._glUniform2f(_texcoordOffsetLoc, 1.0f / fbWidth, 1.0f / fbHeight);
glm::vec4 color(0.0f, 0.0f, 0.0f, 1.0f);
glm::vec2 bottomLeft(-1.0f, -1.0f);

View file

@ -43,7 +43,10 @@ bool GlWindow::makeCurrent() {
qDebug() << "GL Renderer: " << QString((const char*) glGetString(GL_RENDERER));
});
QOpenGLContext * currentContext = QOpenGLContext::currentContext();
#ifndef QT_NO_DEBUG
QOpenGLContext * currentContext =
#endif
QOpenGLContext::currentContext();
Q_ASSERT(_context == currentContext);
return makeCurrentResult;
}

View file

@ -1745,6 +1745,8 @@ void Model::segregateMeshGroups() {
if (wireframe) {
translucentMesh = hasTangents = hasSpecular = hasLightmap = isSkinned = false;
}
// TODO: make excellent use of translucentMesh
Q_UNUSED(translucentMesh);
// Create the render payloads
int totalParts = mesh.parts.size();

View file

@ -94,8 +94,8 @@ ScriptEngine::ScriptEngine(const QString& scriptContents, const QString& fileNam
_isListeningToAudioStream(false),
_avatarSound(NULL),
_numAvatarSoundSentBytes(0),
_controllerScriptingInterface(controllerScriptingInterface),
_wantSignals(wantSignals),
_controllerScriptingInterface(controllerScriptingInterface),
_avatarData(NULL),
_scriptName(),
_fileNameString(fileNameString),

View file

@ -156,7 +156,7 @@ protected:
bool _isAgent = false;
QSet<QUrl> _includedURLs;
bool _wantSignals = true;
private:
void stopAllTimers();
void sendAvatarIdentityPacket();

View file

@ -108,7 +108,10 @@ void VrMenu::addMenu(QMenu* menu) {
Q_ASSERT(false);
}
QVariant returnedValue;
bool invokeResult = QMetaObject::invokeMethod(this, "addMenu", Qt::DirectConnection,
#ifndef QT_NO_DEBUG
bool invokeResult =
#endif
QMetaObject::invokeMethod(this, "addMenu", Qt::DirectConnection,
Q_RETURN_ARG(QVariant, returnedValue),
Q_ARG(QVariant, QVariant::fromValue(qmlParent)),
Q_ARG(QVariant, QVariant::fromValue(menu->title())));
@ -146,8 +149,11 @@ void VrMenu::addAction(QMenu* menu, QAction* action) {
MenuUserData* userData = MenuUserData::forObject(menu);
QObject* menuQml = findMenuObject(userData->uuid.toString());
Q_ASSERT(menuQml);
QVariant returnedValue;
bool invokeResult = QMetaObject::invokeMethod(this, "addItem", Qt::DirectConnection,
QVariant returnedValue;
#ifndef QT_NO_DEBUG
bool invokeResult =
#endif
QMetaObject::invokeMethod(this, "addItem", Qt::DirectConnection,
Q_RETURN_ARG(QVariant, returnedValue),
Q_ARG(QVariant, QVariant::fromValue(menuQml)),
Q_ARG(QVariant, QVariant::fromValue(action->text())));
@ -167,7 +173,10 @@ void VrMenu::insertAction(QAction* before, QAction* action) {
}
QObject* menu = beforeQml->parent();
QVariant returnedValue;
bool invokeResult = QMetaObject::invokeMethod(this, "insertItem", Qt::DirectConnection,
#ifndef QT_NO_DEBUG
bool invokeResult =
#endif
QMetaObject::invokeMethod(this, "insertItem", Qt::DirectConnection,
Q_RETURN_ARG(QVariant, returnedValue),
Q_ARG(QVariant, QVariant::fromValue(menu)),
Q_ARG(QVariant, QVariant::fromValue(beforeQml)),

View file

@ -93,8 +93,9 @@ template <typename T>
void testByteCountCoded() {
testByteCountCodedStable<T>(0);
testByteCountCodedStable<T>(1);
testByteCountCodedStable<T>(1 << 8*sizeof(T));
testByteCountCodedStable<T>(std::numeric_limits<T>::max() >> 8*sizeof(T));
// These two can't possibly be right. TODO: figure out what was being tested, here
// testByteCountCodedStable<T>(1 << 8*sizeof(T));
// testByteCountCodedStable<T>(std::numeric_limits<T>::max() >> 8*sizeof(T));
testByteCountCodedStable<T>(std::numeric_limits<T>::max() >> 8);
testByteCountCodedStable<T>(std::numeric_limits<T>::max() >> 1);
testByteCountCodedStable<T>(std::numeric_limits<T>::max());

View file

@ -25,7 +25,6 @@
#include <gpu/Stream.h>
#include <gpu/StandardShaderLib.h>
#include <gpu/GLBackend.h>
#include <QOpenGLContext>
#include <QResizeEvent>
#include <QTime>

View file

@ -13,7 +13,6 @@
#include <vector>
#include <gpu/GLBackend.h>
#include <QOpenGLContext>
#include <QOpenGLDebugLogger>