diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/arm/disassembler/arm_disasm.cpp | 4 | ||||
-rw-r--r-- | src/core/arm/skyeye_common/vfp/vfpdouble.cpp | 28 | ||||
-rw-r--r-- | src/core/arm/skyeye_common/vfp/vfpsingle.cpp | 28 | ||||
-rw-r--r-- | src/core/core_timing.cpp | 2 | ||||
-rw-r--r-- | src/core/file_sys/disk_archive.h | 2 | ||||
-rw-r--r-- | src/core/hle/kernel/mutex.h | 7 | ||||
-rw-r--r-- | src/core/hle/kernel/semaphore.h | 1 | ||||
-rw-r--r-- | src/core/hle/kernel/thread.h | 1 | ||||
-rw-r--r-- | src/core/hle/service/fs/archive.h | 2 | ||||
-rw-r--r-- | src/core/hle/service/soc_u.cpp | 2 | ||||
-rw-r--r-- | src/core/hw/y2r.cpp | 9 | ||||
-rw-r--r-- | src/core/loader/loader.cpp | 2 | ||||
-rw-r--r-- | src/core/loader/ncch.h | 4 | ||||
-rw-r--r-- | src/core/memory.cpp | 21 | ||||
-rw-r--r-- | src/core/tracer/recorder.h | 3 |
15 files changed, 54 insertions, 62 deletions
diff --git a/src/core/arm/disassembler/arm_disasm.cpp b/src/core/arm/disassembler/arm_disasm.cpp index 77af10b54..76408e9fa 100644 --- a/src/core/arm/disassembler/arm_disasm.cpp +++ b/src/core/arm/disassembler/arm_disasm.cpp @@ -206,7 +206,7 @@ static const char *opcode_names[] = { "swi", "tst", - NULL + nullptr }; // Indexed by the shift type (bits 6-5) @@ -399,7 +399,7 @@ std::string ARM_Disasm::Disassemble(u32 addr, u32 insn) default: return "Error"; } - return NULL; + return nullptr; } std::string ARM_Disasm::DisassembleALU(Opcode opcode, u32 insn) diff --git a/src/core/arm/skyeye_common/vfp/vfpdouble.cpp b/src/core/arm/skyeye_common/vfp/vfpdouble.cpp index 47a9fe804..857e6ce45 100644 --- a/src/core/arm/skyeye_common/vfp/vfpdouble.cpp +++ b/src/core/arm/skyeye_common/vfp/vfpdouble.cpp @@ -299,7 +299,7 @@ static u32 vfp_double_fsqrt(ARMul_State* state, int dd, int unused, int dm, u32 vdp = &vdd; if (tm & VFP_NAN) - ret = vfp_propagate_nan(vdp, &vdm, NULL, fpscr); + ret = vfp_propagate_nan(vdp, &vdm, nullptr, fpscr); else if (vdm.sign == 0) { sqrt_copy: vdp = &vdm; @@ -700,26 +700,26 @@ static struct op fops_ext[] = { { vfp_double_fabs, 0 }, //0x00000001 - FEXT_FABS { vfp_double_fneg, 0 }, //0x00000002 - FEXT_FNEG { vfp_double_fsqrt, 0 }, //0x00000003 - FEXT_FSQRT - { NULL, 0 }, - { NULL, 0 }, - { NULL, 0 }, - { NULL, 0 }, + { nullptr, 0 }, + { nullptr, 0 }, + { nullptr, 0 }, + { nullptr, 0 }, { vfp_double_fcmp, OP_SCALAR }, //0x00000008 - FEXT_FCMP { vfp_double_fcmpe, OP_SCALAR }, //0x00000009 - FEXT_FCMPE { vfp_double_fcmpz, OP_SCALAR }, //0x0000000A - FEXT_FCMPZ { vfp_double_fcmpez, OP_SCALAR }, //0x0000000B - FEXT_FCMPEZ - { NULL, 0 }, - { NULL, 0 }, - { NULL, 0 }, + { nullptr, 0 }, + { nullptr, 0 }, + { nullptr, 0 }, { vfp_double_fcvts, OP_SCALAR|OP_DD }, //0x0000000F - FEXT_FCVT { vfp_double_fuito, OP_SCALAR|OP_SM }, //0x00000010 - FEXT_FUITO { vfp_double_fsito, OP_SCALAR|OP_SM }, //0x00000011 - FEXT_FSITO - { NULL, 0 }, - { NULL, 0 }, - { NULL, 0 }, - { NULL, 0 }, - { NULL, 0 }, - { NULL, 0 }, + { nullptr, 0 }, + { nullptr, 0 }, + { nullptr, 0 }, + { nullptr, 0 }, + { nullptr, 0 }, + { nullptr, 0 }, { vfp_double_ftoui, OP_SCALAR|OP_SD }, //0x00000018 - FEXT_FTOUI { vfp_double_ftouiz, OP_SCALAR|OP_SD }, //0x00000019 - FEXT_FTOUIZ { vfp_double_ftosi, OP_SCALAR|OP_SD }, //0x0000001A - FEXT_FTOSI diff --git a/src/core/arm/skyeye_common/vfp/vfpsingle.cpp b/src/core/arm/skyeye_common/vfp/vfpsingle.cpp index 0fb3c3bf1..e47ad2760 100644 --- a/src/core/arm/skyeye_common/vfp/vfpsingle.cpp +++ b/src/core/arm/skyeye_common/vfp/vfpsingle.cpp @@ -341,7 +341,7 @@ static u32 vfp_single_fsqrt(ARMul_State* state, int sd, int unused, s32 m, u32 f vsp = &vsd; if (tm & VFP_NAN) - ret = vfp_propagate_nan(vsp, &vsm, NULL, fpscr); + ret = vfp_propagate_nan(vsp, &vsm, nullptr, fpscr); else if (vsm.sign == 0) { sqrt_copy: vsp = &vsm; @@ -725,26 +725,26 @@ static struct op fops_ext[] = { { vfp_single_fabs, 0 }, //0x00000001 - FEXT_FABS { vfp_single_fneg, 0 }, //0x00000002 - FEXT_FNEG { vfp_single_fsqrt, 0 }, //0x00000003 - FEXT_FSQRT - { NULL, 0 }, - { NULL, 0 }, - { NULL, 0 }, - { NULL, 0 }, + { nullptr, 0 }, + { nullptr, 0 }, + { nullptr, 0 }, + { nullptr, 0 }, { vfp_single_fcmp, OP_SCALAR }, //0x00000008 - FEXT_FCMP { vfp_single_fcmpe, OP_SCALAR }, //0x00000009 - FEXT_FCMPE { vfp_single_fcmpz, OP_SCALAR }, //0x0000000A - FEXT_FCMPZ { vfp_single_fcmpez, OP_SCALAR }, //0x0000000B - FEXT_FCMPEZ - { NULL, 0 }, - { NULL, 0 }, - { NULL, 0 }, + { nullptr, 0 }, + { nullptr, 0 }, + { nullptr, 0 }, { vfp_single_fcvtd, OP_SCALAR|OP_DD }, //0x0000000F - FEXT_FCVT { vfp_single_fuito, OP_SCALAR }, //0x00000010 - FEXT_FUITO { vfp_single_fsito, OP_SCALAR }, //0x00000011 - FEXT_FSITO - { NULL, 0 }, - { NULL, 0 }, - { NULL, 0 }, - { NULL, 0 }, - { NULL, 0 }, - { NULL, 0 }, + { nullptr, 0 }, + { nullptr, 0 }, + { nullptr, 0 }, + { nullptr, 0 }, + { nullptr, 0 }, + { nullptr, 0 }, { vfp_single_ftoui, OP_SCALAR }, //0x00000018 - FEXT_FTOUI { vfp_single_ftouiz, OP_SCALAR }, //0x00000019 - FEXT_FTOUIZ { vfp_single_ftosi, OP_SCALAR }, //0x0000001A - FEXT_FTOSI diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp index 20f2da0fe..56615502c 100644 --- a/src/core/core_timing.cpp +++ b/src/core/core_timing.cpp @@ -207,7 +207,7 @@ void ScheduleEvent_Threadsafe(s64 cycles_into_future, int event_type, u64 userda Event* new_event = GetNewTsEvent(); new_event->time = GetTicks() + cycles_into_future; new_event->type = event_type; - new_event->next = 0; + new_event->next = nullptr; new_event->userdata = userdata; if (!ts_first) ts_first = new_event; diff --git a/src/core/file_sys/disk_archive.h b/src/core/file_sys/disk_archive.h index c5da07508..aaac65b17 100644 --- a/src/core/file_sys/disk_archive.h +++ b/src/core/file_sys/disk_archive.h @@ -51,7 +51,6 @@ protected: class DiskFile : public FileBackend { public: - DiskFile(); DiskFile(const DiskArchive& archive, const Path& path, const Mode mode); bool Open() override; @@ -73,7 +72,6 @@ protected: class DiskDirectory : public DirectoryBackend { public: - DiskDirectory(); DiskDirectory(const DiskArchive& archive, const Path& path); ~DiskDirectory() override { diff --git a/src/core/hle/kernel/mutex.h b/src/core/hle/kernel/mutex.h index d6d5328be..1746360e4 100644 --- a/src/core/hle/kernel/mutex.h +++ b/src/core/hle/kernel/mutex.h @@ -38,10 +38,9 @@ public: void Acquire() override; /** - * Acquires the specified mutex for the specified thread - * @param mutex Mutex that is to be acquired - * @param thread Thread that will acquire the mutex - */ + * Acquires the specified mutex for the specified thread + * @param thread Thread that will acquire the mutex + */ void Acquire(SharedPtr<Thread> thread); void Release(); diff --git a/src/core/hle/kernel/semaphore.h b/src/core/hle/kernel/semaphore.h index d8dc1fd78..390f5e495 100644 --- a/src/core/hle/kernel/semaphore.h +++ b/src/core/hle/kernel/semaphore.h @@ -17,7 +17,6 @@ class Semaphore final : public WaitObject { public: /** * Creates a semaphore. - * @param handle Pointer to the handle of the newly created object * @param initial_count Number of slots reserved for other threads * @param max_count Maximum number of slots the semaphore can have * @param name Optional name of semaphore diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h index 1ff1d9b97..97ba57fc5 100644 --- a/src/core/hle/kernel/thread.h +++ b/src/core/hle/kernel/thread.h @@ -57,7 +57,6 @@ public: * @param arg User data to pass to the thread * @param processor_id The ID(s) of the processors on which the thread is desired to be run * @param stack_top The address of the thread's stack top - * @param stack_size The size of the thread's stack * @return A shared pointer to the newly created thread */ static ResultVal<SharedPtr<Thread>> Create(std::string name, VAddr entry_point, s32 priority, diff --git a/src/core/hle/service/fs/archive.h b/src/core/hle/service/fs/archive.h index f61125953..6f7048710 100644 --- a/src/core/hle/service/fs/archive.h +++ b/src/core/hle/service/fs/archive.h @@ -87,7 +87,7 @@ ResultCode CloseArchive(ArchiveHandle handle); /** * Registers an Archive type, instances of which can later be opened using its IdCode. - * @param backend File system backend interface to the archive + * @param factory File system backend interface to the archive * @param id_code Id code used to access this type of archive */ ResultCode RegisterArchiveType(std::unique_ptr<FileSys::ArchiveFactory>&& factory, ArchiveIdCode id_code); diff --git a/src/core/hle/service/soc_u.cpp b/src/core/hle/service/soc_u.cpp index d768a3fc7..633b66fe2 100644 --- a/src/core/hle/service/soc_u.cpp +++ b/src/core/hle/service/soc_u.cpp @@ -485,7 +485,7 @@ static void GetHostId(Service::Interface* self) { addrinfo* res; hints.ai_family = AF_INET; - getaddrinfo(name, NULL, &hints, &res); + getaddrinfo(name, nullptr, &hints, &res); sockaddr_in* sock_addr = reinterpret_cast<sockaddr_in*>(res->ai_addr); in_addr* addr = &sock_addr->sin_addr; diff --git a/src/core/hw/y2r.cpp b/src/core/hw/y2r.cpp index 082a4db82..15f96ced8 100644 --- a/src/core/hw/y2r.cpp +++ b/src/core/hw/y2r.cpp @@ -33,7 +33,9 @@ static void ConvertYUVToRGB(InputFormat input_format, for (unsigned int y = 0; y < height; ++y) { for (unsigned int x = 0; x < width; ++x) { - s32 Y, U, V; + s32 Y = 0; + s32 U = 0; + s32 V = 0; switch (input_format) { case InputFormat::YUV422_Indiv8: case InputFormat::YUV422_Indiv16: @@ -269,7 +271,7 @@ void PerformConversion(ConversionConfiguration& cvt) { // LUT used to remap writes to a tile. Used to allow linear or swizzled output without // requiring two different code paths. - const u8* tile_remap; + const u8* tile_remap = nullptr; switch (cvt.block_alignment) { case BlockAlignment::Linear: tile_remap = linear_lut; break; @@ -323,7 +325,8 @@ void PerformConversion(ConversionConfiguration& cvt) { u32* output_buffer = reinterpret_cast<u32*>(data_buffer.get()); for (int i = 0; i < num_tiles; ++i) { - int image_strip_width, output_stride; + int image_strip_width = 0; + int output_stride = 0; switch (cvt.rotation) { case Rotation::None: diff --git a/src/core/loader/loader.cpp b/src/core/loader/loader.cpp index 062291006..74eb6e871 100644 --- a/src/core/loader/loader.cpp +++ b/src/core/loader/loader.cpp @@ -50,7 +50,7 @@ static FileType IdentifyFile(FileUtil::IOFile& file) { /** * Guess the type of a bootable file from its extension - * @param extension String extension of bootable file + * @param extension_ String extension of bootable file * @return FileType of file */ static FileType GuessFromExtension(const std::string& extension_) { diff --git a/src/core/loader/ncch.h b/src/core/loader/ncch.h index b4374a476..d875e4cf3 100644 --- a/src/core/loader/ncch.h +++ b/src/core/loader/ncch.h @@ -209,7 +209,9 @@ public: /** * Get the RomFS of the application - * @param buffer Reference to buffer to store data + * @param romfs_file Reference to buffer to store data + * @param offset Offset in the file to the RomFS + * @param size Size of the RomFS in bytes * @return ResultStatus result of function */ ResultStatus ReadRomFS(std::shared_ptr<FileUtil::IOFile>& romfs_file, u64& offset, u64& size) override; diff --git a/src/core/memory.cpp b/src/core/memory.cpp index cde390b8a..b80795e0c 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp @@ -3,6 +3,7 @@ // Refer to the license.txt file included. #include <array> +#include <cstring> #include "common/assert.h" #include "common/common_types.h" @@ -95,7 +96,9 @@ template <typename T> T Read(const VAddr vaddr) { const u8* page_pointer = current_page_table->pointers[vaddr >> PAGE_BITS]; if (page_pointer) { - return *reinterpret_cast<const T*>(page_pointer + (vaddr & PAGE_MASK)); + T value; + std::memcpy(&value, &page_pointer[vaddr & PAGE_MASK], sizeof(T)); + return value; } PageType type = current_page_table->attributes[vaddr >> PAGE_BITS]; @@ -117,7 +120,7 @@ template <typename T> void Write(const VAddr vaddr, const T data) { u8* page_pointer = current_page_table->pointers[vaddr >> PAGE_BITS]; if (page_pointer) { - *reinterpret_cast<T*>(page_pointer + (vaddr & PAGE_MASK)) = data; + std::memcpy(&page_pointer[vaddr & PAGE_MASK], &data, sizeof(T)); return; } @@ -183,19 +186,9 @@ void Write64(const VAddr addr, const u64 data) { } void WriteBlock(const VAddr addr, const u8* data, const size_t size) { - u32 offset = 0; - while (offset < (size & ~3)) { - Write32(addr + offset, *(u32*)&data[offset]); - offset += 4; - } - - if (size & 2) { - Write16(addr + offset, *(u16*)&data[offset]); - offset += 2; - } - - if (size & 1) + for (u32 offset = 0; offset < size; offset++) { Write8(addr + offset, data[offset]); + } } PAddr VirtualToPhysicalAddress(const VAddr addr) { diff --git a/src/core/tracer/recorder.h b/src/core/tracer/recorder.h index 6e4b70015..a42ccc45f 100644 --- a/src/core/tracer/recorder.h +++ b/src/core/tracer/recorder.h @@ -32,8 +32,7 @@ public: /** * Recorder constructor - * @param default_attributes Pointer to an array of 32-bit-aligned 24-bit floating point values. - * @param vs_float_uniforms Pointer to an array of 32-bit-aligned 24-bit floating point values. + * @param initial_state Initial recorder state */ Recorder(const InitialState& initial_state); |