diff options
author | Gabe Black <gabeblack@google.com> | 2018-12-08 02:05:34 -0800 |
---|---|---|
committer | Gabe Black <gabeblack@google.com> | 2019-01-09 01:32:29 +0000 |
commit | 275d2779656fd2dd72762b2eb16a738d1b3b2b18 (patch) | |
tree | 0c15a93a00f8c8529bbf456843bb137629fbe8a9 /src/systemc/ext/tlm_core/tlm_1/tlm_req_rsp/tlm_channels/tlm_fifo/tlm_fifo_resize.h | |
parent | 584a1f6723f8cc20319b6b594d70b19056fb7679 (diff) | |
download | gem5-275d2779656fd2dd72762b2eb16a738d1b3b2b18.tar.xz |
systemc: Fix style issues in the TLM header files.
Change-Id: Id12ffb9b56b3887afcf30120f81ce5eb75a5987b
Reviewed-on: https://gem5-review.googlesource.com/c/15057
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
Maintainer: Anthony Gutierrez <anthony.gutierrez@amd.com>
Diffstat (limited to 'src/systemc/ext/tlm_core/tlm_1/tlm_req_rsp/tlm_channels/tlm_fifo/tlm_fifo_resize.h')
-rw-r--r-- | src/systemc/ext/tlm_core/tlm_1/tlm_req_rsp/tlm_channels/tlm_fifo/tlm_fifo_resize.h | 106 |
1 files changed, 48 insertions, 58 deletions
diff --git a/src/systemc/ext/tlm_core/tlm_1/tlm_req_rsp/tlm_channels/tlm_fifo/tlm_fifo_resize.h b/src/systemc/ext/tlm_core/tlm_1/tlm_req_rsp/tlm_channels/tlm_fifo/tlm_fifo_resize.h index 39932fea1..79292fd78 100644 --- a/src/systemc/ext/tlm_core/tlm_1/tlm_req_rsp/tlm_channels/tlm_fifo/tlm_fifo_resize.h +++ b/src/systemc/ext/tlm_core/tlm_1/tlm_req_rsp/tlm_channels/tlm_fifo/tlm_fifo_resize.h @@ -17,77 +17,67 @@ *****************************************************************************/ -#ifndef __TLM_FIFO_RESIZE_H__ -#define __TLM_FIFO_RESIZE_H__ - -/****************************************************************** -// -// resize interface -// -******************************************************************/ - -namespace tlm { - -template < typename T> -inline -void -tlm_fifo<T>::nb_expand( unsigned int n ) { - - if( m_size >= 0 ) { - m_expand = true; - m_size += n; - request_update(); - } +#ifndef \ + __TLM_CORE_TLM_1_TLM_REQ_RSP_TLM_CHANNELS_TLM_FIFO_TLM_FIFO_RESIZE_H__ +#define \ + __TLM_CORE_TLM_1_TLM_REQ_RSP_TLM_CHANNELS_TLM_FIFO_TLM_FIFO_RESIZE_H__ + +// Resize interface. +namespace tlm +{ + +template <typename T> +inline void +tlm_fifo<T>::nb_expand(unsigned int n) +{ + if (m_size >= 0) { + m_expand = true; + m_size += n; + request_update(); + } } -template < typename T> -inline -void -tlm_fifo<T>::nb_unbound( unsigned int n ) { - - m_expand = true; - m_size = -n; - - if( buffer.size() < static_cast<int>( n ) ) { - buffer.resize( n ); - } +template <typename T> +inline void +tlm_fifo<T>::nb_unbound(unsigned int n) +{ + m_expand = true; + m_size = -n; - request_update(); + if (buffer.size() < static_cast<int>(n)) { + buffer.resize(n); + } + request_update(); } -template < typename T> -inline -bool -tlm_fifo<T>::nb_reduce( unsigned int n ) { - - if( m_size < 0 ) { - return false; - } - - return nb_bound( size() - n ); +template <typename T> +inline bool +tlm_fifo<T>::nb_reduce(unsigned int n) +{ + if (m_size < 0) { + return false; + } + return nb_bound(size() - n); } -template < typename T> -inline -bool -tlm_fifo<T>::nb_bound( unsigned int new_size ) { - - bool ret = true; - - if( static_cast<int>( new_size ) < used() ) { - - new_size = used(); - ret = false; - - } +template <typename T> +inline bool +tlm_fifo<T>::nb_bound(unsigned int new_size) +{ + bool ret = true; - m_size = new_size; - return ret; + if (static_cast<int>(new_size) < used()) { + new_size = used(); + ret = false; + } + m_size = new_size; + return ret; } } // namespace tlm #endif +/* __TLM_CORE_TLM_1_TLM_REQ_RSP_TLM_CHANNELS_TLM_FIFO_TLM_FIFO_RESIZE_H__ */ |