diff options
author | 2015-08-19 09:51:00 -0700 | |
---|---|---|
committer | 2015-08-19 09:51:01 -0700 | |
commit | c6ad06acefa096716f8dabed5342f9b89dc43dfe (patch) | |
tree | d7f0f880609d4e7876790a846cdbab4702590109 /tests/RecordTestUtils.h | |
parent | 4b013296bf67df6c8d119a8f5a2b3dd6530c0b6f (diff) |
unsigned -> int for counts and indices in picture-related code
also, (C)
BUG=skia:
Review URL: https://codereview.chromium.org/1300163002
Diffstat (limited to 'tests/RecordTestUtils.h')
-rw-r--r-- | tests/RecordTestUtils.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tests/RecordTestUtils.h b/tests/RecordTestUtils.h index 4bab8e4a39..8243089e5d 100644 --- a/tests/RecordTestUtils.h +++ b/tests/RecordTestUtils.h @@ -1,3 +1,10 @@ +/* + * Copyright 2015 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + #ifndef RecordTestUtils_DEFINED #define RecordTestUtils_DEFINED @@ -20,7 +27,7 @@ struct ReadAs { // Assert that the ith command in record is of type T, and return it. template <typename T> -static const T* assert_type(skiatest::Reporter* r, const SkRecord& record, unsigned index) { +static const T* assert_type(skiatest::Reporter* r, const SkRecord& record, int index) { ReadAs<T> reader; record.visit<void>(index, reader); REPORTER_ASSERT(r, T::kType == reader.type); @@ -36,7 +43,7 @@ template <typename DrawT> struct MatchType { template <typename DrawT> int count_instances_of_type(const SkRecord& record) { MatchType<DrawT> matcher; int counter = 0; - for (unsigned i = 0; i < record.count(); i++) { + for (int i = 0; i < record.count(); i++) { counter += record.visit<int>(i, matcher); } return counter; @@ -44,7 +51,7 @@ template <typename DrawT> int count_instances_of_type(const SkRecord& record) { template <typename DrawT> int find_first_instances_of_type(const SkRecord& record) { MatchType<DrawT> matcher; - for (unsigned i = 0; i < record.count(); i++) { + for (int i = 0; i < record.count(); i++) { if (record.visit<int>(i, matcher)) { return i; } |