diff --git a/core/units.h b/core/units.h index d9e31030d..d34d4deb5 100644 --- a/core/units.h +++ b/core/units.h @@ -146,11 +146,11 @@ struct duration_t : public unit_base }; static inline duration_t operator""_sec(unsigned long long sec) { - return { .seconds = static_cast(sec) }; + return duration_t { .seconds = static_cast(sec) }; } static inline duration_t operator""_min(unsigned long long min) { - return { .seconds = static_cast(min * 60) }; + return duration_t { .seconds = static_cast(min * 60) }; } struct offset_t : public unit_base @@ -164,15 +164,15 @@ struct depth_t : public unit_base // depth to 2000 km }; static inline depth_t operator""_mm(unsigned long long mm) { - return { .mm = static_cast(mm) }; + return depth_t { .mm = static_cast(mm) }; } static inline depth_t operator""_m(unsigned long long m) { - return { .mm = static_cast(m * 1000) }; + return depth_t { .mm = static_cast(m * 1000) }; } static inline depth_t operator""_ft(unsigned long long ft) { - return { .mm = static_cast(round(ft * 304.8)) }; + return depth_t { .mm = static_cast(round(ft * 304.8)) }; } struct pressure_t : public unit_base @@ -181,15 +181,15 @@ struct pressure_t : public unit_base }; static inline pressure_t operator""_mbar(unsigned long long mbar) { - return { .mbar = static_cast(mbar) }; + return pressure_t { .mbar = static_cast(mbar) }; } static inline pressure_t operator""_bar(unsigned long long bar) { - return { .mbar = static_cast(bar * 1000) }; + return pressure_t { .mbar = static_cast(bar * 1000) }; } static inline pressure_t operator""_atm(unsigned long long atm) { - return { .mbar = static_cast(round(atm * 1013.25)) }; + return pressure_t { .mbar = static_cast(round(atm * 1013.25)) }; } struct o2pressure_t : public unit_base @@ -198,7 +198,7 @@ struct o2pressure_t : public unit_base }; static inline o2pressure_t operator""_baro2(unsigned long long bar) { - return { .mbar = static_cast(bar * 1000) }; + return o2pressure_t { .mbar = static_cast(bar * 1000) }; } struct bearing_t : public unit_base @@ -212,7 +212,7 @@ struct temperature_t : public unit_base }; static inline temperature_t operator""_K(unsigned long long K) { - return { .mkelvin = static_cast(K * 1000) }; + return temperature_t { .mkelvin = static_cast(K * 1000) }; } struct temperature_sum_t : public unit_base @@ -226,11 +226,11 @@ struct volume_t : public unit_base }; static inline volume_t operator""_ml(unsigned long long ml) { - return { .mliter = static_cast(ml) }; + return volume_t { .mliter = static_cast(ml) }; } static inline volume_t operator""_l(unsigned long long l) { - return { .mliter = static_cast(l * 1000) }; + return volume_t { .mliter = static_cast(l * 1000) }; } struct fraction_t : public unit_base @@ -239,11 +239,11 @@ struct fraction_t : public unit_base }; static inline fraction_t operator""_permille(unsigned long long permille) { - return { .permille = static_cast(permille) }; + return fraction_t { .permille = static_cast(permille) }; } static inline fraction_t operator""_percent(unsigned long long percent) { - return { .permille = static_cast(percent * 10) }; + return fraction_t { .permille = static_cast(percent * 10) }; } struct weight_t : public unit_base