Skip to content

Commit

Permalink
Just like char, sizeof(uint8_t) is guaranteed to be 1
Browse files Browse the repository at this point in the history
This is at least true on any plausible system where qmk is actually used.

Per my understanding it's universally true, assuming that uint8_t exists:
https://stackoverflow.com/questions/48655310/can-i-assume-that-sizeofuint8-t-1
  • Loading branch information
jepler committed Aug 29, 2022
1 parent 3fc9dd1 commit 3090223
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class JoystickEvents
virtual void OnGamePadChanged(const GamePadEventData *evt);
};

#define RPT_GAMEPAD_LEN sizeof(GamePadEventData)/sizeof(uint8_t)
#define RPT_GAMEPAD_LEN sizeof(GamePadEventData)

class JoystickReportParser : public HIDReportParser
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class ScaleEvents
virtual void OnScaleChanged(const ScaleEventData *evt);
};

#define RPT_SCALE_LEN sizeof(ScaleEventData)/sizeof(uint8_t)
#define RPT_SCALE_LEN sizeof(ScaleEventData)

class ScaleReportParser : public HIDReportParser
{
Expand Down

0 comments on commit 3090223

Please sign in to comment.