misc: Fix coding style for struct's opening braces

The systemc dir was not included in this fix.

First it was identified that there were only occurrences
at 0, 1, 2 and 3 levels of indentation (and a single
occurrence of 2 and 3 spaces), using:

    grep -nrE --exclude-dir=systemc \
        "^ *struct [A-Za-z].* {$" src/

Then the following commands were run to replace:

<indent level>struct X ... {

by:

<indent level>struct X ...
<indent level>{

Level 0:
    grep -nrl --exclude-dir=systemc
        "^struct [A-Za-z].* {$" src/ | \
        xargs sed -Ei \
        's/^struct ([A-Za-z].*) \{$/struct \1\n\{/g'

Level 1:
    grep -nrl --exclude-dir=systemc \
        "^    struct [A-Za-z].* {$" src/ | \
        xargs sed -Ei \
        's/^    struct ([A-Za-z].*) \{$/    struct \1\n    \{/g'

and so on.

Change-Id: I362ef58c86912dabdd272c7debb8d25d587cd455
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39017
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Daniel R. Carvalho
2021-01-09 12:28:03 -03:00
committed by Daniel Carvalho
parent f96de41fcf
commit 2922f763e1
109 changed files with 584 additions and 292 deletions

View File

@@ -53,7 +53,8 @@ EtherDump::EtherDump(const Params &p)
#define PCAP_VERSION_MAJOR 2
#define PCAP_VERSION_MINOR 4
struct pcap_file_header {
struct pcap_file_header
{
uint32_t magic;
uint16_t version_major;
uint16_t version_minor;
@@ -63,7 +64,8 @@ struct pcap_file_header {
uint32_t linktype; // data link type (DLT_*)
};
struct pcap_pkthdr {
struct pcap_pkthdr
{
uint32_t seconds;
uint32_t microseconds;
uint32_t caplen; // length of portion present

View File

@@ -117,7 +117,8 @@ class EtherSwitch : public SimObject
class PortFifo : public Serializable
{
protected:
struct EntryOrder {
struct EntryOrder
{
bool operator() (const PortFifoEntry& lhs,
const PortFifoEntry& rhs) const
{
@@ -171,7 +172,8 @@ class EtherSwitch : public SimObject
EventFunctionWrapper txEvent;
};
struct SwitchTableEntry {
struct SwitchTableEntry
{
Interface *interface;
Tick lastUseTime;
};

View File

@@ -186,7 +186,8 @@ enum IntTypes
};
// Receive Descriptor struct
struct RxDesc {
struct RxDesc
{
union {
struct {
Addr buf;
@@ -221,7 +222,8 @@ struct RxDesc {
};
};
struct TxDesc {
struct TxDesc
{
uint64_t d1;
uint64_t d2;
};
@@ -294,9 +296,11 @@ inline int utcmd(TxDesc *d) { assert(isContext(d)); return bits(d->d2,24,31); }
inline uint64_t NAME() { return bits(_data, OFFSET+BITS-1, OFFSET); } \
inline void NAME(uint64_t d) { replaceBits(_data, OFFSET+BITS-1, OFFSET,d); }
struct Regs : public Serializable {
struct Regs : public Serializable
{
template<class T>
struct Reg {
struct Reg
{
T _data;
T operator()() { return _data; }
const Reg<T> &operator=(T d) { _data = d; return *this;}

View File

@@ -58,7 +58,8 @@ const uint8_t EEPROM_PMATCH0_ADDR = 0xC; // EEPROM Address of PMATCH word 0
/**
* Ethernet device registers
*/
struct dp_regs {
struct dp_regs
{
uint32_t command;
uint32_t config;
uint32_t mear;
@@ -95,7 +96,8 @@ struct dp_regs {
uint32_t tesr;
};
struct dp_rom {
struct dp_rom
{
/**
* for perfect match memory.
* the linux driver doesn't use any other ROM

View File

@@ -351,14 +351,16 @@ enum M5ControlRegister {
M5REG_TX_THREAD = 0x00000001
};
struct ns_desc32 {
struct ns_desc32
{
uint32_t link; /* link field to next descriptor in linked list */
uint32_t bufptr; /* pointer to the first fragment or buffer */
uint32_t cmdsts; /* command/status field */
uint32_t extsts; /* extended status field for VLAN and IP info */
};
struct ns_desc64 {
struct ns_desc64
{
uint64_t link; /* link field to next descriptor in linked list */
uint64_t bufptr; /* pointer to the first fragment or buffer */
uint32_t cmdsts; /* command/status field */

View File

@@ -129,7 +129,8 @@ class Device : public Base
uint64_t RxStatus; // 0x78
} regs;
struct VirtualReg {
struct VirtualReg
{
uint64_t RxData;
uint64_t RxDone;
uint64_t TxData;