File tree Expand file tree Collapse file tree 3 files changed +13
-10
lines changed
Expand file tree Collapse file tree 3 files changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -281,8 +281,8 @@ namespace OpenShock {
281281 return count;
282282 }
283283
284- const uint8_t ValidInputPinsCount = GetValidInputPinsCount();
285- const uint8_t ValidOutputPinsCount = GetValidOutputPinsCount();
284+ constexpr uint8_t ValidInputPinsCount = GetValidInputPinsCount();
285+ constexpr uint8_t ValidOutputPinsCount = GetValidOutputPinsCount();
286286 typedef std::bitset<GPIO_NUM_MAX> GPIOPinSet;
287287
288288 constexpr GPIOPinSet GetValidGPIOPins ()
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ namespace OpenShock {
1919 GatewayClient (const std::string& authToken);
2020 ~GatewayClient ();
2121
22- constexpr GatewayClientState state () const { return m_state; }
22+ inline GatewayClientState state () const { return m_state; }
2323
2424 void connect (const char * lcgFqdn);
2525 void disconnect ();
Original file line number Diff line number Diff line change @@ -154,12 +154,15 @@ constexpr bool _semverIsDotSeperatedPreleaseIdentifiers(std::string_view str)
154154
155155 return _semverIsPrereleaseIdentifier (str);
156156}
157- const auto _semverIsPatch = _semverIsNumericIdentifier;
158- const auto _semverIsMinor = _semverIsNumericIdentifier;
159- const auto _semverIsMajor = _semverIsNumericIdentifier;
160- const auto _semverIsPrerelease = _semverIsDotSeperatedPreleaseIdentifiers;
161- const auto _semverIsBuild = _semverIsDotSeperatedBuildIdentifiers;
162- bool _semverIsVersionCore (std::string_view str)
157+
158+ // For readability
159+ #define _semverIsPatch _semverIsNumericIdentifier
160+ #define _semverIsMinor _semverIsNumericIdentifier
161+ #define _semverIsMajor _semverIsNumericIdentifier
162+ #define _semverIsPrerelease _semverIsDotSeperatedPreleaseIdentifiers
163+ #define _semverIsBuild _semverIsDotSeperatedBuildIdentifiers
164+
165+ constexpr bool _semverIsVersionCore (std::string_view str)
163166{
164167 if (str.empty ()) {
165168 return false ;
@@ -172,7 +175,7 @@ bool _semverIsVersionCore(std::string_view str)
172175
173176 return _semverIsMajor (parts[0 ]) && _semverIsMinor (parts[1 ]) && _semverIsPatch (parts[2 ]);
174177}
175- bool _semverIsSemver (std::string_view str)
178+ constexpr bool _semverIsSemver (std::string_view str)
176179{
177180 if (str.empty ()) {
178181 return false ;
You can’t perform that action at this time.
0 commit comments