1
0
Fork 0
forked from suyu/suyu
suyu/src/common
Vitor K bd0c56c6e7 common: Port some changes from dolphin (#5127)
* IOFile: Make the move constructor and move assignment operator noexcept

Certain parts of the standard library try to determine whether or not a
transfer operation should either be a copy or a move. The prevalent notion
of move constructors/assignment operators is that they should not throw,
they simply move an already existing resource somewhere else.

This is typically done with 'std::move_if_noexcept'. Like the name says,
if a type's move constructor is noexcept, then the functions retrieves an
r-value reference (for move semantics), or an l-value (for copy semantics)
if it is not noexcept.

As IOFile deletes the copy constructor and copy assignment operators,
using IOFile with certain parts of the standard library can fail in
unexcepted ways (especially when used with various container
implementations). This prevents that.

* fix various instances of -1 being assigned to unsigned types

* do not assign in conditional statements

* File/IOFile: Check _tfopen_s properly

* common/file_util.cpp: address review comments

Co-authored-by: Lioncash <mathew1800@gmail.com>
Co-authored-by: Shawn Hoffman <godisgovernment@gmail.com>
Co-authored-by: Sepalani <sepalani@hotmail.fr>
2020-04-01 02:58:42 +02:00
..
logging common/logging: don't use regex for path trimming 2020-01-23 23:08:05 +01:00
x64 Remove unused CPU Vendor string and telemtry field 2020-01-17 18:41:18 -07:00
algorithm.h common/algorithm: Add description comment indicating intended algorithms 2019-10-15 15:25:23 -04:00
alignment.h alignment: Resolve allocator construction issues on debug 2019-10-06 18:49:49 -04:00
assert.h fix clang-format and lambda capture 2019-11-23 01:30:06 +01:00
bit_field.h common_func: Use std::array for INSERT_PADDING_* macros. 2019-11-03 22:22:41 -05:00
bit_util.h texture_cache: Optimize GetMipBlockHeight and GetMipBlockDepth 2019-06-20 21:36:12 -03:00
cityhash.cpp Port #4182 from Citra: "Prefix all size_t with std::" 2018-09-15 15:21:06 +02:00
cityhash.h Port #4182 from Citra: "Prefix all size_t with std::" 2018-09-15 15:21:06 +02:00
CMakeLists.txt shader/transform_feedback: Add host API friendly TFB builder 2020-03-13 18:33:04 -03:00
color.h common/vector_math: Move Vec[x] types into the Common namespace 2019-02-26 22:38:36 -05:00
common_funcs.h common_funcs: Remove semicolons from INSERT_PADDING_* macros 2019-11-14 17:05:27 -05:00
common_paths.h file_util: Add shader directory 2019-02-06 22:20:57 -03:00
common_types.h gpu: Move GPUVAddr definition to common_types. 2019-03-20 22:36:02 -04:00
detached_tasks.cpp general: Use deducation guides for std::lock_guard and std::unique_lock 2019-04-01 12:53:47 -04:00
detached_tasks.h Review comments - part 5 2018-10-02 16:04:10 +02:00
file_util.cpp common: Port some changes from dolphin (#5127) 2020-04-01 02:58:42 +02:00
file_util.h common/file_util: Make GetCurrentDir() return a std::optional 2019-05-23 14:24:13 -04:00
hash.h common/hash: Remove unused HashableStruct 2019-11-13 14:58:43 -05:00
hex_util.cpp common/hex_util: Combine HexVectorToString() and HexArrayToString() 2019-06-12 17:54:05 -04:00
hex_util.h common/hex_util: Reserve std::string memory ahead of time 2019-06-12 17:54:11 -04:00
lz4_compression.cpp common/lz4_compression: Remove #pragma once directive from the cpp file 2019-04-03 22:07:04 -04:00
lz4_compression.h common/{lz4_compression, zstd_compression}: Add missing header guards 2019-04-15 13:00:08 -04:00
math_util.h common/math_util: Support float type rectangles 2020-02-28 16:22:11 -03:00
memory_hook.cpp core: Move PageTable struct into Common. 2019-03-16 22:05:40 -04:00
memory_hook.h core: Move PageTable struct into Common. 2019-03-16 22:05:40 -04:00
microprofile.cpp Integrate the MicroProfile profiling library 2015-08-24 22:16:28 -03:00
microprofile.h Sources: Run clang-format on everything. 2016-09-18 09:38:01 +09:00
microprofileui.h Common: Remove section measurement from profiler (#1731) 2016-04-29 00:07:10 -07:00
misc.cpp Port #4182 from Citra: "Prefix all size_t with std::" 2018-09-15 15:21:06 +02:00
multi_level_queue.h Kernel Scheduler: Make sure the global scheduler shutdowns correctly. 2019-10-15 11:55:24 -04:00
page_table.cpp PageTable: move backing addresses to a children class as the CPU page table does not need them. 2020-03-14 09:43:57 -04:00
page_table.h PageTable: move backing addresses to a children class as the CPU page table does not need them. 2020-03-14 09:43:57 -04:00
param_package.cpp citra_qt/configuration: misc input tab improvements 2018-10-06 15:43:49 +02:00
param_package.h citra_qt/configuration: misc input tab improvements 2018-10-06 15:43:49 +02:00
quaternion.h common/vector_math: Move Vec[x] types into the Common namespace 2019-02-26 22:38:36 -05:00
ring_buffer.h ring_buffer: Use std::atomic_size_t in a static assert 2018-09-18 23:36:04 -04:00
scm_rev.cpp.in common: Add additional SCM revision fields 2019-10-05 00:09:49 -04:00
scm_rev.h common: Add additional SCM revision fields 2019-10-05 00:09:49 -04:00
scope_exit.h common/scope_exit: Replace std::move with std::forward in ScopeExit() 2019-04-11 20:01:33 -04:00
string_util.cpp common/logging: don't use regex for path trimming 2020-01-23 23:08:05 +01:00
string_util.h am: Deglobalize software keyboard applet 2018-11-18 10:53:47 -05:00
swap.h common/swap: Improve codegen of the default swap fallbacks 2019-04-12 00:07:39 -04:00
telemetry.cpp Remove unused CPU Vendor string and telemtry field 2020-01-17 18:41:18 -07:00
telemetry.h compatdb: Use a seperate endpoint for testcase submission 2018-10-28 13:23:02 +01:00
thread.cpp common: Port some changes from dolphin (#5127) 2020-04-01 02:58:42 +02:00
thread.h Address second part of review comments 2020-01-23 20:55:26 +01:00
thread_queue_list.h common/thread_queue_list: Remove unnecessary dependency on boost 2019-03-16 05:01:39 -04:00
threadsafe_queue.h common: SPSCQueue: Notify after incrementing queue size. 2019-12-16 20:39:53 -05:00
timer.cpp Port #3972 from Citra: "common/timer: use std::chrono, avoid platform-dependent code" 2018-07-29 14:58:30 +02:00
timer.h Port #3972 from Citra: "common/timer: use std::chrono, avoid platform-dependent code" 2018-07-29 14:58:30 +02:00
uint128.cpp common/uint128: Add missing top-file source text 2019-03-20 22:38:25 -04:00
uint128.h common/uint128: Add missing header guard 2019-03-20 22:39:00 -04:00
uuid.cpp mii_manager: Cleanup and optimization 2019-04-25 08:07:57 -04:00
uuid.h mii: Implement Delete and Destroy file 2019-04-25 08:07:57 -04:00
vector_math.h common/vector_math: Move Vec[x] types into the Common namespace 2019-02-26 22:38:36 -05:00
web_result.h web_backend: Make Client use the PImpl idiom 2018-10-10 22:29:35 -04:00
zstd_compression.cpp common/zstd_compression: Remove #pragma once directive from source file 2019-05-04 01:54:29 -04:00
zstd_compression.h common/{lz4_compression, zstd_compression}: Add missing header guards 2019-04-15 13:00:08 -04:00