Commit Graph

102 Commits

Author SHA1 Message Date
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
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
da4bb4c298 fs/io/OutputStream: update include guard 2019-02-19 12:39:29 +01:00
Max Kellermann
5b8ff61799 fs/io/BufferedOutputStream: add WithBufferedOutputStream() 2019-02-19 12:37:53 +01:00
Max Kellermann
cfe22502ab fs/io/StdioOutputStream: add noexcept 2019-01-22 09:03:49 +01:00
Max Kellermann
cf23fd8774 fs/io/FileOutputStream: add constructor with directory fd 2019-01-21 21:10:02 +01:00
Max Kellermann
dee8872395 fs/io/FileOutputStream: move code to Open() 2019-01-21 21:09:34 +01:00
Max Kellermann
ce49d99c2f check.h: remove obsolete header
Since we switched from autotools to Meson in commit
94592c1406, we don't need to include
`config.h` early to properly enable large file support.  Meson passes
the required macros on the compiler command line instead of defining
them in `config.h`.

This means we can include `config.h` at any time, whenever we want to
check its macros, and there are no ordering constraints.
2018-11-19 16:33:49 +01:00
Max Kellermann
f5c9071494 *: copyright year 2018 2018-10-31 17:54:59 +01:00
Max Kellermann
2148d4bb31 fs/io/FileOutputStream: fix -Wcomment 2018-10-31 17:18:44 +01:00
Max Kellermann
e79d06d595 fs/io/FileOutputStream: don't use O_TMPFILE on Android
Fixes writing to Context.getCacheDir().
2018-10-31 17:12:21 +01:00
Max Kellermann
c60cf944f5 fs/io/FileOutputStream: add macro HAVE_O_TMPFILE 2018-10-31 17:10:52 +01:00
Max Kellermann
19d9ce260a fs/io/FileOutputStream: disallow copying 2018-09-03 14:36:01 +02:00
Max Kellermann
0642ce4795 fs/io/FileOutputStream: make linkat() mandatory on Linux 2018-08-21 19:02:03 +02:00
Max Kellermann
d11e1d5880 fs/io/FileOutputStream: add "noexcept" 2018-08-21 18:56:14 +02:00
Max Kellermann
b143477774 fs/io/BufferedReader: add "noexcept" to constructor 2018-08-21 18:52:57 +02:00
Max Kellermann
d092a88a93 system/Open: new UniqueFileDescriptor constructing library 2018-08-21 18:27:39 +02:00
Max Kellermann
ab7597b089 fs/io/FileReader: use class UniqueFileDescriptor 2018-08-21 18:26:36 +02:00
Max Kellermann
84df470008 fs/io/FileReader: use std::exchange() 2018-08-21 18:26:34 +02:00
Max Kellermann
5ca0b7a28f fs/io/FileReader: add "noexcept" 2018-08-21 18:26:09 +02:00
Max Kellermann
21d621e7ad fs/io/FileReader: simplify includes 2018-08-21 18:26:09 +02:00
Max Kellermann
ec54754e22 Compiler.h: move to util/ 2018-08-20 16:19:17 +02:00
Max Kellermann
b98263e86f fs/io/OutputStream: relicense under BSD-2 2018-07-19 14:02:37 +02:00
Max Kellermann
97f670658f util/StringFormat: new utility library 2018-01-24 13:28:28 +01:00
Max Kellermann
6246d36fe6 Merge branch 'v0.20.x' 2017-12-16 20:56:06 +01:00
Max Kellermann
dfaf08743c *: check defined(_WIN32) instead of defined(WIN32)
Only _WIN32 is defined by the compiler, and WIN32 is not standardized
and may be missing.

Closes #169
2017-12-12 10:22:20 +01:00
Max Kellermann
49784513b1 util/{Const,Writable}Buffer, ...: rename IsEmpty() to empty(), imitating STL 2017-11-10 19:24:33 +01:00
Max Kellermann
a057b4f6d8 *: add lost of "noexcept" specifications 2017-06-04 12:46:48 +02:00
Max Kellermann
788e3b31e1 *: remove "pure" and "const" attributes from throwing functions
The "pure" and "const" attributes are not so well-defined, and a
recent clang version implements an optimization which pushes the
definition's boundary beyond what I believed it was.  clang now
assumes that functions declared "pure" cannot throw exceptions, even
if they lack the "noexcept" specification.

When compiled with this new clang version, MPD will crash randomly if
an exception happens to get thrown by such as "pure" function
(https://github.com/MusicPlayerDaemon/MPD/issues/41).

This commit removes all such misplaced "pure" and "const" attributes,
closing #41.
2017-05-08 17:25:06 +02:00
Max Kellermann
71f0ed8b74 *: add "noexcept" to many, many function prototypes
This eliminates some overhead, because the compiler doesn't need to
consider these functions throwing.
2017-05-08 14:44:49 +02:00
Max Kellermann
8aae9766e5 fs/io/*: make constructors "explicit" 2017-01-04 10:41:04 +01:00
Max Kellermann
288b98ccbf fs/io/GunzipReader: use C++11 initializer 2017-01-04 10:37:34 +01:00
Max Kellermann
bde50b1be8 fs/io/{GunzipReader,GzipOutputStream: remove deprepcated dynamic exception specifications 2017-01-04 10:33:24 +01:00
Max Kellermann
5900253b85 update copyright year 2017-01-03 20:48:59 +01:00
Max Kellermann
ba181ae9df fs/io/FileOutputStream: work around -Wunused 2016-10-26 17:00:17 +02:00
Max Kellermann
d84f96a571 fs/io/FileOutputStream: add mode CREATE_VISIBLE 2016-09-04 13:16:37 +02:00
Max Kellermann
f600e226da fs/io/FileOutputStream: add mode APPEND_OR_CREATE 2016-09-04 13:16:33 +02:00
Max Kellermann
d775f13a03 fs/io/FileOutputStream: merge all classes into one, add enum Mode
Prepare to add more modes.
2016-09-04 12:57:41 +02:00
Max Kellermann
b630afdeda fs/io/BufferedOutputStream: add wchar_t overloads 2016-09-04 12:57:41 +02:00
Max Kellermann
c39c259078 fs/io/BufferedOutputStream: add Write(char) 2016-09-04 12:57:41 +02:00
Max Kellermann
889be6e29d fs/io/FileReader: add methods GetSize(), GetPosition() 2016-08-27 12:20:59 +02:00
Max Kellermann
d15f64ae5d fs/io/BufferedReader: add method Reset() 2016-08-27 12:09:57 +02:00
Max Kellermann
a07117ea55 fs/io/FileReader: add method Rewind() 2016-08-27 12:09:17 +02:00
Max Kellermann
8748b2dc3f fs/io/BufferedReader: add ReadFull(size_t) 2016-08-16 12:09:04 +02:00