yuzu-emu
/
yuzu-mainline
Archived
1
0
Fork 0

Update clang format

This commit is contained in:
James Rowe 2018-07-02 10:20:50 -06:00 committed by bunnei
parent 638956aa81
commit 0d46f0df12
37 changed files with 141 additions and 154 deletions

View File

@ -37,8 +37,7 @@ __declspec(noinline, noreturn)
#define ASSERT_MSG(_a_, ...) \ #define ASSERT_MSG(_a_, ...) \
do \ do \
if (!(_a_)) { \ if (!(_a_)) { \
assert_noinline_call( \ assert_noinline_call([&] { LOG_CRITICAL(Debug, "Assertion Failed!\n" __VA_ARGS__); }); \
[&] { LOG_CRITICAL(Debug, "Assertion Failed!\n" __VA_ARGS__); }); \
} \ } \
while (0) while (0)

View File

@ -371,14 +371,12 @@ u64 GetSize(FILE* f) {
// can't use off_t here because it can be 32-bit // can't use off_t here because it can be 32-bit
u64 pos = ftello(f); u64 pos = ftello(f);
if (fseeko(f, 0, SEEK_END) != 0) { if (fseeko(f, 0, SEEK_END) != 0) {
LOG_ERROR(Common_Filesystem, "GetSize: seek failed {}: {}", fmt::ptr(f), LOG_ERROR(Common_Filesystem, "GetSize: seek failed {}: {}", fmt::ptr(f), GetLastErrorMsg());
GetLastErrorMsg());
return 0; return 0;
} }
u64 size = ftello(f); u64 size = ftello(f);
if ((size != pos) && (fseeko(f, pos, SEEK_SET) != 0)) { if ((size != pos) && (fseeko(f, pos, SEEK_SET) != 0)) {
LOG_ERROR(Common_Filesystem, "GetSize: seek failed {}: {}", fmt::ptr(f), LOG_ERROR(Common_Filesystem, "GetSize: seek failed {}: {}", fmt::ptr(f), GetLastErrorMsg());
GetLastErrorMsg());
return 0; return 0;
} }
return size; return size;

View File

@ -28,8 +28,7 @@ ResultCode RomFS_FileSystem::DeleteFile(const std::string& path) const {
ResultCode RomFS_FileSystem::RenameFile(const std::string& src_path, ResultCode RomFS_FileSystem::RenameFile(const std::string& src_path,
const std::string& dest_path) const { const std::string& dest_path) const {
LOG_CRITICAL(Service_FS, "Attempted to rename a file within an ROMFS archive ({}).", LOG_CRITICAL(Service_FS, "Attempted to rename a file within an ROMFS archive ({}).", GetName());
GetName());
// TODO(wwylele): Use correct error code // TODO(wwylele): Use correct error code
return ResultCode(-1); return ResultCode(-1);
} }
@ -62,8 +61,7 @@ ResultCode RomFS_FileSystem::CreateDirectory(const std::string& path) const {
} }
ResultCode RomFS_FileSystem::RenameDirectory(const Path& src_path, const Path& dest_path) const { ResultCode RomFS_FileSystem::RenameDirectory(const Path& src_path, const Path& dest_path) const {
LOG_CRITICAL(Service_FS, "Attempted to rename a file within an ROMFS archive ({}).", LOG_CRITICAL(Service_FS, "Attempted to rename a file within an ROMFS archive ({}).", GetName());
GetName());
// TODO(wwylele): Use correct error code // TODO(wwylele): Use correct error code
return ResultCode(-1); return ResultCode(-1);
} }

View File

@ -658,8 +658,7 @@ static void ReadCommand() {
u8 checksum_calculated = CalculateChecksum(command_buffer, command_length); u8 checksum_calculated = CalculateChecksum(command_buffer, command_length);
if (checksum_received != checksum_calculated) { if (checksum_received != checksum_calculated) {
LOG_ERROR( LOG_ERROR(Debug_GDBStub,
Debug_GDBStub,
"gdb: invalid checksum: calculated {:02X} and read {:02X} for ${}# (length: {})", "gdb: invalid checksum: calculated {:02X} and read {:02X} for ${}# (length: {})",
checksum_calculated, checksum_received, command_buffer, command_length); checksum_calculated, checksum_received, command_buffer, command_length);

View File

@ -331,8 +331,7 @@ static ResultCode GetInfo(u64* result, u64 info_id, u64 handle, u64 info_sub_id)
/// Sets the thread activity /// Sets the thread activity
static ResultCode SetThreadActivity(Handle handle, u32 unknown) { static ResultCode SetThreadActivity(Handle handle, u32 unknown) {
LOG_WARNING(Kernel_SVC, "(STUBBED) called, handle=0x{:08X}, unknown=0x{:08X}", handle, LOG_WARNING(Kernel_SVC, "(STUBBED) called, handle=0x{:08X}, unknown=0x{:08X}", handle, unknown);
unknown);
return RESULT_SUCCESS; return RESULT_SUCCESS;
} }
@ -383,8 +382,7 @@ static u32 GetCurrentProcessorNumber() {
static ResultCode MapSharedMemory(Handle shared_memory_handle, VAddr addr, u64 size, static ResultCode MapSharedMemory(Handle shared_memory_handle, VAddr addr, u64 size,
u32 permissions) { u32 permissions) {
LOG_TRACE( LOG_TRACE(Kernel_SVC,
Kernel_SVC,
"called, shared_memory_handle=0x{:X}, addr=0x{:X}, size=0x{:X}, permissions=0x{:08X}", "called, shared_memory_handle=0x{:X}, addr=0x{:X}, size=0x{:X}, permissions=0x{:08X}",
shared_memory_handle, addr, size, permissions); shared_memory_handle, addr, size, permissions);
@ -717,9 +715,8 @@ static ResultCode WaitForAddress(VAddr address, u32 type, s32 value, s64 timeout
// Signals to an address (via Address Arbiter) // Signals to an address (via Address Arbiter)
static ResultCode SignalToAddress(VAddr address, u32 type, s32 value, s32 num_to_wake) { static ResultCode SignalToAddress(VAddr address, u32 type, s32 value, s32 num_to_wake) {
LOG_WARNING(Kernel_SVC, LOG_WARNING(Kernel_SVC, "called, address=0x{:X}, type=0x{:X}, value=0x{:X}, num_to_wake=0x{:X}",
"called, address=0x{:X}, type=0x{:X}, value=0x{:X}, num_to_wake=0x{:X}", address, address, type, value, num_to_wake);
type, value, num_to_wake);
// If the passed address is a kernel virtual address, return invalid memory state. // If the passed address is a kernel virtual address, return invalid memory state.
if (Memory::IsKernelVirtualAddress(address)) { if (Memory::IsKernelVirtualAddress(address)) {
return ERR_INVALID_ADDRESS_STATE; return ERR_INVALID_ADDRESS_STATE;
@ -769,8 +766,8 @@ static ResultCode ResetSignal(Handle handle) {
/// Creates a TransferMemory object /// Creates a TransferMemory object
static ResultCode CreateTransferMemory(Handle* handle, VAddr addr, u64 size, u32 permissions) { static ResultCode CreateTransferMemory(Handle* handle, VAddr addr, u64 size, u32 permissions) {
LOG_WARNING(Kernel_SVC, "(STUBBED) called addr=0x{:X}, size=0x{:X}, perms=0x{:08X}", addr, LOG_WARNING(Kernel_SVC, "(STUBBED) called addr=0x{:X}, size=0x{:X}, perms=0x{:08X}", addr, size,
size, permissions); permissions);
*handle = 0; *handle = 0;
return RESULT_SUCCESS; return RESULT_SUCCESS;
} }

View File

@ -25,8 +25,8 @@ ResultCode RegisterFileSystem(std::unique_ptr<FileSys::FileSystemFactory>&& fact
ASSERT_MSG(inserted, "Tried to register more than one system with same id code"); ASSERT_MSG(inserted, "Tried to register more than one system with same id code");
auto& filesystem = result.first->second; auto& filesystem = result.first->second;
LOG_DEBUG(Service_FS, "Registered file system {} with id code 0x{:08X}", LOG_DEBUG(Service_FS, "Registered file system {} with id code 0x{:08X}", filesystem->GetName(),
filesystem->GetName(), static_cast<u32>(type)); static_cast<u32>(type));
return RESULT_SUCCESS; return RESULT_SUCCESS;
} }

View File

@ -84,8 +84,8 @@ u32 nvhost_gpu::ZCullBind(const std::vector<u8>& input, std::vector<u8>& output)
u32 nvhost_gpu::SetErrorNotifier(const std::vector<u8>& input, std::vector<u8>& output) { u32 nvhost_gpu::SetErrorNotifier(const std::vector<u8>& input, std::vector<u8>& output) {
IoctlSetErrorNotifier params{}; IoctlSetErrorNotifier params{};
std::memcpy(&params, input.data(), input.size()); std::memcpy(&params, input.data(), input.size());
LOG_WARNING(Service_NVDRV, "(STUBBED) called, offset={:X}, size={:X}, mem={:X}", LOG_WARNING(Service_NVDRV, "(STUBBED) called, offset={:X}, size={:X}, mem={:X}", params.offset,
params.offset, params.size, params.mem); params.size, params.mem);
std::memcpy(output.data(), &params, output.size()); std::memcpy(output.data(), &params, output.size());
return 0; return 0;
} }

View File

@ -102,8 +102,7 @@ void SM::GetService(Kernel::HLERequestContext& ctx) {
if (client_port.Failed()) { if (client_port.Failed()) {
IPC::ResponseBuilder rb = rp.MakeBuilder(2, 0, 0); IPC::ResponseBuilder rb = rp.MakeBuilder(2, 0, 0);
rb.Push(client_port.Code()); rb.Push(client_port.Code());
LOG_ERROR(Service_SM, "called service={} -> error 0x{:08X}", name, LOG_ERROR(Service_SM, "called service={} -> error 0x{:08X}", name, client_port.Code().raw);
client_port.Code().raw);
if (name.length() == 0) if (name.length() == 0)
return; // LibNX Fix return; // LibNX Fix
UNIMPLEMENTED(); UNIMPLEMENTED();

View File

@ -32,8 +32,7 @@ void BSD::Socket(Kernel::HLERequestContext& ctx) {
u32 type = rp.Pop<u32>(); u32 type = rp.Pop<u32>();
u32 protocol = rp.Pop<u32>(); u32 protocol = rp.Pop<u32>();
LOG_WARNING(Service, "(STUBBED) called domain={} type={} protocol={}", domain, type, LOG_WARNING(Service, "(STUBBED) called domain={} type={} protocol={}", domain, type, protocol);
protocol);
u32 fd = next_fd++; u32 fd = next_fd++;

View File

@ -207,8 +207,8 @@ void Maxwell3D::ProcessQueryGet() {
} }
void Maxwell3D::DrawArrays() { void Maxwell3D::DrawArrays() {
LOG_DEBUG(HW_GPU, "called, topology={}, count={}", LOG_DEBUG(HW_GPU, "called, topology={}, count={}", static_cast<u32>(regs.draw.topology.Value()),
static_cast<u32>(regs.draw.topology.Value()), regs.vertex_buffer.count); regs.vertex_buffer.count);
ASSERT_MSG(!(regs.index_array.count && regs.vertex_buffer.count), "Both indexed and direct?"); ASSERT_MSG(!(regs.index_array.count && regs.vertex_buffer.count), "Both indexed and direct?");
auto debug_context = Core::System::GetInstance().GetGPUDebugContext(); auto debug_context = Core::System::GetInstance().GetGPUDebugContext();

View File

@ -251,8 +251,8 @@ void RasterizerOpenGL::SetupShaders(u8* buffer_ptr, GLintptr buffer_offset) {
break; break;
} }
default: default:
LOG_CRITICAL(HW_GPU, "Unimplemented shader index={}, enable={}, offset=0x{:08X}", LOG_CRITICAL(HW_GPU, "Unimplemented shader index={}, enable={}, offset=0x{:08X}", index,
index, shader_config.enable.Value(), shader_config.offset); shader_config.enable.Value(), shader_config.offset);
UNREACHABLE(); UNREACHABLE();
} }

View File

@ -110,8 +110,7 @@ inline GLenum WrapMode(Tegra::Texture::WrapMode wrap_mode) {
// manually mix them. However the shader part of this is not yet implemented. // manually mix them. However the shader part of this is not yet implemented.
return GL_CLAMP_TO_BORDER; return GL_CLAMP_TO_BORDER;
} }
LOG_CRITICAL(Render_OpenGL, "Unimplemented texture wrap mode={}", LOG_CRITICAL(Render_OpenGL, "Unimplemented texture wrap mode={}", static_cast<u32>(wrap_mode));
static_cast<u32>(wrap_mode));
UNREACHABLE(); UNREACHABLE();
return {}; return {};
} }

View File

@ -325,8 +325,7 @@ void GameList::PopupContextMenu(const QPoint& menu_location) {
void GameList::PopulateAsync(const QString& dir_path, bool deep_scan) { void GameList::PopulateAsync(const QString& dir_path, bool deep_scan) {
if (!FileUtil::Exists(dir_path.toStdString()) || if (!FileUtil::Exists(dir_path.toStdString()) ||
!FileUtil::IsDirectory(dir_path.toStdString())) { !FileUtil::IsDirectory(dir_path.toStdString())) {
LOG_ERROR(Frontend, "Could not find game list folder at {}", LOG_ERROR(Frontend, "Could not find game list folder at {}", dir_path.toLocal8Bit().data());
dir_path.toLocal8Bit().data());
search_field->setFilterResult(0, 0); search_field->setFilterResult(0, 0);
return; return;
} }