Commit graph

742 commits

Author SHA1 Message Date
Pengfei Zhu
987e1279a3
Merge pull request #4155 from FearlessTobi/port-1062
Port yuzu-emu/yuzu#1062 from yuzu: "common: Remove unused old breakpoint source files"
2018-09-01 10:27:18 +08:00
Lioncash
664e92d6ae common: Remove unused old breakpoint source files
These currently aren't used and contain commented out source code that
corresponds to Dolphin's JIT. Given our CPU code is organized quite
differently, we shouldn't be keeping this around (at the moment it just
adds to compile times marginally).
2018-09-01 00:04:25 +02:00
Pengfei Zhu
270155066c
Merge pull request #4154 from FearlessTobi/port-1063
Port #1063 from yuzu: "common/xbyak_abi: Mark defined functions in header as inline "
2018-08-31 12:59:29 +08:00
Lioncash
8fbfd0f7fa logging/backend: Use const reference to refer to log filter
The filter is returned via const reference, so this was making a
pointless copy of the entire filter every time a message was being
pushed into the logger instance.
2018-08-31 00:13:15 +02:00
Lioncash
0fbae792cf common/xbyak_abi: Mark defined functions in header as inline
Avoids potential One Definition Rule violations when these are used in
the future.
2018-08-31 00:08:42 +02:00
Lioncash
d6bf1b31c8 common/xbyak: Use nested namespace specifiers where applicable 2018-08-31 00:08:34 +02:00
Lioncash
ff1f7555de vector_math: Use variable template version of is_signed in Vec classes
Same behavior, less code
2018-08-30 23:38:32 +02:00
James Rowe
50270fd791
Merge pull request #4059 from zhaowenlan1779/udp-input-ui
citra_qt: add motion/touch config
2018-08-26 11:56:50 -06:00
Tobias
604c1b5fc3
web_service: Change authentication system to use JWT (#4041)
* Change authentication system to JWT

* Address review comments
* Get rid of global variable, fix some documentations, fix a bug when verificating
* Refactor PostJson to avoid code duplication
* Rename jwt_token, add functionality to request a new JWT when getting a 401
* Take bools by value instead of const reference
* Send request again when JWT is invalid and use forward declarations
* Omit brackets
2018-08-25 21:39:23 +02:00
Lioncash
c5d0a0ac65 vector_math: Remove unimplemented function prototypes 2018-08-24 18:46:24 +02:00
Lioncash
d10e579292 vector_math: Make functions constexpr where applicable 2018-08-24 18:46:01 +02:00
Lioncash
6b1ec838aa vector_math: Convert typedefs to type aliases 2018-08-24 18:37:18 +02:00
Lioncash
bf964ac6e9 common: Convert type traits templates over to variable template versions where applicable
Uses the C++17 inline variable variants
2018-08-24 18:22:42 +02:00
Lioncash
a74ba1cd59 file_util: Remove compiler version checks around is_trivially_copyable()
The minimum clang/GCC versions we support already support this. We can also
remove is_standard_layout(), as fread and fwrite only require the type to be
trivially copyable.
2018-08-24 18:18:11 +02:00
zhupengfei
8af89b6979
input_common, common: Add a few functions
These functions include reloading udp client, testing communication and configuring calibration. I also added a function to common/thread.h to use WaitFor.
2018-08-11 14:09:35 +08:00
Merry
d1c364bb85
Merge pull request #4073 from zhaowenlan1779/port-yuzu-988
Port "common/color: Minor cleanup" from yuzu
2018-08-10 21:18:01 +01:00
Lioncash
23e8dd66c4 math_util: Always initialize members of Rectangle
Prevents potentially using the members uninitialized.
2018-08-10 10:11:25 +08:00
Lioncash
319d685b13 common/color: Remove unnecessary const qualifiers on return types
These are just superfluous and not necessesary
2018-08-10 09:35:28 +08:00
Lioncash
b956a2be1c common/color: Get rid of undefined behavior
Gets rid of type punning via reinterpret_cast within functions. Instead,
we use memcpy to transfer the contents across types.
2018-08-10 09:35:27 +08:00
Lioncash
0495ba5d91 file_util: Avoid sign-conversions in WriteArray() and ReadArray()
Prevents compiler warnings.
2018-08-08 15:45:31 +08:00
James Rowe
c35a251d86
Merge pull request #3985 from BreadFish64/fix-warnings
core: clean up warnings
2018-08-02 11:14:57 -06:00
James Rowe
14b0435df2
Merge pull request #3994 from FearlessTobi/replace-clamp-functions
Remove MathUtil::Clamp and replace it with its std:: counterpart
2018-08-02 11:08:07 -06:00
James Rowe
c771dd9813
Merge pull request #4021 from FearlessTobi/port-709
Port #709 from yuzu: "common/misc: Deduplicate code in GetLastErrorMsg()
2018-08-02 11:00:53 -06:00
BreadFish64
aa4b71d0ce update fmt to latest stable release
5.1.0
fixes a multitude of errors on MSVC
2018-08-01 14:10:24 -05:00
Merry
ba6eee71f5
Merge pull request #4024 from zhaowenlan1779/port-yuzu-745
Port yuzu-emu/yuzu#745 from yuzu
2018-08-01 15:02:40 +01:00
Lioncash
b92af5a858
param_package: Take std::string by value in string-based Set() function
Allows avoiding string copies by letting the strings be moved into the
function calls.
2018-08-01 17:21:11 +08:00
Merry
9af731793a
Merge pull request #4025 from zhaowenlan1779/port-yuzu-775
Port "string_util: Minor changes" from yuzu
2018-07-30 18:28:38 +01:00
Merry
ec76cd82b0
Merge pull request #4037 from zhaowenlan1779/port-yuzu-710
Port "common/common_funcs: Remove unused rotation functions" from yuzu
2018-07-30 18:28:11 +01:00
James Rowe
ecb3dc2fb8
Merge pull request #4038 from zhaowenlan1779/port-yuzu-711
Port "common/swap: Minor changes" from yuzu
2018-07-30 10:21:49 -06:00
James Rowe
8fd9f22657
Merge pull request #4030 from zhaowenlan1779/port-yuzu-743
Port "logging: Use std::string_view where applicable" from yuzu
2018-07-30 10:19:28 -06:00
Lioncash
1a0529a064 common/swap: Remove unnecessary const on return value of swap() 2018-07-30 21:30:15 +08:00
Lioncash
a2203e1566 common/swap: Use static_cast where applicable 2018-07-30 21:30:14 +08:00
Lioncash
5a66820c20 common/swap: Use using aliases where applicable 2018-07-30 21:30:13 +08:00
fearlessTobi
b0c35c54ca Fix travis MinGW build 2018-07-30 14:50:23 +02:00
Lioncash
b539745153 common/common_funcs: Remove unused rotation functions
These are unused and essentially don't provide much benefit either. If
we ever need rotation functions, these can be introduced in a way that
they don't sit in a common_* header and require a bunch of ifdefing to
simply be available
2018-07-30 20:08:59 +08:00
Ben
d5333c37de
Merge pull request #4033 from zhaowenlan1779/port-yuzu-764
Port "file_util: Minor changes to ScanDirectoryTree() and ForeachDirectoryEntry()" from yuzu
2018-07-30 13:51:21 +02:00
Merry
4acc4d87d6
Merge pull request #4032 from zhaowenlan1779/port-yuzu-758
Port "common: Remove synchronized_wrapper.h" from yuzu
2018-07-30 12:36:45 +01:00
Merry
c4c158c6b6
Merge pull request #4036 from zhaowenlan1779/port-yuzu-705
Port "file_util: return string by const reference for GetExeDirectory()" from yuzu
2018-07-30 12:10:35 +01:00
Lioncash
995d1cd785 string_util: Get rid of separate resize() in CPToUTF16(), UTF16ToUTF8(), CodeToUTF8() and UTF8ToUTF16()
There's no need to perform the resize separately here, since the
constructor allows presizing the buffer.

Also move the empty string check before the construction of the string
to make the early out more straightforward.
2018-07-30 18:18:15 +08:00
Lioncash
f34dde32d1 string_util: Use emplace_back() in SplitString() instead of push_back()
This is equivalent to doing:

push_back(std::string(""));

which is likely not to cause issues, assuming a decent std::string
implementation with small-string optimizations implemented in its
design, however it's still a little unnecessary to copy that buffer
regardless. Instead, we can use emplace_back() to directly construct the
empty string within the std::vector instance, eliminating any possible
overhead from the copy.
2018-07-30 18:18:14 +08:00
Lioncash
841bb4e5bd string_util: Remove unnecessary std::string instance in TabsToSpaces()
We can just use the variant of std::string's replace() function that can
replace an occurrence with N copies of the same character, eliminating
the need to allocate a std::string containing a buffer of spaces.
2018-07-30 18:18:12 +08:00
Lioncash
99b2a871a7 file_util: return string by const reference for GetExeDirectory()
This disallows modifying the internal string buffer (which shouldn't be
modified anyhow).
2018-07-30 16:55:55 +08:00
Weiyi Wang
77f4859059
Merge pull request #4026 from zhaowenlan1779/port-yuzu-765
Port "file_util: Remove goto usages from Copy()" from yuzu
2018-07-30 11:44:32 +03:00
Lioncash
df5069f8c0 file_util: Use a u64 to represent number of entries
This avoids a truncating cast on size. I doubt we'd ever traverse a
directory this large, however we also shouldn't truncate sizes away.
2018-07-30 16:19:03 +08:00
Lioncash
cc6cb45536 file_util: std::move FST entries in ScanDirectoryTree()
Avoids unnecessary copies when building up the FST entries.
2018-07-30 16:16:58 +08:00
Lioncash
1eb3d0c634 common: Remove synchronized_wrapper.h
This is entirely unused in the codebase.
2018-07-30 15:12:04 +08:00
Lioncash
1affca05c7 logging/filter: Use std::string_view in ParseFilterString()
Allows avoiding constructing std::string instances, since this only
reads an arbitrary sequence of characters.

We can also make ParseFilterRule() internal, since it doesn't depend on
any private instance state of Filter
2018-07-30 14:56:53 +08:00
Lioncash
798ebda049 logging/backend: Add missing standard includes
A few inclusions were being satisfied indirectly. To prevent breakages
in the future, include these directly.
2018-07-30 14:56:52 +08:00
Lioncash
765c7e711a logging/backend: Use std::string_view in RemoveBackend() and GetBackend()
These can just use a view to a string since its only comparing against
two names in both cases for matches. This avoids constructing
std::string instances where they aren't necessary.
2018-07-30 14:56:51 +08:00
Lioncash
8068f506c5 string_util: Remove AsciiToHex()
Easy TODO
2018-07-30 09:06:14 +08:00
Lioncash
d3a52e45e3 file_util: Remove goto usages from Copy()
We can just leverage std::unique_ptr to automatically close these for us
in error cases instead of jumping to the end of the function to call
fclose on them.
2018-07-30 08:48:58 +08:00
Lioncash
5b691d3fe0 param_package: Use std::unordered_map's insert_or_assign instead of map indexing
This avoids a redundant std::string construction if a key doesn't exist
in the map already.

e.g.

data[key] requires constructing a new default instance of the value in
the map (but this is wasteful, since we're already setting something
into the map over top of it).
2018-07-30 08:22:42 +08:00
Lioncash
290bfa1804 param_package: Get rid of file-static std::string construction
Avoids potential dynamic allocation occuring during program launch
2018-07-30 08:22:41 +08:00
Lioncash
3ad1ee65ad Port #709 from yuzu: "common/misc: Deduplicate code in GetLastErrorMsg()" 2018-07-29 16:28:58 +02:00
James Rowe
d79cb6373d
Merge pull request #3972 from zhaowenlan1779/common-timer
common/timer: use std::chrono, avoid platform-dependent code
2018-07-25 10:00:04 -06:00
zhupengfei
cc1f44f7bd
common/string_utils: replace boost::transform with std counterpart
Note: according to cppreference it is necessary to convert char to unsigned char when using std::tolower and std::toupper, otherwise the behaviour would be undefined.
2018-07-25 08:04:00 +08:00
fearlessTobi
7a3e126a4f Replace MathUtil::Clamp with its std counterpart 2018-07-24 19:08:17 +02:00
Weiyi Wang
87872aa369
Merge pull request #3976 from MerryMage/rm-code_block
common: CodeBlock is unused
2018-07-23 09:21:37 +03:00
MerryMage
eae523ae17 common: CodeBlock is unused 2018-07-22 21:04:29 +01:00
Weiyi Wang
29ddbe4e7b
Merge pull request #3973 from B3n30/MPSCQueue
remove polymorphism issue
2018-07-22 22:22:22 +03:00
zhupengfei
872e505cc6
common/timer: use std::chrono, avoid platform-dependent code
* core/timer: use even more std::chrono

* common/timer: convert GetLocalTimeSinceJan1970
2018-07-22 15:40:07 +08:00
B3n30
8480899d8b remove polymorphism issue 2018-07-21 16:16:21 +02:00
Lioncash
0a8563fb79 telemetry: Remove unnecessary Field constructor
We can just take the value parameter by value which allows both moving
into it, and copies at the same time, depending on the calling code.
2018-07-18 16:18:34 -04:00
Lioncash
3244042c4c telemetry: Make operator== and operator!= const member functions of Field
These operators don't modify internal class state, so they can be made
const member functions. While we're at it, drop the unnecessary inline
keywords. Member functions that are defined in the class declaration are
already inline by default.
2018-07-18 16:17:40 -04:00
Lioncash
faa62b0d1e telemetry: Default copy/move constructors and assignment operators
This provides the equivalent behavior, but without as much boilerplate.
While we're at it, explicitly default the move constructor, since we
have a move-assignment operator defined.
2018-07-18 16:15:58 -04:00
zhupengfei
18664c719e
frontend/applets: misc fixes
* Renamed applet to applets

* Added log classes Applet and Applet.SWKBD

* Fixes to get it compile
2018-06-30 08:01:49 +08:00
wwylele
0eab948728 reformat all files with clang-format 2018-06-29 16:56:12 +03:00
wwylele
7c5a76e58b log: replace all NGLOG with LOG 2018-06-29 14:18:07 +03:00
wwylele
fde415968e log: remove deprecated log macros 2018-06-29 14:02:29 +03:00
NarcolepticK
f831a08224 logging: Added NGLOG_GENERIC (needed for vm_manager) 2018-06-22 18:48:25 -04:00
zhupengfei
ddc97b15f4 common: Parse Nightly/Canary build version 2018-06-20 09:30:26 +08:00
Weiyi Wang
09982c3386
Merge pull request #3732 from ccawley2011/fix-arm
Fix compilation on ARM
2018-05-26 20:14:55 +03:00
James
29551c187a Add missing std::string import in text_formatter 2018-05-19 21:31:09 +10:00
Cameron Cawley
101d8964f1 common: Fix compilation on ARM 2018-05-13 11:34:45 +01:00
Daniel Lim Wee Soong
51398e0301 Logging: Add customizable logging backends and fmtlib based macros
* Change the logging backend to support multiple sinks through the
Backend Interface
* Add a new set of logging macros to use fmtlib instead.
* Qt: Compile as GUI application on windows to make the console hidden by
default. Add filter configuration and a button to open log location.
* SDL: Migrate to the new logging macros
2018-04-23 21:32:56 -06:00
wwylele
39fce60145 [quick-fix]file-util: fmtlib errors on FILE* type parameter. Explicitly cast it to void* 2018-04-06 13:35:37 +03:00
Weiyi Wang
a9544ca015
Merge pull request #3580 from daniellimws/common-fmt
common: Migrate logging macros
2018-04-06 12:38:08 +03:00
James Rowe
501717e9db Update fmtlib to fix msvc warnings
Additionally, when updating fmtlib, there was a change in fmtlib broke
how the old logging macro was overloaded, so this works around that by
just naming the fmtlib macro impl something different
2018-04-05 22:33:12 -06:00
Weiyi Wang
acb02d300c
Merge pull request #3518 from wwylele/hashable-struct
Common/Hash: abstract HashableStruct from GLShader::PicaShaderConfig
2018-04-05 14:39:12 +03:00
Merry
fff7227f86
Merge pull request #3579 from ccawley2011/architecture-defines
common: Clean up architecture-specific defines
2018-03-31 10:41:15 +01:00
Daniel Lim Wee Soong
0f4c9c9f47 file_util: Remove long long casting on buf.st_size in NGLOG statement 2018-03-27 23:31:08 +08:00
Daniel Lim Wee Soong
968569aa61 Replace format specifiers for all usages of ASSERT_MSG 2018-03-27 23:28:42 +08:00
Daniel Lim Wee Soong
59b8a1dbc2 assert: Undo removal of newline for string with __VA_ARGS__ 2018-03-27 10:01:10 +08:00
Daniel Lim Wee Soong
111da6db06 common: Migrate logging macros
Follow-up of #3533

Replace logging to use NGLOG instead of LOG

This is significantly larger than the previous ones.
2018-03-25 18:42:50 +08:00
James
9283053701 Move WebServices to use LibreSSL + cpp-httplib (#3501)
Move WebServices to use LibreSSL + cpp-httplib

Remove curl + openssl build dependencies
2018-03-24 13:19:35 -06:00
Merry
174e7e268a
Merge pull request #3533 from daniellimws/fmtlib-macros
Logging: Add fmtlib-based macros
2018-03-24 08:04:20 +00:00
Daniel Lim Wee Soong
11ce0f91ab Remove dependency chrono
Was included last time due to adding Entry into log.h

Now it is no longer needed but I forgot to remove it last time
2018-03-22 21:42:02 +08:00
Cameron Cawley
2520ad57a5 common: Use ARCHITECTURE_x86_64 instead of ARCHITECTURE_X64 2018-03-21 22:19:59 +00:00
Cameron Cawley
1afcaed1ff common: Use ARCHITECTURE_ARM instead of _M_ARM 2018-03-21 22:17:42 +00:00
Daniel Lim Wee Soong
4adbf29b0c Fix clang-format
Oops forgot to check...
2018-03-22 00:45:01 +08:00
Daniel Lim Wee Soong
e6ee1020e1 Replace ##__VA_ARGS__ with __VA_ARGS__ 2018-03-22 00:40:01 +08:00
Daniel Lim Wee Soong
c892cea029 Place FmtLogMessage's definition in backend.cpp
I decided to overload LogMessage because I don't see a reason to come up with a new function name just for this, but if you guys want me to overload FmtLogMessage instead I'm fine with that.
2018-03-21 23:36:45 +08:00
Daniel Lim Wee Soong
ceeb2810fe Add nullptr check to LogEntry
Also remove explicit comparison with nullptr to make code shorter.
2018-03-20 14:15:48 +08:00
Daniel Lim Wee Soong
2b4998a122 Add check if filter is not a nullptr
Fix segfault and pass tests
2018-03-17 22:55:57 +08:00
Cameron Cawley
8d1cab4892 CMake: Set EMU_ARCH_BITS in CMakeLists.txt 2018-03-16 13:29:36 +00:00
Daniel Lim Wee Soong
c4f98c1a2e Logging: Fix clang-format 2018-03-16 21:18:45 +08:00
Daniel Lim Wee Soong
b5532babab Merge remote-tracking branch 'citra/master' into fmtlib-macros 2018-03-16 20:50:52 +08:00
Daniel Lim Wee Soong
98e669cf00 Remove all edits not in the scope of this PR 2018-03-16 12:17:14 +08:00
Daniel Lim Wee Soong
373efd3158 Logging: Remove customizable logging backends
Separate code for customizing logging backends from this branch
2018-03-16 11:56:40 +08:00
Daniel Lim Wee Soong
eee388588e Logging: Fix fmt errors after rebasing with master
fmt was updated during the clang-format update, which breaks the previous implementation of FmtLogMessage

Changes were:
* Move definition of FmtLogMessage into log.h to use variadic templates as FMT_VARIADIC was removed

To supplement the change above:
* Move Entry and CreateEntry into log.h
* Add LogEntry in backend.cpp
2018-03-16 11:48:33 +08:00