Skip to content

Commit

Permalink
Change 1-bit boolean fields to bool type
Browse files Browse the repository at this point in the history
  • Loading branch information
JonnyHaystack committed Sep 23, 2022
1 parent ea5945f commit 38f20c5
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 27 deletions.
26 changes: 13 additions & 13 deletions include/gamecube_definitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@ enum class GamecubeCommand {
};

typedef struct __attribute__((packed)) {
uint8_t a : 1;
uint8_t b : 1;
uint8_t x : 1;
uint8_t y : 1;
uint8_t start : 1;
uint8_t origin : 1;
bool a : 1;
bool b : 1;
bool x : 1;
bool y : 1;
bool start : 1;
bool origin : 1;
uint8_t reserved0 : 2;

uint8_t dpad_left : 1;
uint8_t dpad_right : 1;
uint8_t dpad_down : 1;
uint8_t dpad_up : 1;
uint8_t z : 1;
uint8_t r : 1;
uint8_t l : 1;
bool dpad_left : 1;
bool dpad_right : 1;
bool dpad_down : 1;
bool dpad_up : 1;
bool z : 1;
bool r : 1;
bool l : 1;
uint8_t reserved1 : 1;

uint8_t stick_x;
Expand Down
28 changes: 14 additions & 14 deletions include/n64_definitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@ enum class N64Command {
};

typedef struct __attribute__((packed)) {
uint8_t dpad_right : 1;
uint8_t dpad_left : 1;
uint8_t dpad_down : 1;
uint8_t dpad_up : 1;
uint8_t start : 1;
uint8_t z : 1;
uint8_t b : 1;
uint8_t a : 1;
bool dpad_right : 1;
bool dpad_left : 1;
bool dpad_down : 1;
bool dpad_up : 1;
bool start : 1;
bool z : 1;
bool b : 1;
bool a : 1;

uint8_t c_right : 1;
uint8_t c_left : 1;
uint8_t c_down : 1;
uint8_t c_up : 1;
uint8_t r : 1;
uint8_t l : 1;
bool c_right : 1;
bool c_left : 1;
bool c_down : 1;
bool c_up : 1;
bool r : 1;
bool l : 1;
uint8_t reserved1 : 1;
uint8_t reserved0 : 1;

Expand Down

0 comments on commit 38f20c5

Please sign in to comment.