More warning fixes

This commit is contained in:
Atlante45 2015-12-11 16:03:44 -08:00
parent da63357254
commit d3224bfde3
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: {
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") {
_leftBlinkIndex = i;

View file

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

View file

@ -31,7 +31,7 @@ AnimSkeleton::AnimSkeleton(const std::vector<FBXJoint>& joints) {
}
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) {
return i;
}
@ -101,7 +101,7 @@ void AnimSkeleton::buildSkeletonFromJoints(const std::vector<FBXJoint>& joints)
_relativeDefaultPoses.reserve(joints.size());
// 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
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) {
// 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 headIndex = _animSkeleton->nameToJointIndex(QString("Head"));
if (hipsIndex > 0 && headIndex > 0) {
@ -1164,7 +1164,7 @@ void Rig::computeAvatarBoundingCapsule(
// even if they do not have legs (default robot)
totalExtents.addPoint(glm::vec3(0.0f));
auto numPoses = finalPoses.size();
int numPoses = (int)finalPoses.size();
for (int i = 0; i < numPoses; i++) {
const FBXJointShapeInfo& shapeInfo = geometry.joints.at(i).shapeInfo;
AnimPose pose = finalPoses[i];

View file

@ -44,7 +44,7 @@ public:
}
/// 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 getProcessedPPS() const { return _processedPPS.getAverage(); }

View file

@ -278,7 +278,7 @@ std::unique_ptr<NLPacket> JurisdictionMap::packIntoPacket() {
packet->write(reinterpret_cast<char*>(_rootOctalCode), bytes);
// 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);
for (int i=0; i < endNodeCount; i++) {

View file

@ -52,7 +52,7 @@ public:
unsigned char* getRootOctalCode() const { return _rootOctalCode; }
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);

View file

@ -149,7 +149,7 @@ void OctreeEditPacketSender::queuePendingPacketToNodes(std::unique_ptr<NLPacket>
_pendingPacketsLock.lock();
_preServerSingleMessagePackets.push_back(std::move(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) {
_preServerSingleMessagePackets.pop_front();
}
@ -210,7 +210,7 @@ void OctreeEditPacketSender::queueOctreeEditMessage(PacketType type, QByteArray&
_preServerEdits.push_back(messagePair);
// 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) {
_preServerEdits.pop_front();
}

View file

@ -418,12 +418,12 @@ int OctreeSceneStats::packIntoPacket() {
// add the root jurisdiction
if (_jurisdictionRoot) {
// copy the
auto bytes = bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(_jurisdictionRoot));
int bytes = (int)bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(_jurisdictionRoot));
_statsPacket->writePrimitive(bytes);
_statsPacket->write(reinterpret_cast<char*>(_jurisdictionRoot), bytes);
// 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);

View file

@ -321,7 +321,7 @@ void AnimDebugDraw::update() {
const float POSE_RADIUS = 0.1f; // 10 cm
// figure out how many verts we will need.
size_t numVerts = 0;
int numVerts = 0;
for (auto& iter : _absolutePoses) {
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!
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 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());
if (funcBlock) {
// 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;
paramCache.push_back("");
String val;