Commit graph

2610 commits

Author SHA1 Message Date
Leo Lam
b6c3479bb4 Merge pull request #5720 from JosJuice/file-metadata
FileUtil: Redesign Exists/IsDirectory/GetSize
2017-07-11 00:28:34 +02:00
Michael Maltese
c9e8289e82 LogManager: add SaveSettings 2017-07-07 16:44:38 -07:00
Michael Maltese
8ff8dfcdf2 LogManager: make LogContainer a POD and don't allocate 2017-07-07 16:44:38 -07:00
Michael Maltese
18da6dee8e LogManager: remove per-container listeners 2017-07-07 16:44:38 -07:00
Michael Maltese
546fa628fb LogManager: remove per-container verbosities 2017-07-07 16:44:38 -07:00
Michael Maltese
26aa9f88a4 LogManager: clean up header 2017-07-07 16:44:38 -07:00
Leo Lam
c941cd6aa9 Merge pull request #5753 from ZirconiumX/master
Explain what Yes/No means in an assert window
2017-07-07 16:56:21 +02:00
Jules Blok
f3508742ac OGL: Support Quad-Buffered stereoscopy. 2017-07-05 22:43:39 +02:00
Dan Ravensloft
982663c728 Explain what Yes/No means in an assert window
It's a bit confusing to get a yes/no dialogue box without any indication
of what yes or no will do in this situation, so add a short explanatory
sentence.
2017-07-05 20:00:52 +00:00
Léo Lam
90f8265497 Replace StringFromInt with std::to_string
Updated version of #47. Android should support to_string now that
we use a modern version of libc++ when building.
2017-07-05 13:49:33 +02:00
JosJuice
5ca3aee00a FileUtil: Add a class for Exists/IsDirectory/GetSize
Some code was calling more than one of these functions in a row
(in particular, FileUtil.cpp itself did it a lot...), which is
a waste since it's possible to call stat a single time and then
read all three values from the stat struct. This commit adds a
File::FileInfo class that calls stat once on construction and
then lets Exists/IsDirectory/GetSize be executed very quickly.

The performance improvement mostly matters for functions that
can be handling a lot of files, such as File::ScanDirectoryTree.

I've also done some cleanup in code that uses these functions.
For instance, some code had checks like !Exists() || !IsDirectory(),
which is functionally equivalent to !IsDirectory(), and some
code was using File::GetSize even though there was an IOFile
object that the code could call GetSize on.
2017-06-29 19:07:29 +02:00
JosJuice
98b0d8a119 Fix DoFileSearch for non-ASCII extensions on Windows
We don't use non-ASCII extensions for anything right now,
but we might as well fix this.
2017-06-28 09:50:02 +02:00
JosJuice
6f98915c32 Fix DoFileSearch for non-ASCII paths on Windows
It didn't work when there were non-ASCII characters
in the directories argument, but it worked fine with
non-ASCII characters in names of found files and folders.
2017-06-28 09:48:28 +02:00
shuffle2
951f6400fb Merge pull request #5706 from JosJuice/more-gamelist-speedup-followup
More follow-up for the gamelist speedup PR
2017-06-27 12:36:16 -07:00
JosJuice
a6471234a2 FileSearch: Use strcasecmp in non-std code
Because why should only Windows get in on the FileSearch speedup fun?
(Not that this fixes the slowness of File::ScanDirectoryTree...)
2017-06-27 21:32:07 +02:00
shuffle2
d19e1ed4bf Merge pull request #5705 from JosJuice/strerror-r-version
Try to make sure that we have the XSI version of strerror_r
2017-06-27 11:49:26 -07:00
shuffle2
2579a7c03d Merge pull request #5607 from leoetlino/logging-fix
Logging fixes
2017-06-27 11:40:26 -07:00
JosJuice
5b7f99e57a Try to make sure that we have the XSI version of strerror_r 2017-06-27 11:59:39 +02:00
Michael Maltese
033492717c BlockingLoop: fix unhandled enum value warning
Fixes compiler warning:

