Sources: Run clang-format on everything.
This commit is contained in:
parent
fe948af095
commit
dc8479928c
386 changed files with 19560 additions and 18080 deletions
|
@ -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<Service::APT::AppletId> {
|
||||
typedef Service::APT::AppletId argument_type;
|
||||
typedef std::size_t result_type;
|
||||
template <>
|
||||
struct hash<Service::APT::AppletId> {
|
||||
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<argument_type>::type Type;
|
||||
return std::hash<Type>()(static_cast<Type>(id_code));
|
||||
}
|
||||
};
|
||||
result_type operator()(const argument_type& id_code) const {
|
||||
typedef std::underlying_type<argument_type>::type Type;
|
||||
return std::hash<Type>()(static_cast<Type>(id_code));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
namespace HLE {
|
||||
namespace Applets {
|
||||
|
||||
static std::unordered_map<Service::APT::AppletId, std::shared_ptr<Applet>> 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<u64>(id));
|
||||
CoreTiming::ScheduleEvent(usToCycles(applet_update_interval_us), applet_update_event,
|
||||
static_cast<u64>(id));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -116,6 +119,5 @@ void Init() {
|
|||
void Shutdown() {
|
||||
CoreTiming::RemoveEvent(applet_update_event);
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue