From 8659764a07873699794c2e5bd8bac25835d41270 Mon Sep 17 00:00:00 2001 From: Johann Date: Tue, 6 Jun 2017 12:05:14 -0700 Subject: [PATCH] buffer.h: Use T for values Change-Id: I2da4110e843b6e361028b921c24b6ca2ea9077d9 --- test/buffer.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/buffer.h b/test/buffer.h index 75016c91e..c954f439c 100644 --- a/test/buffer.h +++ b/test/buffer.h @@ -47,7 +47,7 @@ class Buffer { int stride() const { return stride_; } // Set the buffer (excluding padding) to 'value'. - void Set(const int value); + void Set(const T value); // Set the buffer (excluding padding) to the output of ACMRandom function 'b'. void Set(ACMRandom *rand_class, T (ACMRandom::*rand_func)()); @@ -63,11 +63,11 @@ class Buffer { bool HasPadding() const; // Sets all the values in the buffer to 'padding_value'. - void SetPadding(const int padding_value); + void SetPadding(const T padding_value); // Checks if all the values (excluding padding) are equal to 'value' if the // Buffers are the same size. - bool CheckValues(const int value) const; + bool CheckValues(const T value) const; // Check that padding matches the expected value or there is no padding. bool CheckPadding() const; @@ -98,7 +98,7 @@ class Buffer { const int left_padding_; const int right_padding_; const int bottom_padding_; - int padding_value_; + T padding_value_; int stride_; int raw_size_; T *raw_buffer_; @@ -110,7 +110,7 @@ T *Buffer::TopLeftPixel() const { } template -void Buffer::Set(const int value) { +void Buffer::Set(const T value) { T *src = TopLeftPixel(); for (int height = 0; height < height_; ++height) { for (int width = 0; width < width_; ++width) { @@ -206,7 +206,7 @@ void Buffer::PrintDifference(const Buffer &a) const { } template -void Buffer::SetPadding(const int padding_value) { +void Buffer::SetPadding(const T padding_value) { padding_value_ = padding_value; T *src = raw_buffer_; @@ -216,7 +216,7 @@ void Buffer::SetPadding(const int padding_value) { } template -bool Buffer::CheckValues(const int value) const { +bool Buffer::CheckValues(const T value) const { T *src = TopLeftPixel(); for (int height = 0; height < height_; ++height) { for (int width = 0; width < width_; ++width) { -- 2.40.0