From c8ed338d5a9a4f66b3892278dd6bca5ec7492826 Mon Sep 17 00:00:00 2001 From: IndecisiveTurtle <47210458+raphaelthegreat@users.noreply.github.com> Date: Wed, 26 Jun 2024 18:17:39 +0300 Subject: [PATCH] kernel: Const correctness --- src/common/io_file.h | 2 +- src/core/libraries/kernel/file_system.cpp | 2 +- src/core/module.cpp | 1 - src/shader_recompiler/frontend/translate/translate.cpp | 1 + 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/io_file.h b/src/common/io_file.h index e57a5a78..c6dd8082 100644 --- a/src/common/io_file.h +++ b/src/common/io_file.h @@ -181,7 +181,7 @@ public: } template - size_t WriteRaw(void* data, size_t size) const { + size_t WriteRaw(const void* data, size_t size) const { return std::fwrite(data, sizeof(T), size, file); } diff --git a/src/core/libraries/kernel/file_system.cpp b/src/core/libraries/kernel/file_system.cpp index 27a6ccf3..d4fcb294 100644 --- a/src/core/libraries/kernel/file_system.cpp +++ b/src/core/libraries/kernel/file_system.cpp @@ -126,7 +126,7 @@ int PS4_SYSV_ABI posix_close(int d) { return ORBIS_OK; } -size_t PS4_SYSV_ABI sceKernelWrite(int d, void* buf, size_t nbytes) { +size_t PS4_SYSV_ABI sceKernelWrite(int d, const void* buf, size_t nbytes) { if (d <= 2) { // stdin,stdout,stderr char* str = strdup((const char*)buf); if (str[nbytes - 1] == '\n') diff --git a/src/core/module.cpp b/src/core/module.cpp index 1353637e..86893f61 100644 --- a/src/core/module.cpp +++ b/src/core/module.cpp @@ -11,7 +11,6 @@ #include "core/memory.h" #include "core/module.h" #include "core/tls.h" -#include "core/virtual_memory.h" namespace Core { diff --git a/src/shader_recompiler/frontend/translate/translate.cpp b/src/shader_recompiler/frontend/translate/translate.cpp index 0b61be9b..b7593c1a 100644 --- a/src/shader_recompiler/frontend/translate/translate.cpp +++ b/src/shader_recompiler/frontend/translate/translate.cpp @@ -331,6 +331,7 @@ void Translate(IR::Block* block, std::span inst_list, Info& info) case Opcode::IMAGE_SAMPLE_C_LZ: case Opcode::IMAGE_SAMPLE_LZ: case Opcode::IMAGE_SAMPLE: + case Opcode::IMAGE_SAMPLE_L: translator.IMAGE_SAMPLE(inst); break; case Opcode::IMAGE_STORE: