More warning fixes

This commit is contained in:
Atlante45 2015-12-11 16:03:44 -08:00
parent 5300963183
commit 8bd301e45e
12 changed files with 20 additions and 19 deletions

View file

@ -255,7 +255,7 @@ void Faceshift::receive(const QByteArray& buffer) {
} }
case fsMsg::MSG_OUT_BLENDSHAPE_NAMES: { case fsMsg::MSG_OUT_BLENDSHAPE_NAMES: {
const vector<string>& names = static_pointer_cast<fsMsgBlendshapeNames>(msg)->blendshape_names(); const vector<string>& names = static_pointer_cast<fsMsgBlendshapeNames>(msg)->blendshape_names();
for (auto i = 0; i < names.size(); i++) { for (int i = 0; i < (int)names.size(); i++) {
if (names[i] == "EyeBlink_L") { if (names[i] == "EyeBlink_L") {
_leftBlinkIndex = i; _leftBlinkIndex = i;

View file

@ -114,7 +114,7 @@ void AnimInverseKinematics::computeTargets(const AnimVariantMap& animVars, std::
} }
if (removeUnfoundJoints) { if (removeUnfoundJoints) {
auto numVars = _targetVarVec.size(); int numVars = (int)_targetVarVec.size();
int i = 0; int i = 0;
while (i < numVars) { while (i < numVars) {
if (_targetVarVec[i].jointIndex == -1) { if (_targetVarVec[i].jointIndex == -1) {
@ -145,7 +145,7 @@ void AnimInverseKinematics::solveWithCyclicCoordinateDescent(const std::vector<I
int numLoops = 0; int numLoops = 0;
const int MAX_IK_LOOPS = 4; const int MAX_IK_LOOPS = 4;
do { do {
auto lowestMovedIndex = _relativePoses.size(); int lowestMovedIndex = (int)_relativePoses.size();
for (auto& target: targets) { for (auto& target: targets) {
IKTarget::Type targetType = target.getType(); IKTarget::Type targetType = target.getType();
if (targetType == IKTarget::Type::RotationOnly) { if (targetType == IKTarget::Type::RotationOnly) {
@ -274,8 +274,8 @@ void AnimInverseKinematics::solveWithCyclicCoordinateDescent(const std::vector<I
++numLoops; ++numLoops;
// harvest accumulated rotations and apply the average // harvest accumulated rotations and apply the average
const size_t numJoints = _accumulators.size(); const int numJoints = (int)_accumulators.size();
for (auto i = 0; i < numJoints; ++i) { for (int i = 0; i < numJoints; ++i) {
if (_accumulators[i].size() > 0) { if (_accumulators[i].size() > 0) {
_relativePoses[i].rot = _accumulators[i].getAverage(); _relativePoses[i].rot = _accumulators[i].getAverage();
_accumulators[i].clear(); _accumulators[i].clear();

View file

@ -31,7 +31,7 @@ AnimSkeleton::AnimSkeleton(const std::vector<FBXJoint>& joints) {
} }
int AnimSkeleton::nameToJointIndex(const QString& jointName) const { int AnimSkeleton::nameToJointIndex(const QString& jointName) const {
for (auto i = 0; i < _joints.size(); i++) { for (int i = 0; i < (int)_joints.size(); i++) {
if (_joints[i].name == jointName) { if (_joints[i].name == jointName) {
return i; return i;
} }
@ -101,7 +101,7 @@ void AnimSkeleton::buildSkeletonFromJoints(const std::vector<FBXJoint>& joints)
_relativeDefaultPoses.reserve(joints.size()); _relativeDefaultPoses.reserve(joints.size());
// iterate over FBXJoints and extract the bind pose information. // iterate over FBXJoints and extract the bind pose information.
for (auto i = 0; i < joints.size(); i++) { for (int i = 0; i < (int)joints.size(); i++) {
// build relative and absolute default poses // build relative and absolute default poses
glm::mat4 rotTransform = glm::mat4_cast(_joints[i].preRotation * _joints[i].rotation * _joints[i].postRotation); glm::mat4 rotTransform = glm::mat4_cast(_joints[i].preRotation * _joints[i].rotation * _joints[i].postRotation);

View file

@ -434,7 +434,7 @@ void Rig::calcAnimAlpha(float speed, const std::vector<float>& referenceSpeeds,
void Rig::computeEyesInRootFrame(const AnimPoseVec& poses) { void Rig::computeEyesInRootFrame(const AnimPoseVec& poses) {
// TODO: use cached eye/hips indices for these calculations // TODO: use cached eye/hips indices for these calculations
auto numPoses = poses.size(); int numPoses = (int)poses.size();
int hipsIndex = _animSkeleton->nameToJointIndex(QString("Hips")); int hipsIndex = _animSkeleton->nameToJointIndex(QString("Hips"));
int headIndex = _animSkeleton->nameToJointIndex(QString("Head")); int headIndex = _animSkeleton->nameToJointIndex(QString("Head"));
if (hipsIndex > 0 && headIndex > 0) { if (hipsIndex > 0 && headIndex > 0) {
@ -1164,7 +1164,7 @@ void Rig::computeAvatarBoundingCapsule(
// even if they do not have legs (default robot) // even if they do not have legs (default robot)
totalExtents.addPoint(glm::vec3(0.0f)); totalExtents.addPoint(glm::vec3(0.0f));
auto numPoses = finalPoses.size(); int numPoses = (int)finalPoses.size();
for (int i = 0; i < numPoses; i++) { for (int i = 0; i < numPoses; i++) {
const FBXJointShapeInfo& shapeInfo = geometry.joints.at(i).shapeInfo; const FBXJointShapeInfo& shapeInfo = geometry.joints.at(i).shapeInfo;
AnimPose pose = finalPoses[i]; AnimPose pose = finalPoses[i];

View file

@ -44,7 +44,7 @@ public:
} }
/// How many received packets waiting are to be processed /// How many received packets waiting are to be processed
size_t packetsToProcessCount() const { return _packets.size(); } int packetsToProcessCount() const { return (int)_packets.size(); }
float getIncomingPPS() const { return _incomingPPS.getAverage(); } float getIncomingPPS() const { return _incomingPPS.getAverage(); }
float getProcessedPPS() const { return _processedPPS.getAverage(); } float getProcessedPPS() const { return _processedPPS.getAverage(); }

View file

@ -278,7 +278,7 @@ std::unique_ptr<NLPacket> JurisdictionMap::packIntoPacket() {
packet->write(reinterpret_cast<char*>(_rootOctalCode), bytes); packet->write(reinterpret_cast<char*>(_rootOctalCode), bytes);
// if and only if there's a root jurisdiction, also include the end nodes // if and only if there's a root jurisdiction, also include the end nodes
auto endNodeCount = _endNodes.size(); int endNodeCount = (int)_endNodes.size();
packet->writePrimitive(endNodeCount); packet->writePrimitive(endNodeCount);
for (int i=0; i < endNodeCount; i++) { for (int i=0; i < endNodeCount; i++) {

View file

@ -52,7 +52,7 @@ public:
unsigned char* getRootOctalCode() const { return _rootOctalCode; } unsigned char* getRootOctalCode() const { return _rootOctalCode; }
unsigned char* getEndNodeOctalCode(int index) const { return _endNodes[index]; } unsigned char* getEndNodeOctalCode(int index) const { return _endNodes[index]; }
size_t getEndNodeCount() const { return _endNodes.size(); } int getEndNodeCount() const { return (int)_endNodes.size(); }
void copyContents(unsigned char* rootCodeIn, const std::vector<unsigned char*>& endNodesIn); void copyContents(unsigned char* rootCodeIn, const std::vector<unsigned char*>& endNodesIn);

View file

@ -149,7 +149,7 @@ void OctreeEditPacketSender::queuePendingPacketToNodes(std::unique_ptr<NLPacket>
_pendingPacketsLock.lock(); _pendingPacketsLock.lock();
_preServerSingleMessagePackets.push_back(std::move(packet)); _preServerSingleMessagePackets.push_back(std::move(packet));
// if we've saved MORE than our max, then clear out the oldest packet... // if we've saved MORE than our max, then clear out the oldest packet...
auto allPendingMessages = _preServerSingleMessagePackets.size() + _preServerEdits.size(); int allPendingMessages = (int)(_preServerSingleMessagePackets.size() + _preServerEdits.size());
if (allPendingMessages > _maxPendingMessages) { if (allPendingMessages > _maxPendingMessages) {
_preServerSingleMessagePackets.pop_front(); _preServerSingleMessagePackets.pop_front();
} }
@ -210,7 +210,7 @@ void OctreeEditPacketSender::queueOctreeEditMessage(PacketType type, QByteArray&
_preServerEdits.push_back(messagePair); _preServerEdits.push_back(messagePair);
// if we've saved MORE than out max, then clear out the oldest packet... // if we've saved MORE than out max, then clear out the oldest packet...
auto allPendingMessages = _preServerSingleMessagePackets.size() + _preServerEdits.size(); int allPendingMessages = (int)(_preServerSingleMessagePackets.size() + _preServerEdits.size());
if (allPendingMessages > _maxPendingMessages) { if (allPendingMessages > _maxPendingMessages) {
_preServerEdits.pop_front(); _preServerEdits.pop_front();
} }

View file

@ -418,12 +418,12 @@ int OctreeSceneStats::packIntoPacket() {
// add the root jurisdiction // add the root jurisdiction
if (_jurisdictionRoot) { if (_jurisdictionRoot) {
// copy the // copy the
auto bytes = bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(_jurisdictionRoot)); int bytes = (int)bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(_jurisdictionRoot));
_statsPacket->writePrimitive(bytes); _statsPacket->writePrimitive(bytes);
_statsPacket->write(reinterpret_cast<char*>(_jurisdictionRoot), bytes); _statsPacket->write(reinterpret_cast<char*>(_jurisdictionRoot), bytes);
// if and only if there's a root jurisdiction, also include the end elements // if and only if there's a root jurisdiction, also include the end elements
auto endNodeCount = _jurisdictionEndNodes.size(); int endNodeCount = (int)_jurisdictionEndNodes.size();
_statsPacket->writePrimitive(endNodeCount); _statsPacket->writePrimitive(endNodeCount);

View file

@ -321,7 +321,7 @@ void AnimDebugDraw::update() {
const float POSE_RADIUS = 0.1f; // 10 cm const float POSE_RADIUS = 0.1f; // 10 cm
// figure out how many verts we will need. // figure out how many verts we will need.
size_t numVerts = 0; int numVerts = 0;
for (auto& iter : _absolutePoses) { for (auto& iter : _absolutePoses) {
AnimSkeleton::ConstPointer& skeleton = std::get<0>(iter.second); AnimSkeleton::ConstPointer& skeleton = std::get<0>(iter.second);

View file

@ -201,7 +201,7 @@ inline size_t PropertyFlags<Enum>::decode(const uint8_t* data, size_t size) {
clear(); // we are cleared out! clear(); // we are cleared out!
size_t bytesConsumed = 0; size_t bytesConsumed = 0;
auto bitCount = BITS_IN_BYTE * size; int bitCount = BITS_IN_BYTE * (int)size;
int encodedByteCount = 1; // there is at least 1 byte (after the leadBits) int encodedByteCount = 1; // there is at least 1 byte (after the leadBits)
int leadBits = 1; // there is always at least 1 lead bit int leadBits = 1; // there is always at least 1 lead bit

View file

@ -730,7 +730,8 @@ int TextTemplate::evalBlockGeneration(std::ostream& dst, const BlockPointer& blo
BlockPointer funcBlock = _config->_funcs.findFunc(block->command.arguments.front().c_str()); BlockPointer funcBlock = _config->_funcs.findFunc(block->command.arguments.front().c_str());
if (funcBlock) { if (funcBlock) {
// before diving in the func tree, let's modify the vars with the local defs: // before diving in the func tree, let's modify the vars with the local defs:
auto nbParams = std::min(block->command.arguments.size(), funcBlock->command.arguments.size()); int nbParams = (int)std::min(block->command.arguments.size(),
funcBlock->command.arguments.size());
std::vector< String > paramCache; std::vector< String > paramCache;
paramCache.push_back(""); paramCache.push_back("");
String val; String val;