```
Source/Core/Common/BlockingLoop.h:212:13: warning: enumeration value 'kNonBlock' not handled in switch [-Wswitch]
    switch (mode)
            ^
```
2017-06-26 23:34:33 -07:00
Leo Lam
0ace7fd8f3 Merge pull request #5694 from leoetlino/dolphin-drm
Refuse to launch the shop with default credentials
2017-06-26 21:31:32 +02:00
shuffle2
02690d5d7c Merge pull request #5693 from JosJuice/filesearch-minor-changes
FileSearch: Minor changes
2017-06-26 11:44:44 -07:00
Léo Lam
60c6fbe9cc Add CommonTitles.h for common Wii title IDs 2017-06-26 15:17:55 +02:00
JosJuice
1fc5eae5bd FileSearch: Add a static_assert for the preferred separator 2017-06-26 11:50:10 +02:00
JosJuice
382356627a FileSearch: Check isDirectory in the non-Windows code
c5fa470 made the extension check discard directories, but
only in the new code that currently only is used on Windows.
Let's add an equivalent check in the old code so that the
behavior is consistent across platforms.
2017-06-26 11:44:23 +02:00
Markus Wick
99b1735424 Merge pull request #5660 from shuffle2/unblock-blockingloop
Change "blocking" BlockingLoop::Stop to give up and die after a timeout.
2017-06-26 10:23:21 +02:00
Shawn Hoffman
ed8f293b4f Change "blocking" BlockingLoop::Stop to give up and die after a timeout.
This fixes the global-static fifo object causing infinite hangs in some
cases. Notably, failure to initialize a graphics backend would result in
BlockingLoop::Prepare being called but never executing Run(), leaving the
object in a bad state.
2017-06-25 20:47:30 -07:00
Shawn Hoffman
1634f0cf5e Use CompareStringOrdinal in DoFileSearch instead of _wcsicmp 2017-06-25 16:47:46 -07:00
JosJuice
be162a3316 FileSearch: Remove unnecessary function 2017-06-25 13:21:25 +02:00
shuffle2
991062093b Merge pull request #5682 from MerryMage/SCMRevGen
SCMRevGen: Use DisableFastUpToDateCheck
2017-06-24 10:44:53 -07:00
MerryMage
11a03e7dd2 SCMRevGen: Use DisableFastUpToDateCheck 2017-06-24 17:34:21 +01:00
Tillmann Karras
c8255092d7 Fix warnings 2017-06-24 01:41:58 +01:00
Shawn Hoffman
c5fa470ad8 replace DoFileSearch with optimized version 2017-06-23 17:25:53 -07:00
Shawn Hoffman
f16599f4a8 DolphinWX: defer gamelist scanning and switch to single-file cache. 2017-06-23 17:25:53 -07:00
Niels Boehm
df82adca43 Add function testing whether a bitmask is valid.
This one verifies bitmasks where low bits are set to 1 (hence the name).
Any stray 0 among the lower ones or any stray 1 among the higher zeros
renders the mask invalid.

The edge cases of all zeros and all ones are considered valid masks.

It uses an efficient implementation. It's the counterpart of
https://graphics.stanford.edu/~seander/bithacks.html#DetermineIfPowerOf2
2017-06-22 20:22:53 +02:00
Léo Lam
29e8988c90 Analytics: Set the timeout to 5 seconds
3 seconds is sometimes not enough.
2017-06-18 23:16:03 +02:00
Leo Lam
9a1503a75c Merge pull request #5642 from lioncash/chrono
HttpRequest: Use std::chrono for indicating time periods
2017-06-18 23:13:52 +02:00
Léo Lam
7222ce78ff SysConf: Don't set "config done" flags by default
This allows the user to go through the Wii Menu first boot setup
screen when they launch the System Menu for the first time.

Most useful on a clean profile, after doing a full system update,
to configure settings like the console country.
2017-06-18 22:32:56 +02:00
Lioncash
251de89b5c HttpRequest: Use std::chrono for indicating time periods
Allows the use of chrono time points, on top of being more indicative of
time periods used at call sites, if custom timeouts are specified.
2017-06-18 15:48:37 -04:00
Léo Lam
d86f020e81 Rewrite SysConf handling
This rewrites the SysConf code for several reasons:

* Modernising the SysConf class. The naming was entirely cleaned up.
  constexpr for constants.

* Exposing less stuff in the header.

* Probably less efficient parsing and writing logic, but much simpler
  to understand and use in my opinion. No more hardcoded offsets.
  No more duplicated code for the initial SYSCONF generation.

* More flexibility. It is now possible to add and remove entries,
  since we rebuild the file. This allows us to stop spamming
  "section not found" panic alerts; we can now use and insert
  default entries.
2017-06-18 16:17:05 +02:00
Léo Lam
dd8dcdf880 LogManager: Check if listener is valid before using it 2017-06-17 10:39:06 +02:00
Léo Lam
a2ad3e14d0 Logging: Remove duplicated code 2017-06-17 10:20:30 +02:00
Léo Lam
100c433261 Logging: Move verbosity setting code to LogManager
No clue why it was in DolphinWX.
2017-06-17 10:20:30 +02:00
Sepalani
b359d82890 File/IOFile: Check _tfopen_s properly 2017-06-17 02:16:58 +01:00
Léo Lam
01faa5c852 FileUtil: Use errno for printing errors in IsDirectory
stat() returns an error code in errno on both POSIX compliant
platforms and Windows.

This means we should always use errno instead of GetLastErrorMsg
which uses GetLastError() (Win32) on Windows.
2017-06-16 12:43:41 +02:00
Léo Lam
aa63199977 FileUtil: Don't manually strip trailing slashes
POSIX allows one or more trailing slashes for directories.

From POSIX.1-2008, section 3.271 (Base Definitions / Pathname):

> A pathname can optionally contain one or more trailing <slash>
> characters. Multiple successive <slash> characters are considered to
> be the same as one <slash>, except for the case of exactly two
> leading <slash> characters.

On Windows, the extra trailing slashes are ignored for directories too.
2017-06-16 12:31:26 +02:00
Shawn Hoffman
f469d86467 cmake/win32: add CompatPatches 2017-06-15 21:26:40 -07:00
Shawn Hoffman
1210c74955 [windows]: Apply compatibility patches to problematic gamepad vibration drivers.
Move ucrtFreadWorkaround to use the new LdrWatcher.
2017-06-15 21:21:01 -07:00
Leo Lam
8f460a1cda Merge pull request #5611 from JosJuice/reorganize-file-namespace
Reorganize File namespace
2017-06-15 23:28:36 +02:00
JosJuice
cf94ce6305 Add a namespace to OpenFStream
For consistency with the other functions in FileUtil.h.
2017-06-15 21:34:04 +02:00
JosJuice
f09ceaa735 Move IOFile to a separate file
Reduces the number of files that need to be recompiled
when making changes to FileUtil.h.
2017-06-15 21:33:50 +02:00