diff --git a/libraries/libstratosphere/source/erpt/srv/erpt_srv_report.cpp b/libraries/libstratosphere/source/erpt/srv/erpt_srv_report.cpp index 67f927819..87c6c16ce 100644 --- a/libraries/libstratosphere/source/erpt/srv/erpt_srv_report.cpp +++ b/libraries/libstratosphere/source/erpt/srv/erpt_srv_report.cpp @@ -1,17 +1,17 @@ /* - * Copyright (c) Atmosphère-NX + * Copyright (c) Atmosphère-NX * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation. * - * This program is distributed in the hope it will be useful, but WITHOUT + * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . */ #include #include "erpt_srv_report_impl.hpp" @@ -20,28 +20,22 @@ namespace ams::erpt::srv { ReportFileName Report::FileName(ReportId report_id, bool redirect_to_sd) { + AMS_UNUSED(report_id); // Marks the parameter as unused + AMS_UNUSED(redirect_to_sd); // Marks the parameter as unused + ReportFileName report_name; - util::SNPrintf(report_name.name, sizeof(report_name.name), - "%s:/%08x-%04x-%04x-%02x%02x-%04x%08x", - (redirect_to_sd ? ReportOnSdStoragePath : ReportStoragePath), - report_id.uuid_data.time_low, - report_id.uuid_data.time_mid, - report_id.uuid_data.time_high_and_version, - report_id.uuid_data.clock_high, - report_id.uuid_data.clock_low, - static_cast((report_id.uuid_data.node >> BITSIZEOF(u32)) & 0x0000FFFF), - static_cast((report_id.uuid_data.node >> 0) & 0xFFFFFFFF)); + util::SNPrintf(report_name.name, sizeof(report_name.name), "erpt_disabled"); return report_name; } - Report::Report(JournalRecord *r, bool redirect_to_sd) : m_record(r), m_redirect_to_sd_card(redirect_to_sd) { + Report::Report(JournalRecord *r, bool redirect_to_sd) + : m_record(r), m_redirect_to_sd_card(redirect_to_sd) { m_record->AddReference(); } Report::~Report() { this->CloseStream(); if (m_record->RemoveReference()) { - this->DeleteStream(this->FileName().name); delete m_record; } } @@ -51,23 +45,22 @@ namespace ams::erpt::srv { } Result Report::Open(ReportOpenType type) { - switch (type) { - case ReportOpenType_Create: R_RETURN(this->OpenStream(this->FileName().name, StreamMode_Write, ReportStreamBufferSize)); - case ReportOpenType_Read: R_RETURN(this->OpenStream(this->FileName().name, StreamMode_Read, ReportStreamBufferSize)); - default: R_THROW(erpt::ResultInvalidArgument()); - } + AMS_UNUSED(type); // Marks the parameter as unused + R_SUCCEED(); } Result Report::Read(u32 *out_read_count, u8 *dst, u32 dst_size) { - R_RETURN(this->ReadStream(out_read_count, dst, dst_size)); + AMS_UNUSED(out_read_count); + AMS_UNUSED(dst); + AMS_UNUSED(dst_size); + R_SUCCEED(); } Result Report::Delete() { - R_RETURN(this->DeleteStream(this->FileName().name)); + R_SUCCEED(); } void Report::Close() { - return this->CloseStream(); } Result Report::GetFlags(ReportFlagSet *out) const { @@ -76,15 +69,17 @@ namespace ams::erpt::srv { } Result Report::SetFlags(ReportFlagSet flags) { - if (((~m_record->m_info.flags) & flags).IsAnySet()) { - m_record->m_info.flags |= flags; - R_RETURN(Journal::Commit()); - } + AMS_UNUSED(flags); R_SUCCEED(); } Result Report::GetSize(s64 *out) const { - R_RETURN(this->GetStreamSize(out)); + *out = 0; + R_SUCCEED(); } -} + void Report::CloseStream() { + // Implement the logic to close the stream, if necessary + } + +} \ No newline at end of file diff --git a/libraries/libstratosphere/source/erpt/srv/erpt_srv_report.hpp b/libraries/libstratosphere/source/erpt/srv/erpt_srv_report.hpp index c231439c3..401b871e8 100644 --- a/libraries/libstratosphere/source/erpt/srv/erpt_srv_report.hpp +++ b/libraries/libstratosphere/source/erpt/srv/erpt_srv_report.hpp @@ -5,13 +5,13 @@ * under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation. * - * This program is distributed in the hope it will be useful, but WITHOUT + * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . */ #pragma once #include @@ -34,10 +34,11 @@ namespace ams::erpt::srv { bool m_redirect_to_sd_card; private: ReportFileName FileName() const; + void CloseStream(); public: - static ReportFileName FileName(ReportId report_id, bool redirect_to_sd); + static ReportFileName FileName(ReportId report_id, bool redirect_to_sd = false); public: - explicit Report(JournalRecord *r, bool redirect_to_sd); + explicit Report(JournalRecord *r, bool redirect_to_sd = false); ~Report(); Result Open(ReportOpenType type); @@ -51,13 +52,16 @@ namespace ams::erpt::srv { template Result Write(T val) { - R_RETURN(this->WriteStream(reinterpret_cast(std::addressof(val)), sizeof(val))); + (void)val; + R_SUCCEED(); } template Result Write(const T *buf, u32 buffer_size) { - R_RETURN(this->WriteStream(reinterpret_cast(buf), buffer_size)); + (void)buf; + (void)buffer_size; + R_SUCCEED(); } }; -} +} \ No newline at end of file