Commit Graph

399 Commits

Author SHA1 Message Date
Max Kellermann afe2aaa5f6 fs/io/GzipOutputStream: increase buffer size to 16 kB
Reduce I/O overhead.
2020-04-02 17:17:58 +02:00
Max Kellermann 9b11caa0e6 fs/io/BufferedReader: larger default buffer (4 kB -> 16 kB)
Reduce I/O overhead.
2020-04-02 17:17:27 +02:00
Max Kellermann 4d453a8313 fs/NarrowPath: add class FromNarrowPath
Move code from ParseCommandLine().
2020-04-02 17:15:34 +02:00
Max Kellermann 61d7b436a2 fs/NarrowPath: un-inline Windows constructor 2020-04-02 16:27:44 +02:00
Max Kellermann 9c3e1d450a fs/io/GunzipReader: increase buffer size to 64 kB
Reduces I/O overhead while reading a compressed database file.
2020-03-31 15:07:39 +02:00
Rosen Penev ba3ff10ccd remove false ifdef
The entire section falls under the else path of #ifdef _WIN32. Checking
for it makes no sense. Probably some refactoring mistake.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-20 17:56:33 -07:00
Rosen Penev 7fe49cf24d [clang-tidy] use default member init
Found with modernize-use-default-member-init

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-19 13:38:40 +01:00
Rosen Penev 97425d56e7 remove gcc_unused
[[maybe_unused]] (introduced in C++17) is standard C++.

https://clang.llvm.org/docs/AttributeReference.html#maybe-unused-unused
says that this is equivalent to the GNU unused attribute.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-16 00:08:21 -07:00
Max Kellermann 45b60b3d38 fs/Traits: GetParent() returns std::string_view 2020-03-13 20:01:10 +01:00
Max Kellermann a885bdba4c fs/Traits: pass string_view to Build() 2020-03-13 19:55:28 +01:00
Max Kellermann b6b15afb5a fs/Path: make constructor explicit 2020-03-13 19:55:25 +01:00
Max Kellermann 1d560c8f0f fs/AllocatedPath: add string_view constructor 2020-03-13 19:46:29 +01:00
Max Kellermann 189f6eaa6f fs/Traits: add string_view 2020-03-13 19:43:39 +01:00
Max Kellermann 87f78b9c39 fs/Traits: use {} notation for return values 2020-03-13 19:43:23 +01:00
Max Kellermann aa722bd8ac fs/Traits: use auto 2020-03-13 19:43:23 +01:00
Max Kellermann 58c7ec07a4 fs: use using instead of typedef 2020-03-13 19:43:23 +01:00
Rosen Penev a2f5a63bbc replace stdint.h with cstdint
The former is deprecated by C++14. The standard says they are the same:

The header defines all types and macros the same as the C standard library
header<stdint.h>.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-12 19:04:39 -07:00
Rosen Penev 2db8bcc353 replace stddef.h with cstddef
The former is deprecated with C++14. The standard says both are the same:

The contents and meaning of the header<cstddef>are the same as the C
standard library header<stddef.h>,except that it does not declare the type
wchar_t, that it also declares the type byte and its associated
operations (21.2.5), and as noted in 21.2.3 and 21.2.4.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-12 19:04:38 -07:00
Rosen Penev c846ee0d1b replace stdarg.h with cstdarg
The former was deprecated in C++14. The Standard says they are the same:

The contents of the header<cstdarg>are the same as the C standard library
header<stdarg.h>, with the following changes: The restrictions that ISO C
places on the second parameter to the va_start macro in header<stdarg.h>
are different in this International Standard. The parameter parmN is the
rightmost parameter in the variable parameter list of the function
definition (the one just before the...).219If the parameter parmN is a
pack expansion (17.5.3) or an entity resulting from a lambda capture
(8.1.5), the program is ill-formed, no diagnostic required. If the
parameter parmN is of a reference type, or of a type that is not
compatible with the type that results when passing an argument for which
there is no parameter, the behavior is undefined.

Also changed va_list to the std:: namespace version, which is the same.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-12 19:03:12 -07:00
Rosen Penev 4b57b7f5a5 replace limits.h with climits
The former was deprecated with C++14. The standard says they are the same
with one exception:

The header<climits>defines all macros the same as the C standard library
header<limits.h>.

[Note:The types of the constants defined by macros in<climits>are not
required to match the types to which themacros refer.— end note]

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-12 16:14:04 -07:00
Rosen Penev edc4989d9c change errno.h to cerrno
The former is deprecated by C++14. It's also functionally the same.

