Commit b31fc25f19270aaeade3a78ed099de24846fe614

Authored by Jojo-1000
Committed by Moritz Wirger
1 parent 7da9b055

Fix unused variable warnings.

src/EntertainmentMode.cpp
... ... @@ -29,6 +29,8 @@
29 29 #include "mbedtls/ssl.h"
30 30 #include "mbedtls/timing.h"
31 31  
  32 +#include "hueplusplus/HueExceptionMacro.h"
  33 +
32 34 namespace hueplusplus
33 35 {
34 36 constexpr uint8_t HUE_ENTERTAINMENT_HEADER_SIZE = 16;
... ... @@ -120,7 +122,16 @@ EntertainmentMode::EntertainmentMode(Bridge& b, Group& g)
120 122 /*-------------------------------------------------*\
121 123 | Seed the Deterministic Random Bit Generator (RNG) |
122 124 \*-------------------------------------------------*/
123   - int ret = mbedtls_ctr_drbg_seed(&tls_context->ctr_drbg, mbedtls_entropy_func, &tls_context->entropy, NULL, 0);
  125 + if (mbedtls_ctr_drbg_seed(&tls_context->ctr_drbg, mbedtls_entropy_func, &tls_context->entropy, NULL, 0) != 0)
  126 + {
  127 + mbedtls_entropy_free(&tls_context->entropy);
  128 + mbedtls_ctr_drbg_free(&tls_context->ctr_drbg);
  129 + mbedtls_x509_crt_free(&tls_context->cacert);
  130 + mbedtls_ssl_config_free(&tls_context->conf);
  131 + mbedtls_ssl_free(&tls_context->ssl);
  132 + mbedtls_net_free(&tls_context->server_fd);
  133 + throw HueException(CURRENT_FILE_INFO, "Failed to seed mbedtls RNG");
  134 + }
124 135 }
125 136  
126 137 EntertainmentMode::~EntertainmentMode()
... ...
src/Scene.cpp
... ... @@ -369,7 +369,7 @@ CreateScene& CreateScene::setLightIds(const std::vector<int>& ids)
369 369  
370 370 CreateScene& CreateScene::setRecycle(bool recycle)
371 371 {
372   - request["recycle"] = true;
  372 + request["recycle"] = recycle;
373 373 return *this;
374 374 }
375 375  
... ...
src/SimpleColorHueStrategy.cpp
... ... @@ -55,7 +55,7 @@ bool SimpleColorHueStrategy::setColorXY(const XYBrightness& xy, uint8_t transiti
55 55  
56 56 bool SimpleColorHueStrategy::setColorLoop(bool on, Light& light) const
57 57 {
58   - return light.transaction().setColorLoop(true).commit();
  58 + return light.transaction().setColorLoop(on).commit();
59 59 }
60 60  
61 61 bool SimpleColorHueStrategy::alertHueSaturation(const HueSaturation& hueSat, Light& light) const
... ...