Skip to content

Commit a826a4e

Browse files
authored
Merge pull request #1690 from riscv-software-src/fix-warnings
Fix a few compile warnings
2 parents 2746119 + 0556242 commit a826a4e

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

riscv/debug_module.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class simif_t;
1111
class bus_t;
1212
class processor_t;
1313

14-
typedef struct {
14+
struct debug_module_config_t {
1515
// Size of program_buffer in 32-bit words, as exposed to the rest of the
1616
// world.
1717
unsigned progbufsize = 2;
@@ -23,19 +23,19 @@ typedef struct {
2323
bool support_abstract_fpr_access = true;
2424
bool support_haltgroups = true;
2525
bool support_impebreak = true;
26-
} debug_module_config_t;
26+
};
2727

28-
typedef struct {
28+
struct dmcontrol_t {
2929
bool haltreq;
3030
bool resumereq;
3131
bool hasel;
3232
unsigned hartsel;
3333
bool hartreset;
3434
bool dmactive;
3535
bool ndmreset;
36-
} dmcontrol_t;
36+
};
3737

38-
typedef struct {
38+
struct dmstatus_t {
3939
bool impebreak;
4040
bool allhavereset;
4141
bool anyhavereset;
@@ -53,30 +53,30 @@ typedef struct {
5353
bool authbusy;
5454
bool cfgstrvalid;
5555
unsigned version;
56-
} dmstatus_t;
56+
};
5757

58-
typedef enum cmderr {
58+
enum cmderr_t {
5959
CMDERR_NONE = 0,
6060
CMDERR_BUSY = 1,
6161
CMDERR_NOTSUP = 2,
6262
CMDERR_EXCEPTION = 3,
6363
CMDERR_HALTRESUME = 4,
6464
CMDERR_OTHER = 7
65-
} cmderr_t;
65+
};
6666

67-
typedef struct {
67+
struct abstractcs_t {
6868
bool busy;
6969
unsigned datacount;
7070
unsigned progbufsize;
7171
cmderr_t cmderr;
72-
} abstractcs_t;
72+
};
7373

74-
typedef struct {
74+
struct abstractauto_t {
7575
unsigned autoexecprogbuf;
7676
unsigned autoexecdata;
77-
} abstractauto_t;
77+
};
7878

79-
typedef struct {
79+
struct sbcs_t {
8080
unsigned version;
8181
bool readonaddr;
8282
unsigned sbaccess;
@@ -90,14 +90,14 @@ typedef struct {
9090
bool access16;
9191
bool access8;
9292
bool sbbusyerror;
93-
} sbcs_t;
93+
};
9494

95-
typedef struct {
95+
struct hart_debug_state_t {
9696
bool halted;
9797
bool resumeack;
9898
bool havereset;
9999
uint8_t haltgroup;
100-
} hart_debug_state_t;
100+
};
101101

102102
class debug_module_t : public abstract_device_t
103103
{

riscv/triggers.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ bool trigger_t::textra_match(processor_t * const proc) const noexcept
8383
if (sselect == SSELECT_SCONTEXT) {
8484
reg_t mask = (reg_t(1) << ((xlen == 32) ? CSR_TEXTRA32_SVALUE_LENGTH : CSR_TEXTRA64_SVALUE_LENGTH)) - 1;
8585
assert(CSR_TEXTRA32_SBYTEMASK_LENGTH < CSR_TEXTRA64_SBYTEMASK_LENGTH);
86-
for (int i = 0; i < CSR_TEXTRA64_SBYTEMASK_LENGTH; i++)
86+
for (unsigned i = 0; i < CSR_TEXTRA64_SBYTEMASK_LENGTH; i++)
8787
if (sbytemask & (1 << i))
8888
mask &= ~(reg_t(0xff) << (i * 8));
8989
if ((state->scontext->read() & mask) != (svalue & mask))

0 commit comments

Comments
 (0)