Skip to content

refactor: modernize SensirionI2cSht4x code style and fix implicit conversions#17

Open
Chris0xdeadbeef wants to merge 7 commits into
Sensirion:masterfrom
Chris0xdeadbeef:master
Open

refactor: modernize SensirionI2cSht4x code style and fix implicit conversions#17
Chris0xdeadbeef wants to merge 7 commits into
Sensirion:masterfrom
Chris0xdeadbeef:master

Conversation

@Chris0xdeadbeef
Copy link
Copy Markdown

I found several code quality issues in SensirionI2cSht4x.h and .cpp files:

SensirionI2cSht4x.h:

  • Remove redundant static from file-scope constexpr constants
  • Remove redundant #ifndef include guard, #pragma once is sufficient
  • Replace non-standard GCC typeof with standard C++ decltype

SensirionI2cSht4x.cpp:

  • Replace typedef enum (C style) with typed enum : uint8_t (C++)
  • Replace magic number command IDs with SHT4xCmdId enum values
  • Replace implicit double literals with float suffix
  • Simplify signal conversion functions to single return statement

No functional change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant