From b0e405e187bf59fbb5ccc9504ad871fb49e713c5 Mon Sep 17 00:00:00 2001 From: Olivier Mehani Date: Sun, 16 Oct 2022 00:20:05 +1100 Subject: [PATCH] Use designated initialisers for watchySettings This [0] allows to skip obsolete fields, and generally not have to rely on field ordering. [0] https://www.cppstories.com/2021/designated-init-cpp20/ Signed-off-by: Olivier Mehani --- examples/WatchFaces/7_SEG/settings.h | 16 ++++++++-------- examples/WatchFaces/Basic/settings.h | 16 ++++++++-------- examples/WatchFaces/DOS/settings.h | 16 ++++++++-------- examples/WatchFaces/MacPaint/settings.h | 16 ++++++++-------- examples/WatchFaces/Pokemon/settings.h | 16 ++++++++-------- examples/WatchFaces/StarryHorizon/settings.h | 16 ++++++++-------- examples/WatchFaces/Tetris/settings.h | 16 ++++++++-------- 7 files changed, 56 insertions(+), 56 deletions(-) diff --git a/examples/WatchFaces/7_SEG/settings.h b/examples/WatchFaces/7_SEG/settings.h index 654a219..53d47e3 100644 --- a/examples/WatchFaces/7_SEG/settings.h +++ b/examples/WatchFaces/7_SEG/settings.h @@ -13,14 +13,14 @@ #define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5 EST, -4 EDT watchySettings settings{ - CITY_ID, - OPENWEATHERMAP_APIKEY, - OPENWEATHERMAP_URL, - TEMP_UNIT, - TEMP_LANG, - WEATHER_UPDATE_INTERVAL, - NTP_SERVER, - GMT_OFFSET_SEC + .cityID = CITY_ID, + .weatherAPIKey = OPENWEATHERMAP_APIKEY, + .weatherURL = OPENWEATHERMAP_URL, + .weatherUnit = TEMP_UNIT, + .weatherLang = TEMP_LANG, + .weatherUpdateInterval = WEATHER_UPDATE_INTERVAL, + .ntpServer = NTP_SERVER, + .gmtOffset = GMT_OFFSET_SEC, }; #endif \ No newline at end of file diff --git a/examples/WatchFaces/Basic/settings.h b/examples/WatchFaces/Basic/settings.h index 654a219..53d47e3 100644 --- a/examples/WatchFaces/Basic/settings.h +++ b/examples/WatchFaces/Basic/settings.h @@ -13,14 +13,14 @@ #define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5 EST, -4 EDT watchySettings settings{ - CITY_ID, - OPENWEATHERMAP_APIKEY, - OPENWEATHERMAP_URL, - TEMP_UNIT, - TEMP_LANG, - WEATHER_UPDATE_INTERVAL, - NTP_SERVER, - GMT_OFFSET_SEC + .cityID = CITY_ID, + .weatherAPIKey = OPENWEATHERMAP_APIKEY, + .weatherURL = OPENWEATHERMAP_URL, + .weatherUnit = TEMP_UNIT, + .weatherLang = TEMP_LANG, + .weatherUpdateInterval = WEATHER_UPDATE_INTERVAL, + .ntpServer = NTP_SERVER, + .gmtOffset = GMT_OFFSET_SEC, }; #endif \ No newline at end of file diff --git a/examples/WatchFaces/DOS/settings.h b/examples/WatchFaces/DOS/settings.h index 654a219..53d47e3 100644 --- a/examples/WatchFaces/DOS/settings.h +++ b/examples/WatchFaces/DOS/settings.h @@ -13,14 +13,14 @@ #define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5 EST, -4 EDT watchySettings settings{ - CITY_ID, - OPENWEATHERMAP_APIKEY, - OPENWEATHERMAP_URL, - TEMP_UNIT, - TEMP_LANG, - WEATHER_UPDATE_INTERVAL, - NTP_SERVER, - GMT_OFFSET_SEC + .cityID = CITY_ID, + .weatherAPIKey = OPENWEATHERMAP_APIKEY, + .weatherURL = OPENWEATHERMAP_URL, + .weatherUnit = TEMP_UNIT, + .weatherLang = TEMP_LANG, + .weatherUpdateInterval = WEATHER_UPDATE_INTERVAL, + .ntpServer = NTP_SERVER, + .gmtOffset = GMT_OFFSET_SEC, }; #endif \ No newline at end of file diff --git a/examples/WatchFaces/MacPaint/settings.h b/examples/WatchFaces/MacPaint/settings.h index 654a219..53d47e3 100644 --- a/examples/WatchFaces/MacPaint/settings.h +++ b/examples/WatchFaces/MacPaint/settings.h @@ -13,14 +13,14 @@ #define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5 EST, -4 EDT watchySettings settings{ - CITY_ID, - OPENWEATHERMAP_APIKEY, - OPENWEATHERMAP_URL, - TEMP_UNIT, - TEMP_LANG, - WEATHER_UPDATE_INTERVAL, - NTP_SERVER, - GMT_OFFSET_SEC + .cityID = CITY_ID, + .weatherAPIKey = OPENWEATHERMAP_APIKEY, + .weatherURL = OPENWEATHERMAP_URL, + .weatherUnit = TEMP_UNIT, + .weatherLang = TEMP_LANG, + .weatherUpdateInterval = WEATHER_UPDATE_INTERVAL, + .ntpServer = NTP_SERVER, + .gmtOffset = GMT_OFFSET_SEC, }; #endif \ No newline at end of file diff --git a/examples/WatchFaces/Pokemon/settings.h b/examples/WatchFaces/Pokemon/settings.h index 654a219..53d47e3 100644 --- a/examples/WatchFaces/Pokemon/settings.h +++ b/examples/WatchFaces/Pokemon/settings.h @@ -13,14 +13,14 @@ #define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5 EST, -4 EDT watchySettings settings{ - CITY_ID, - OPENWEATHERMAP_APIKEY, - OPENWEATHERMAP_URL, - TEMP_UNIT, - TEMP_LANG, - WEATHER_UPDATE_INTERVAL, - NTP_SERVER, - GMT_OFFSET_SEC + .cityID = CITY_ID, + .weatherAPIKey = OPENWEATHERMAP_APIKEY, + .weatherURL = OPENWEATHERMAP_URL, + .weatherUnit = TEMP_UNIT, + .weatherLang = TEMP_LANG, + .weatherUpdateInterval = WEATHER_UPDATE_INTERVAL, + .ntpServer = NTP_SERVER, + .gmtOffset = GMT_OFFSET_SEC, }; #endif \ No newline at end of file diff --git a/examples/WatchFaces/StarryHorizon/settings.h b/examples/WatchFaces/StarryHorizon/settings.h index 654a219..53d47e3 100644 --- a/examples/WatchFaces/StarryHorizon/settings.h +++ b/examples/WatchFaces/StarryHorizon/settings.h @@ -13,14 +13,14 @@ #define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5 EST, -4 EDT watchySettings settings{ - CITY_ID, - OPENWEATHERMAP_APIKEY, - OPENWEATHERMAP_URL, - TEMP_UNIT, - TEMP_LANG, - WEATHER_UPDATE_INTERVAL, - NTP_SERVER, - GMT_OFFSET_SEC + .cityID = CITY_ID, + .weatherAPIKey = OPENWEATHERMAP_APIKEY, + .weatherURL = OPENWEATHERMAP_URL, + .weatherUnit = TEMP_UNIT, + .weatherLang = TEMP_LANG, + .weatherUpdateInterval = WEATHER_UPDATE_INTERVAL, + .ntpServer = NTP_SERVER, + .gmtOffset = GMT_OFFSET_SEC, }; #endif \ No newline at end of file diff --git a/examples/WatchFaces/Tetris/settings.h b/examples/WatchFaces/Tetris/settings.h index 654a219..53d47e3 100644 --- a/examples/WatchFaces/Tetris/settings.h +++ b/examples/WatchFaces/Tetris/settings.h @@ -13,14 +13,14 @@ #define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5 EST, -4 EDT watchySettings settings{ - CITY_ID, - OPENWEATHERMAP_APIKEY, - OPENWEATHERMAP_URL, - TEMP_UNIT, - TEMP_LANG, - WEATHER_UPDATE_INTERVAL, - NTP_SERVER, - GMT_OFFSET_SEC + .cityID = CITY_ID, + .weatherAPIKey = OPENWEATHERMAP_APIKEY, + .weatherURL = OPENWEATHERMAP_URL, + .weatherUnit = TEMP_UNIT, + .weatherLang = TEMP_LANG, + .weatherUpdateInterval = WEATHER_UPDATE_INTERVAL, + .ntpServer = NTP_SERVER, + .gmtOffset = GMT_OFFSET_SEC, }; #endif \ No newline at end of file