summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/common/key_map.h14
-rw-r--r--src/core/file_sys/archive_backend.cpp8
-rw-r--r--src/core/file_sys/archive_backend.h8
-rw-r--r--src/core/loader/elf.cpp6
4 files changed, 18 insertions, 18 deletions
diff --git a/src/common/key_map.h b/src/common/key_map.h
index 0ecec714f..68f7e2f99 100644
--- a/src/common/key_map.h
+++ b/src/common/key_map.h
@@ -4,6 +4,7 @@
4 4
5#pragma once 5#pragma once
6 6
7#include <tuple>
7#include "core/hle/service/hid/hid.h" 8#include "core/hle/service/hid/hid.h"
8 9
9namespace KeyMap { 10namespace KeyMap {
@@ -15,15 +16,14 @@ struct HostDeviceKey {
15 int key_code; 16 int key_code;
16 int device_id; ///< Uniquely identifies a host device 17 int device_id; ///< Uniquely identifies a host device
17 18
18 bool operator < (const HostDeviceKey &other) const { 19 bool operator<(const HostDeviceKey &other) const {
19 if (device_id == other.device_id) { 20 return std::tie(key_code, device_id) <
20 return key_code < other.key_code; 21 std::tie(other.key_code, other.device_id);
21 }
22 return device_id < other.device_id;
23 } 22 }
24 23
25 bool operator == (const HostDeviceKey &other) const { 24 bool operator==(const HostDeviceKey &other) const {
26 return device_id == other.device_id && key_code == other.key_code; 25 return std::tie(key_code, device_id) ==
26 std::tie(other.key_code, other.device_id);
27 } 27 }
28}; 28};
29 29
diff --git a/src/core/file_sys/archive_backend.cpp b/src/core/file_sys/archive_backend.cpp
index 3f81447df..97adf0e12 100644
--- a/src/core/file_sys/archive_backend.cpp
+++ b/src/core/file_sys/archive_backend.cpp
@@ -43,7 +43,7 @@ Path::Path(LowPathType type, u32 size, u32 pointer) : type(type) {
43 } 43 }
44} 44}
45 45
46const std::string Path::DebugStr() const { 46std::string Path::DebugStr() const {
47 switch (GetType()) { 47 switch (GetType()) {
48 case Invalid: 48 case Invalid:
49 default: 49 default:
@@ -66,7 +66,7 @@ const std::string Path::DebugStr() const {
66 } 66 }
67} 67}
68 68
69const std::string Path::AsString() const { 69std::string Path::AsString() const {
70 switch (GetType()) { 70 switch (GetType()) {
71 case Char: 71 case Char:
72 return string; 72 return string;
@@ -83,7 +83,7 @@ const std::string Path::AsString() const {
83 } 83 }
84} 84}
85 85
86const std::u16string Path::AsU16Str() const { 86std::u16string Path::AsU16Str() const {
87 switch (GetType()) { 87 switch (GetType()) {
88 case Char: 88 case Char:
89 return Common::UTF8ToUTF16(string); 89 return Common::UTF8ToUTF16(string);
@@ -99,7 +99,7 @@ const std::u16string Path::AsU16Str() const {
99 } 99 }
100} 100}
101 101
102const std::vector<u8> Path::AsBinary() const { 102std::vector<u8> Path::AsBinary() const {
103 switch (GetType()) { 103 switch (GetType()) {
104 case Binary: 104 case Binary:
105 return binary; 105 return binary;
diff --git a/src/core/file_sys/archive_backend.h b/src/core/file_sys/archive_backend.h
index e7a59a1ed..601e95d8c 100644
--- a/src/core/file_sys/archive_backend.h
+++ b/src/core/file_sys/archive_backend.h
@@ -49,11 +49,11 @@ public:
49 * Gets the string representation of the path for debugging 49 * Gets the string representation of the path for debugging
50 * @return String representation of the path for debugging 50 * @return String representation of the path for debugging
51 */ 51 */
52 const std::string DebugStr() const; 52 std::string DebugStr() const;
53 53
54 const std::string AsString() const; 54 std::string AsString() const;
55 const std::u16string AsU16Str() const; 55 std::u16string AsU16Str() const;
56 const std::vector<u8> AsBinary() const; 56 std::vector<u8> AsBinary() const;
57 57
58private: 58private:
59 LowPathType type; 59 LowPathType type;
diff --git a/src/core/loader/elf.cpp b/src/core/loader/elf.cpp
index 5d7264f12..69df94324 100644
--- a/src/core/loader/elf.cpp
+++ b/src/core/loader/elf.cpp
@@ -250,7 +250,7 @@ const char *ElfReader::GetSectionName(int section) const {
250 return nullptr; 250 return nullptr;
251 251
252 int name_offset = sections[section].sh_name; 252 int name_offset = sections[section].sh_name;
253 const char* ptr = (char*)GetSectionDataPtr(header->e_shstrndx); 253 const char* ptr = reinterpret_cast<const char*>(GetSectionDataPtr(header->e_shstrndx));
254 254
255 if (ptr) 255 if (ptr)
256 return ptr + name_offset; 256 return ptr + name_offset;
@@ -347,10 +347,10 @@ bool ElfReader::LoadSymbols() {
347 SectionID sec = GetSectionByName(".symtab"); 347 SectionID sec = GetSectionByName(".symtab");
348 if (sec != -1) { 348 if (sec != -1) {
349 int stringSection = sections[sec].sh_link; 349 int stringSection = sections[sec].sh_link;
350 const char *stringBase = (const char *)GetSectionDataPtr(stringSection); 350 const char *stringBase = reinterpret_cast<const char*>(GetSectionDataPtr(stringSection));
351 351
352 //We have a symbol table! 352 //We have a symbol table!
353 Elf32_Sym* symtab = (Elf32_Sym *)(GetSectionDataPtr(sec)); 353 const Elf32_Sym* symtab = reinterpret_cast<const Elf32_Sym*>(GetSectionDataPtr(sec));
354 unsigned int numSymbols = sections[sec].sh_size / sizeof(Elf32_Sym); 354 unsigned int numSymbols = sections[sec].sh_size / sizeof(Elf32_Sym);
355 for (unsigned sym = 0; sym < numSymbols; sym++) { 355 for (unsigned sym = 0; sym < numSymbols; sym++) {
356 int size = symtab[sym].st_size; 356 int size = symtab[sym].st_size;