From the standard:

19.4
The header<cerrno>is described in Table 43. Its contents are the same as
the POSIX header<errno.h>,except that errno shall be defined as a macro.
[Note: The intent is to remain in close alignment with the POSIX
standard.] A separate errno value shall be provided for each thread.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-12 15:51:16 -07:00
Rosen Penev ab9f5d2067 replace assert.h with cassert
The former was deprecated with C++14.

According to the C++11 and C++17 standards, both files are identical.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-12 15:25:38 -07:00
Max Kellermann 01632d37ef Merge branch 'v0.21.x' 2020-03-12 08:11:08 +01:00
Max Kellermann b7ce452308 fs/Traits: add IsSpecialFilename()
Merge some duplicate code in a central library.
2020-03-07 09:30:56 +01:00
Max Kellermann 72ec641f0d *: use auto 2020-02-01 14:02:43 +01:00
Rosen Penev b64fdae938 [clang-tidy] use override instead of virtual
Found with modernize-use-override

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-01-31 21:27:26 -08:00
Max Kellermann 7551867249 meson.build: move Log.cxx and LogBackend.cxx into a static library
Prevents compiling those sources many times, once for each debug
program using it.
2020-01-18 19:56:16 +01:00
Max Kellermann 2817bf9e95 copyright year 2020 2020-01-18 19:23:49 +01:00
Max Kellermann 4937d77cb6 util/{Const,Writable}Buffer: drop "_type" from type names
Behave like STL.
2020-01-03 15:55:06 +01:00
Max Kellermann b449627265 fs/io/Reader: relicense to BSD-2 2019-12-16 17:13:55 +01:00
Max Kellermann ed327c597a lib/icu/Converter: Create() returns std::unique_ptr 2019-11-04 15:44:06 +01:00
Max Kellermann 1bfede120a fs/Traits: call std::string::reserve() in BuildPathImpl() 2019-09-04 12:01:25 +02:00
Max Kellermann f909615b14 include cleanups (powered by iwyu) 2019-08-15 17:57:20 +02:00
Max Kellermann cde6c46d2f util/Macros: replace with std::size() (C++17) 2019-08-03 13:10:49 +02:00
Max Kellermann d663f81420 include cleanups (powered by iwyu) 2019-07-05 09:59:58 +02:00
Max Kellermann a139279575 Copyright year 2019 2019-06-17 11:17:30 +02:00
Max Kellermann bd6b7aa88e archive/Lookup: move to fs/LookupFile.cxx
This can be used for other purposes as well.
2019-06-15 14:26:26 +02:00
Max Kellermann 476647bfa0 fs/AllocatedPath: add GetSuffix() 2019-06-15 13:57:16 +02:00
Max Kellermann 3e3ee581a8 fs/Path: add constexpr 2019-05-31 19:47:50 +02:00
Max Kellermann 5641c4baa6 system/Clock, fs/FileInfo: move FILETIME specific code to time/FileTime.hxx 2019-05-08 16:02:13 +02:00
Max Kellermann afdaaba045 fs/io/BufferedOutputStream: add noexcept 2019-04-26 14:55:00 +02:00
Max Kellermann 1cfc0cb874 fs/io/AutoGunzipReader: use std::unique_ptr<> 2019-04-26 14:55:00 +02:00
Max Kellermann 3882c97545 fs/io/AutoGunzipReader: add noexcept 2019-04-26 14:55:00 +02:00
Max Kellermann bf9f690c70 fs/io/GunzipReader: add noexcept 2019-04-26 14:55:00 +02:00
Max Kellermann 392b783c9e fs/io/TextFile: add noexcept 2019-04-26 14:44:27 +02:00
Max Kellermann 6d86902a02 fs/io/TextFile: use std::unique_ptr<> 2019-04-26 14:42:54 +02:00
Max Kellermann 1415bac1d6 fs/AllocatedPath: add Android-only FromUTF8(std::string&&) overload 2019-04-24 14:39:47 +02:00
Max Kellermann 7a98a784b2 fs/Features: add macro FS_CHARSET_ALWAYS_UTF8 2019-04-24 14:28:55 +02:00
Max Kellermann 162845cc6d fs/Charset: move HAVE_FS_CHARSET to Features.hxx 2019-04-24 14:24:54 +02:00
Max Kellermann a8ee7269bc fs/Config: add noexcept 2019-04-24 14:24:21 +02:00