Repository: skyline-emu/skyline
File: app/src/main/cpp/skyline/services/timesrv/common.h (C/C++)

Code before:
        constexpr TimeSpanType() {}

        constexpr TimeSpanType(i64 ns) : ns(ns) {}

        static constexpr TimeSpanType FromNanoseconds(i64 ns) {
            return {ns};
        }

        static constexpr TimeSpanType FromSeconds(i64 s) {
            return {s * static_cast<i64>(skyline::constant::NsInSecond)};
        }

        static constexpr TimeSpanType FromDays(i64 d) {
            return {d * static_cast<i64>(skyline::constant::NsInDay)};
        }

        constexpr i64 Nanoseconds() const {
            return ns;
        }

        constexpr i64 Seconds() const {
            return ns / static_cast<i64>(skyline::constant::NsInSecond);
        }

        constexpr friend bool operator>(const TimeSpanType &lhs, const TimeSpanType &rhs) {
            return lhs.ns > rhs.ns;
        }

        constexpr friend bool operator<(const TimeSpanType &lhs, const TimeSpanType &rhs) {
            return lhs.ns < rhs.ns;
        }

        constexpr friend TimeSpanType operator+(const TimeSpanType &lhs, const TimeSpanType &rhs) {
            return FromNanoseconds(lhs.ns + rhs.ns);
        }

        constexpr friend TimeSpanType operator-(const TimeSpanType &lhs, const TimeSpanType &rhs) {
            return FromNanoseconds(lhs.ns - rhs.ns);
        }
    };

    /**
     * @brief Holds details about a point in time sourced from a steady clock (e.g. RTC)
     * @url https://switchbrew.org/w/index.php?title=PSC_services#SteadyClockTimePoint
     */
    struct __attribute__((packed)) SteadyClockTimePoint {
        i64 timePoint; //!< Time in seconds
        UUID clockSourceId; //!< The UUID of the steady clock this timepoint comes from

        auto operator<=>(const SteadyClockTimePoint &) const = default;
    };

Review comment (suggestion):
I know that this doesn't explicitly deal with your PR but if there's no reason these are qualified with the `skyline` namespace, remove it.

Code after:
        constexpr TimeSpanType() {}

        constexpr TimeSpanType(i64 ns) : ns(ns) {}

        static constexpr TimeSpanType FromNanoseconds(i64 ns) {
            return {ns};
        }

        static constexpr TimeSpanType FromSeconds(i64 s) {
            return {s * static_cast<i64>(skyline::constant::NsInSecond)};
        }

        static constexpr TimeSpanType FromDays(i64 d) {
            return {d * static_cast<i64>(skyline::constant::NsInDay)};
        }

        constexpr i64 Nanoseconds() const {
            return ns;
        }

        constexpr i64 Microseconds() const {
            return ns / static_cast<i64>(skyline::constant::NsInMicrosecond);
        }

        constexpr i64 Seconds() const {
            return ns / static_cast<i64>(skyline::constant::NsInSecond);
        }

        constexpr friend bool operator>(const TimeSpanType &lhs, const TimeSpanType &rhs) {
            return lhs.ns > rhs.ns;
        }

        constexpr friend bool operator<(const TimeSpanType &lhs, const TimeSpanType &rhs) {
            return lhs.ns < rhs.ns;
        }

        constexpr friend TimeSpanType operator+(const TimeSpanType &lhs, const TimeSpanType &rhs) {
            return FromNanoseconds(lhs.ns + rhs.ns);
        }

        constexpr friend TimeSpanType operator-(const TimeSpanType &lhs, const TimeSpanType &rhs) {
            return FromNanoseconds(lhs.ns - rhs.ns);
        }
    };

    /**
     * @brief Holds details about a point in time sourced from a steady clock (e.g. RTC)
     * @url https://switchbrew.org/w/index.php?title=PSC_services#SteadyClockTimePoint
     */
    struct __attribute__((packed)) SteadyClockTimePoint {
        i64 timePoint; //!< Time in seconds