From dc8479928c5aee4c6ad6fe4f59006fb604cee701 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sun, 18 Sep 2016 09:38:01 +0900 Subject: Sources: Run clang-format on everything. --- src/core/hle/applets/applet.cpp | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) (limited to 'src/core/hle/applets/applet.cpp') diff --git a/src/core/hle/applets/applet.cpp b/src/core/hle/applets/applet.cpp index ccf35fa07..2b4bd939d 100644 --- a/src/core/hle/applets/applet.cpp +++ b/src/core/hle/applets/applet.cpp @@ -23,23 +23,24 @@ // Specializes std::hash for AppletId, so that we can use it in std::unordered_map. // Workaround for libstdc++ bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60970 namespace std { - template <> - struct hash { - typedef Service::APT::AppletId argument_type; - typedef std::size_t result_type; - - result_type operator()(const argument_type& id_code) const { - typedef std::underlying_type::type Type; - return std::hash()(static_cast(id_code)); - } - }; +template <> +struct hash { + typedef Service::APT::AppletId argument_type; + typedef std::size_t result_type; + + result_type operator()(const argument_type& id_code) const { + typedef std::underlying_type::type Type; + return std::hash()(static_cast(id_code)); + } +}; } namespace HLE { namespace Applets { static std::unordered_map> applets; -static u32 applet_update_event = -1; ///< The CoreTiming event identifier for the Applet update callback. +static u32 applet_update_event = + -1; ///< The CoreTiming event identifier for the Applet update callback. /// The interval at which the Applet update callback will be called, 16.6ms static const u64 applet_update_interval_us = 16666; @@ -60,7 +61,8 @@ ResultCode Applet::Create(Service::APT::AppletId id) { default: LOG_ERROR(Service_APT, "Could not create applet %u", id); // TODO(Subv): Find the right error code - return ResultCode(ErrorDescription::NotFound, ErrorModule::Applet, ErrorSummary::NotSupported, ErrorLevel::Permanent); + return ResultCode(ErrorDescription::NotFound, ErrorModule::Applet, + ErrorSummary::NotSupported, ErrorLevel::Permanent); } return RESULT_SUCCESS; @@ -84,7 +86,7 @@ static void AppletUpdateEvent(u64 applet_id, int cycles_late) { // If the applet is still running after the last update, reschedule the event if (applet->IsRunning()) { CoreTiming::ScheduleEvent(usToCycles(applet_update_interval_us) - cycles_late, - applet_update_event, applet_id); + applet_update_event, applet_id); } else { // Otherwise the applet has terminated, in which case we should clean it up applets[id] = nullptr; @@ -96,7 +98,8 @@ ResultCode Applet::Start(const Service::APT::AppletStartupParameter& parameter) if (result.IsError()) return result; // Schedule the update event - CoreTiming::ScheduleEvent(usToCycles(applet_update_interval_us), applet_update_event, static_cast(id)); + CoreTiming::ScheduleEvent(usToCycles(applet_update_interval_us), applet_update_event, + static_cast(id)); return result; } @@ -116,6 +119,5 @@ void Init() { void Shutdown() { CoreTiming::RemoveEvent(applet_update_event); } - } } // namespace -- cgit v1.2.3 From ebdae19fd226104baec712b9da9939ff82ef3c3a Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Wed, 21 Sep 2016 00:21:23 +0900 Subject: Remove empty newlines in #include blocks. This makes clang-format useful on those. Also add a bunch of forgotten transitive includes, which otherwise prevented compilation. --- src/core/hle/applets/applet.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/core/hle/applets/applet.cpp') diff --git a/src/core/hle/applets/applet.cpp b/src/core/hle/applets/applet.cpp index 2b4bd939d..35e683cb3 100644 --- a/src/core/hle/applets/applet.cpp +++ b/src/core/hle/applets/applet.cpp @@ -2,16 +2,14 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hle/applets/applet.h" #include #include #include #include - #include "common/assert.h" #include "common/common_types.h" - #include "core/core_timing.h" -#include "core/hle/applets/applet.h" #include "core/hle/applets/erreula.h" #include "core/hle/applets/mii_selector.h" #include "core/hle/applets/swkbd.h" -- cgit v1.2.3 From 84fbbe26297652d994d203bde543ec252c2d801a Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Tue, 20 Sep 2016 23:52:38 -0700 Subject: Use negative priorities to avoid special-casing the self-include --- src/core/hle/applets/applet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/hle/applets/applet.cpp') diff --git a/src/core/hle/applets/applet.cpp b/src/core/hle/applets/applet.cpp index 35e683cb3..4311d9897 100644 --- a/src/core/hle/applets/applet.cpp +++ b/src/core/hle/applets/applet.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/applets/applet.h" #include #include #include @@ -10,6 +9,7 @@ #include "common/assert.h" #include "common/common_types.h" #include "core/core_timing.h" +#include "core/hle/applets/applet.h" #include "core/hle/applets/erreula.h" #include "core/hle/applets/mii_selector.h" #include "core/hle/applets/swkbd.h" -- cgit v1.2.3