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

@@ -75,7 +75,8 @@ class BmpWriter : public ImgWriter
void write(std::ostream &bmp) const override;
private:
struct M5_ATTR_PACKED FileHeader {
struct M5_ATTR_PACKED FileHeader
{
unsigned char magic_number[2];
uint32_t size;
uint16_t reserved1;
@@ -97,12 +98,14 @@ class BmpWriter : public ImgWriter
uint32_t ClrImportant;
};
struct M5_ATTR_PACKED CompleteV1Header {
struct M5_ATTR_PACKED CompleteV1Header
{
FileHeader file;
InfoHeaderV1 info;
};
struct M5_ATTR_PACKED BmpPixel32 {
struct M5_ATTR_PACKED BmpPixel32
{
BmpPixel32 &operator=(const Pixel &rhs) {
red = rhs.red;
green = rhs.green;

View File

@@ -550,12 +550,14 @@ class Ip6Ptr
// Dnet supplied ipv6 opt header is incomplete and
// newer NIC card filters expect a more robust
// ipv6 header option declaration.
struct ip6_opt_fragment {
struct ip6_opt_fragment
{
uint16_t offlg;
uint32_t ident;
};
struct ip6_opt_routing_type2 {
struct ip6_opt_routing_type2
{
uint8_t type;
uint8_t segleft;
uint32_t reserved;
@@ -563,7 +565,8 @@ struct ip6_opt_routing_type2 {
};
#define HOME_ADDRESS_OPTION 0xC9
struct M5_ATTR_PACKED ip6_opt_dstopts {
struct M5_ATTR_PACKED ip6_opt_dstopts
{
uint8_t type;
uint8_t length;
ip6_addr_t addr;

View File

@@ -91,7 +91,8 @@ class PixelConverter
/**
* Color channel conversion and scaling helper class.
*/
struct Channel {
struct Channel
{
/**
* @param offset Offset in bits.
* @param width Width in bits.

View File

@@ -73,7 +73,8 @@ writePng(png_structp pngPtr, png_bytep data, png_size_t length)
strmPtr->write(reinterpret_cast<const char *>(data), length);
}
struct PngWriter::PngStructHandle {
struct PngWriter::PngStructHandle
{
private:
// Make PngStructHandle uncopyable
PngStructHandle(const PngStructHandle&) = delete;

View File

@@ -76,7 +76,8 @@ class PngWriter : public ImgWriter
void write(std::ostream &png) const override;
private:
/** Png Pixel type: not containing padding */
struct M5_ATTR_PACKED PngPixel24 {
struct M5_ATTR_PACKED PngPixel24
{
PngPixel24 &operator=(const Pixel &rhs) {
red = rhs.red;
green = rhs.green;

View File

@@ -96,7 +96,8 @@ class VncInput : public SimObject
ClientCutText = 6
};
struct M5_ATTR_PACKED PixelFormat {
struct M5_ATTR_PACKED PixelFormat
{
uint8_t bpp;
uint8_t depth;
uint8_t bigendian;
@@ -110,19 +111,22 @@ class VncInput : public SimObject
uint8_t padding[3];
};
struct M5_ATTR_PACKED PixelFormatMessage {
struct M5_ATTR_PACKED PixelFormatMessage
{
uint8_t type;
uint8_t padding[3];
PixelFormat px;
};
struct M5_ATTR_PACKED PixelEncodingsMessage {
struct M5_ATTR_PACKED PixelEncodingsMessage
{
uint8_t type;
uint8_t padding;
uint16_t num_encodings;
};
struct M5_ATTR_PACKED FrameBufferUpdateReq {
struct M5_ATTR_PACKED FrameBufferUpdateReq
{
uint8_t type;
uint8_t incremental;
uint16_t x;
@@ -131,21 +135,24 @@ class VncInput : public SimObject
uint16_t height;
};
struct M5_ATTR_PACKED KeyEventMessage {
struct M5_ATTR_PACKED KeyEventMessage
{
uint8_t type;
uint8_t down_flag;
uint8_t padding[2];
uint32_t key;
};
struct M5_ATTR_PACKED PointerEventMessage {
struct M5_ATTR_PACKED PointerEventMessage
{
uint8_t type;
uint8_t button_mask;
uint16_t x;
uint16_t y;
};
struct M5_ATTR_PACKED ClientCutTextMessage {
struct M5_ATTR_PACKED ClientCutTextMessage
{
uint8_t type;
uint8_t padding[3];
uint32_t length;

View File

@@ -106,7 +106,8 @@ class VncServer : public VncInput
NormalPhase
};
struct M5_ATTR_PACKED ServerInitMsg {
struct M5_ATTR_PACKED ServerInitMsg
{
uint16_t fbWidth;
uint16_t fbHeight;
PixelFormat px;
@@ -114,13 +115,15 @@ class VncServer : public VncInput
char name[2]; // just to put M5 in here
};
struct M5_ATTR_PACKED FrameBufferUpdate {
struct M5_ATTR_PACKED FrameBufferUpdate
{
uint8_t type;
uint8_t padding;
uint16_t num_rects;
};
struct M5_ATTR_PACKED FrameBufferRect {
struct M5_ATTR_PACKED FrameBufferRect
{
uint16_t x;
uint16_t y;
uint16_t width;
@@ -128,7 +131,8 @@ class VncServer : public VncInput
int32_t encoding;
};
struct M5_ATTR_PACKED ServerCutText {
struct M5_ATTR_PACKED ServerCutText
{
uint8_t type;
uint8_t padding[3];
uint32_t length;