Commit 7da9b05562d9456157f5c801ff4c526e1fe2e2f0

Authored by Jojo-1000
Committed by Moritz Wirger
1 parent 06ec4330

Update mbedtls version to 3.0.0 from 2.25.0

CMakeLists.txt
1 -cmake_minimum_required(VERSION 3.8) 1 +cmake_minimum_required(VERSION 3.10.2)
2 2
3 if(${CMAKE_VERSION} VERSION_LESS 3.11) 3 if(${CMAKE_VERSION} VERSION_LESS 3.11)
4 cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}) 4 cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
1 -Subproject commit fc86f3f147890a65ffa9b21eef6be96ce35371c5 1 +Subproject commit 8df2f8e7b9c7bb9390ac74bb7bace27edca81a2b
src/EntertainmentMode.cpp
@@ -21,7 +21,6 @@ @@ -21,7 +21,6 @@
21 **/ 21 **/
22 22
23 #include "hueplusplus/EntertainmentMode.h" 23 #include "hueplusplus/EntertainmentMode.h"
24 -#include "mbedtls/certs.h"  
25 #include "mbedtls/ctr_drbg.h" 24 #include "mbedtls/ctr_drbg.h"
26 #include "mbedtls/debug.h" 25 #include "mbedtls/debug.h"
27 #include "mbedtls/entropy.h" 26 #include "mbedtls/entropy.h"
src/TimePattern.cpp
@@ -130,14 +130,14 @@ std::string durationTo_hh_mm_ss(std::chrono::system_clock::duration duration) @@ -130,14 +130,14 @@ std::string durationTo_hh_mm_ss(std::chrono::system_clock::duration duration)
130 { 130 {
131 throw HueException(CURRENT_FILE_INFO, "Duration parameter longer than 1 day"); 131 throw HueException(CURRENT_FILE_INFO, "Duration parameter longer than 1 day");
132 } 132 }
133 - int numH = static_cast<int>(duration_cast<hours>(duration).count()); 133 + unsigned int numH = static_cast<unsigned int>(duration_cast<hours>(duration).count());
134 duration -= hours(numH); 134 duration -= hours(numH);
135 - int numM = static_cast<int>(duration_cast<minutes>(duration).count()); 135 + unsigned int numM = static_cast<unsigned int>(duration_cast<minutes>(duration).count());
136 duration -= minutes(numM); 136 duration -= minutes(numM);
137 - int numS = static_cast<int>(duration_cast<seconds>(duration).count()); 137 + unsigned int numS = static_cast<unsigned int>(duration_cast<seconds>(duration).count());
138 138
139 char result[9]; 139 char result[9];
140 - std::sprintf(result, "%02d:%02d:%02d", numH, numM, numS); 140 + std::snprintf(result, 9, "%02u:%02u:%02u", numH, numM, numS);
141 return std::string(result); 141 return std::string(result);
142 } 142 }
143 143
test/test_ColorUnits.cpp
@@ -125,7 +125,7 @@ TEST(RGB, toHueSaturation) @@ -125,7 +125,7 @@ TEST(RGB, toHueSaturation)
125 EXPECT_EQ(254, hs.saturation); 125 EXPECT_EQ(254, hs.saturation);
126 } 126 }
127 { 127 {
128 - const RGB darkGreen{64, 128, 128 }; 128 + const RGB darkGreen {64, 128, 128};
129 HueSaturation hs = darkGreen.toHueSaturation(); 129 HueSaturation hs = darkGreen.toHueSaturation();
130 EXPECT_EQ(38250, hs.hue); 130 EXPECT_EQ(38250, hs.hue);
131 EXPECT_EQ(127, hs.saturation); 131 EXPECT_EQ(127, hs.saturation);
@@ -192,7 +192,8 @@ TEST(RGB, fromXY) @@ -192,7 +192,8 @@ TEST(RGB, fromXY)
192 int maxDiffB = 0; 192 int maxDiffB = 0;
193 for (int i = 0; i < N; ++i) 193 for (int i = 0; i < N; ++i)
194 { 194 {
195 - const RGB rgb {dist(rng), dist(rng), dist(rng)}; 195 + const RGB rgb {
  196 + static_cast<uint8_t>(dist(rng)), static_cast<uint8_t>(dist(rng)), static_cast<uint8_t>(dist(rng))};
196 const XYBrightness xy = rgb.toXY(); 197 const XYBrightness xy = rgb.toXY();
197 const RGB back = RGB::fromXY(xy); 198 const RGB back = RGB::fromXY(xy);
198 int diffR = (rgb.r - back.r) * (rgb.r - back.r); 199 int diffR = (rgb.r - back.r) * (rgb.r - back.r);