summaryrefslogtreecommitdiff
path: root/src/core/file_sys
diff options
context:
space:
mode:
authorGravatar Lioncash2018-07-20 21:40:13 -0400
committerGravatar Lioncash2018-07-20 21:40:15 -0400
commit05231d8b08f7d473a4c4cf7640227f41de44ac23 (patch)
treeef30c10aa0396ea258da043ceb0949e57b8c8912 /src/core/file_sys
parentMerge pull request #743 from lioncash/view (diff)
downloadyuzu-05231d8b08f7d473a4c4cf7640227f41de44ac23.tar.gz
yuzu-05231d8b08f7d473a4c4cf7640227f41de44ac23.tar.xz
yuzu-05231d8b08f7d473a4c4cf7640227f41de44ac23.zip
vfs: Amend constness on pointers in WriteBytes() and WriteArrays() member functions to be const qualified
These functions don't modify the data being pointed to, so these can be pointers to const data
Diffstat (limited to 'src/core/file_sys')
-rw-r--r--src/core/file_sys/vfs.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/file_sys/vfs.h b/src/core/file_sys/vfs.h
index a5213e0cc..edd689c68 100644
--- a/src/core/file_sys/vfs.h
+++ b/src/core/file_sys/vfs.h
@@ -93,7 +93,7 @@ struct VfsFile : NonCopyable {
93 // Writes an array of type T, size number_elements to offset in file. 93 // Writes an array of type T, size number_elements to offset in file.
94 // Returns the number of bytes (sizeof(T)*number_elements) written successfully. 94 // Returns the number of bytes (sizeof(T)*number_elements) written successfully.
95 template <typename T> 95 template <typename T>
96 size_t WriteArray(T* data, size_t number_elements, size_t offset = 0) { 96 size_t WriteArray(const T* data, size_t number_elements, size_t offset = 0) {
97 static_assert(std::is_trivially_copyable<T>::value, 97 static_assert(std::is_trivially_copyable<T>::value,
98 "Data type must be trivially copyable."); 98 "Data type must be trivially copyable.");
99 99
@@ -103,10 +103,10 @@ struct VfsFile : NonCopyable {
103 // Writes size bytes starting at memory location data to offset in file. 103 // Writes size bytes starting at memory location data to offset in file.
104 // Returns the number of bytes written successfully. 104 // Returns the number of bytes written successfully.
105 template <typename T> 105 template <typename T>
106 size_t WriteBytes(T* data, size_t size, size_t offset = 0) { 106 size_t WriteBytes(const T* data, size_t size, size_t offset = 0) {
107 static_assert(std::is_trivially_copyable<T>::value, 107 static_assert(std::is_trivially_copyable<T>::value,
108 "Data type must be trivially copyable."); 108 "Data type must be trivially copyable.");
109 return Write(reinterpret_cast<u8*>(data), size, offset); 109 return Write(reinterpret_cast<const u8*>(data), size, offset);
110 } 110 }
111 111
112 // Writes one object of type T to offset in file. 112 // Writes one object of type T to offset in file.