From 5ab13e2deb8f904ef2a233749193fa09ea7013c4 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Mon, 22 Mar 2010 18:43:53 -0700 Subject: ruby: style pass --- src/mem/ruby/common/SubBlock.cc | 51 ++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 26 deletions(-) (limited to 'src/mem/ruby/common/SubBlock.cc') diff --git a/src/mem/ruby/common/SubBlock.cc b/src/mem/ruby/common/SubBlock.cc index de40e3f7d..533aefbe7 100644 --- a/src/mem/ruby/common/SubBlock.cc +++ b/src/mem/ruby/common/SubBlock.cc @@ -1,4 +1,3 @@ - /* * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood * All rights reserved. @@ -27,44 +26,44 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* - * $Id$ - */ - #include "mem/ruby/common/SubBlock.hh" SubBlock::SubBlock(const Address& addr, int size) { - m_address = addr; - setSize(size); - for(int i=0; i 0); - int offset = m_address.getOffset(); - for(int i=0; isetByte(i, data.getByte(offset+i)); - } + int size = getSize(); + assert(size > 0); + int offset = m_address.getOffset(); + for (int i = 0; i < size; i++) { + this->setByte(i, data.getByte(offset + i)); + } } -void SubBlock::internalMergeTo(DataBlock& data) const +void +SubBlock::internalMergeTo(DataBlock& data) const { - int size = getSize(); - assert(size > 0); - int offset = m_address.getOffset(); - for(int i=0; igetByte(i)); // This will detect crossing a cache line boundary - } + int size = getSize(); + assert(size > 0); + int offset = m_address.getOffset(); + for (int i = 0; i < size; i++) { + // This will detect crossing a cache line boundary + data.setByte(offset + i, this->getByte(i)); + } } -void SubBlock::print(ostream& out) const +void +SubBlock::print(ostream& out) const { - out << "[" << m_address << ", " << getSize() << ", " << m_data << "]"; + out << "[" << m_address << ", " << getSize() << ", " << m_data << "]"; } -- cgit v1.2.3