Commit Graph

26 Commits

Author SHA1 Message Date
bunnei
2e456f3303 Merge pull request #2090 from FearlessTobi/port-4599
Port citra-emu/citra#4244 and citra-emu/citra#4599: Changes to BitField
2019-03-20 23:44:20 -04:00
tgsm
8d0a84ff6a Remove GCC version checks
Citra can't be compiled using GCC <7 because of required C++17 support, so these version checks don't need to exist anymore.
2019-02-24 15:24:06 +01:00
Weiyi Wang
7e4911453c common/swap: remove default value for swap type internal storage
This is compromise for swap type being used in union. A union has deleted default constructor if it has at least one variant member with non-trivial default constructor, and no variant member of T has a default member initializer. In the use case of Bitfield, all variant members will be the swap type on endianness mismatch, which would all have non-trivial default constructor if default value is specified, and non of them can have member initializer
2019-02-06 17:24:27 +01:00
Weiyi Wang
195eff19bb common/swap: use template and tag for LE/BE specification
The tag can be useful for other type-generic templates like BitFields to forward the endianness specification
2019-02-06 17:24:13 +01:00
Weiyi Wang
463b3ce0e8 common/swap: add swap template for enum 2019-02-06 17:21:15 +01:00
Cameron Cawley
d1fbb59e33 Port #3732 from Citra: "common: Fix compilation on ARM" 2018-07-29 15:51:31 +02:00
Lioncash
863fa140ec common/swap: Remove unnecessary const on return value of swap() 2018-07-19 09:35:54 -04:00
Lioncash
57e94306c8 common/swap: Use static_cast where applicable 2018-07-19 09:35:13 -04:00
Lioncash
260f21e3a0 common/swap: Use using aliases where applicable 2018-07-19 09:32:13 -04:00
fearlessTobi
05e92c9bb8 Port #3579 from Citra 2018-07-07 13:59:18 +02:00
Daniel Lim Wee Soong
85ef03c3ee common: fix swap functions on Bitrig and OpenBSD
swap{16,32,64} are defined as macros on the two, but client code
tries to invoke them as Common::swap{16,32,64}, which naturally
doesn't work. This hack redefines the macros as inline functions
in the Common namespace: the bodies of the functions are the
same as the original macros, but relying on OS-specific
implementation details like this is of course brittle.
2018-04-03 02:25:11 +08:00
Jan Beich
e6eb2968d7 common: use system bswap* functions on more BSDs 2016-10-27 23:28:30 +00:00
Emmanuel Gil Peyrot
e4393f7ff2 Remove empty newlines in #include blocks.
This makes clang-format useful on those.

Also add a bunch of forgotten transitive includes, which otherwise
prevented compilation.
2016-09-21 11:15:47 +09:00
Yuri Kunde Schlesner
0e23caf9fd Manually tweak source formatting and then re-run clang-format 2016-09-18 21:14:25 -07:00
Emmanuel Gil Peyrot
7e8d205414 Sources: Run clang-format on everything. 2016-09-18 09:38:01 +09:00
Lioncash
c7fd08b159 swap: Get rid of pointer casting for swapping structs
These shouldn't haphazardly convert types
2016-05-08 23:33:52 -04:00
Lioncash
f1d727abfb swap: Get rid of undefined behavior in swapf and swapd
This isn't well-defined in C++.
2016-05-08 23:21:47 -04:00
Lioncash
26dabace31 swap: Remove unused methods
Also gets rid of pointer data variants as this prevents the use of
the regular swapping routines as unary predicates in std lib functions.

They also cast to stricter alignment types, which is undefined behavior.
2016-05-08 23:12:04 -04:00
Lioncash
ad57b24255 common: Get rid of a cast in swap.h 2015-09-11 08:54:33 -04:00
Emmanuel Gil Peyrot
2d044a67c9 Common: Cleanup memory and misc includes. 2015-06-28 00:36:54 +01:00
Emmanuel Gil Peyrot
b1503b2020 Remove every trailing whitespace from the project (but externals). 2015-05-29 21:59:29 +01:00
archshift
e011acaa84 Removed swap code redundancy and moved common swap code to swap.h 2015-03-05 22:46:45 -08:00
Emmanuel Gil Peyrot
6b411c63c9 Common: Remove dead platform #ifdefs to make the code more readable.
Symbian, Xbox, Blackberry and iOS got removed.
FreeBSD and Android kept due to them potentially being able to run Citra in the future.
The iOS specific part also got removed from PPSSPP in order to fix a bug there.
2015-01-06 18:57:28 +00:00
Yuri Kunde Schlesner
da564d3fe0 Fix compile errors in Clang 2014-10-26 16:18:04 -02:00
bunnei
7a136b8a84 fixes to build on linux 2014-04-22 19:42:29 -07:00
bunnei
63e46abdb8 got rid of 'src' folders in each sub-project 2014-04-08 19:25:03 -04:00