Skip to content

Commit

Permalink
Use designated initialisers for watchySettings
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
shtrom committed Oct 24, 2022
1 parent 2e13ad2 commit 260353f
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 56 deletions.
16 changes: 8 additions & 8 deletions examples/WatchFaces/7_SEG/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
#define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5 EST, -4 EDT, will be overwritten by weather data

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
16 changes: 8 additions & 8 deletions examples/WatchFaces/Basic/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
#define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5 EST, -4 EDT, will be overwritten by weather data

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
16 changes: 8 additions & 8 deletions examples/WatchFaces/DOS/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
#define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5 EST, -4 EDT, will be overwritten by weather data

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
16 changes: 8 additions & 8 deletions examples/WatchFaces/MacPaint/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
#define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5 EST, -4 EDT, will be overwritten by weather data

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
16 changes: 8 additions & 8 deletions examples/WatchFaces/Pokemon/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
#define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5 EST, -4 EDT, will be overwritten by weather data

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
16 changes: 8 additions & 8 deletions examples/WatchFaces/StarryHorizon/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
#define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5 EST, -4 EDT, will be overwritten by weather data

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
16 changes: 8 additions & 8 deletions examples/WatchFaces/Tetris/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
#define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5 EST, -4 EDT, will be overwritten by weather data

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

0 comments on commit 260353f

Please sign in to comment.