Bug 1335324 - Fix a -Wmax-unsigned-zero warnings (std::max(unsigned int, 0u) r=jwatt
authorSylvestre Ledru <sledru@mozilla.com>
Mon, 06 Feb 2017 16:21:54 +0100
changeset 479644 8598941437bf858986323f1ef313d0c1c24ef7fa
parent 479643 e54a95d4fec35114fa7d2b7bf3df84695c1732d2
child 479645 19ac38a44ddd16770afd11ba5eee6f4c36f44d6d
push id44315
push usertnguyen@mozilla.com
push dateTue, 07 Feb 2017 02:03:39 +0000
reviewersjwatt
bugs1335324
milestone54.0a1
Bug 1335324 - Fix a -Wmax-unsigned-zero warnings (std::max(unsigned int, 0u) r=jwatt MozReview-Commit-ID: BYraLQCG24S
dom/svg/SVGPathData.cpp
--- a/dom/svg/SVGPathData.cpp
+++ b/dom/svg/SVGPathData.cpp
@@ -202,17 +202,17 @@ SVGPathData::GetPathSegAtLength(float aD
       return segIndex;
     }
     i += 1 + SVGPathSegUtils::ArgCountForType(mData[i]);
     segIndex++;
   }
 
   MOZ_ASSERT(i == mData.Length(), "Very, very bad - mData corrupt");
 
-  return std::max(0U, segIndex - 1); // -1 because while loop takes us 1 too far
+  return std::max(1U, segIndex) - 1; // -1 because while loop takes us 1 too far
 }
 
 /**
  * The SVG spec says we have to paint stroke caps for zero length subpaths:
  *
  *   http://www.w3.org/TR/SVG11/implnote.html#PathElementImplementationNotes
  *
  * Cairo only does this for |stroke-linecap: round| and not for