Don't compare differently-signed types

This commit is contained in:
FeRD (Frank Dana)
2019-12-15 14:22:59 -05:00
parent 99565bb342
commit e502f97d8a
6 changed files with 22 additions and 22 deletions

View File

@@ -169,7 +169,7 @@ void Keyframe::AddPoint(double x, double y, InterpolationType interpolate)
// Get the index of a point by matching a coordinate
int64_t Keyframe::FindIndex(Point p) const {
// loop through points, and find a matching coordinate
for (int64_t x = 0; x < Points.size(); x++) {
for (std::vector<Point>::size_type x = 0; x < Points.size(); x++) {
// Get each point
Point existing_point = Points[x];
@@ -333,7 +333,7 @@ Json::Value Keyframe::JsonValue() const {
root["Points"] = Json::Value(Json::arrayValue);
// loop through points, and find a matching coordinate
for (int x = 0; x < Points.size(); x++) {
for (std::vector<Point>::size_type x = 0; x < Points.size(); x++) {
// Get each point
Point existing_point = Points[x];
root["Points"].append(existing_point.JsonValue());
@@ -509,7 +509,7 @@ double Keyframe::GetDelta(int64_t index) const {
// Get a point at a specific index
Point const & Keyframe::GetPoint(int64_t index) const {
// Is index a valid point?
if (index >= 0 && index < Points.size())
if (index >= 0 && index < (int64_t)Points.size())
return Points[index];
else
// Invalid index
@@ -532,7 +532,7 @@ int64_t Keyframe::GetCount() const {
// Remove a point by matching a coordinate
void Keyframe::RemovePoint(Point p) {
// loop through points, and find a matching coordinate
for (int64_t x = 0; x < Points.size(); x++) {
for (std::vector<Point>::size_type x = 0; x < Points.size(); x++) {
// Get each point
Point existing_point = Points[x];
@@ -551,7 +551,7 @@ void Keyframe::RemovePoint(Point p) {
// Remove a point by index
void Keyframe::RemovePoint(int64_t index) {
// Is index a valid point?
if (index >= 0 && index < Points.size())
if (index >= 0 && index < (int64_t)Points.size())
{
// Remove a specific point by index
Points.erase(Points.begin() + index);
@@ -581,7 +581,7 @@ void Keyframe::PrintValues() const {
cout << fixed << setprecision(4);
cout << "Frame Number (X)\tValue (Y)\tIs Increasing\tRepeat Numerator\tRepeat Denominator\tDelta (Y Difference)\n";
for (uint64_t i = 1; i < GetLength(); ++i) {
for (int64_t i = 1; i < GetLength(); ++i) {
cout << i << "\t" << GetValue(i) << "\t" << IsIncreasing(i) << "\t" ;
cout << GetRepeatFraction(i).num << "\t" << GetRepeatFraction(i).den << "\t" << GetDelta(i) << "\n";
}
@@ -597,7 +597,7 @@ void Keyframe::ScalePoints(double scale)
// TODO: What if scale < 0?
// Loop through each point (skipping the 1st point)
for (int64_t point_index = 1; point_index < Points.size(); point_index++) {
for (std::vector<Point>::size_type point_index = 1; point_index < Points.size(); point_index++) {
// Scale X value
Points[point_index].co.X = round(Points[point_index].co.X * scale);
}
@@ -605,7 +605,7 @@ void Keyframe::ScalePoints(double scale)
// Flip all the points in this openshot::Keyframe (useful for reversing an effect or transition, etc...)
void Keyframe::FlipPoints() {
for (int64_t point_index = 0, reverse_index = Points.size() - 1; point_index < reverse_index; point_index++, reverse_index--) {
for (std::vector<Point>::size_type point_index = 0, reverse_index = Points.size() - 1; point_index < reverse_index; point_index++, reverse_index--) {
// Flip the points
using std::swap;
swap(Points[point_index].co.Y, Points[reverse_index].co.Y);