Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(560)

Unified Diff: tests/RecordTestUtils.h

Issue 1300163002: unsigned -> int for counts and indices in picture-related code (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: (C) Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/RecordTest.cpp ('k') | tests/RecorderTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/RecordTestUtils.h
diff --git a/tests/RecordTestUtils.h b/tests/RecordTestUtils.h
index 4bab8e4a390b980c707824015399db551789b5e8..8243089e5de76e565cddede5104601438b2e1ddb 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;
}
« no previous file with comments | « tests/RecordTest.cpp ('k') | tests/RecorderTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698