Commit Graph

514 Commits

Author SHA1 Message Date
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 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 2d3b51665e util/BitReverse: generate table with constexpr function
Get rid of the macro hell.
2020-02-05 19:51:46 +01:00
Max Kellermann 7b03f55cb4 util/bit_reverse: convert to C++ 2020-02-05 19:49:18 +01:00
Rosen Penev a3963de668 [clang-tidy] change integer prefixes to uppercase
Found with readability-uppercase-literal-suffix

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-02-04 15:20:50 -08:00
Max Kellermann 4f22f4d357 *: use nullptr instead of NULL 2020-02-01 14:02:43 +01:00
Max Kellermann 0896f44455 util/Domain: add noexcept 2020-02-01 13:25:57 +01:00
Max Kellermann 620872390b util/Exception: move the forwarded std::exception_ptr 2020-02-01 13:13:08 +01:00
Max Kellermann 36cad54ccd util/TemplateString: remove stray semicolon 2020-02-01 11:46:06 +01:00
Max Kellermann 2817bf9e95 copyright year 2020 2020-01-18 19:23:49 +01:00
Max Kellermann 7e80c62c7c util/GenerateArray: use double curly braces for compatibility 2020-01-14 23:16:46 +01:00
Max Kellermann 8aaf39efd6 util/GenerateArray: new utility library 2020-01-14 22:11:12 +01:00
Max Kellermann b11c5f8d30 util/{Const,Writable}Buffer: drop more "_type" suffixes from type names 2020-01-12 14:39:54 +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 53f8053188 util/StringView: use using instead of typedef 2020-01-03 15:55:05 +01:00
Max Kellermann e654c6e005 util/{Const,Writable}Buffer: use std::size_t 2020-01-03 15:55:05 +01:00
Max Kellermann 4b0e288f00 util/{Const,Writable}Buffer: add noexcept 2020-01-03 15:55:05 +01:00
Max Kellermann 71ace2fbac util/AllocatedString: use std::exchange() 2020-01-03 15:54:51 +01:00
Max Kellermann 84784badce Merge branch 'v0.21.x' 2020-01-03 15:31:18 +01:00
Jacob Vosmaer dca0519336 Clang: only use [[fallthrough]] in C++ files
It appears that [[fallthrough]] is valid in C++ but not in C. And
in some Clang versions (e.g. Clang 11 on macOS), Clang is pedantic
about this and considers it an error to use [[fallthrough]] in a
.c file such as src/util/format.c.

This changes makes gcc_fallthrough a no-op under Clang in C files.
2019-12-31 13:54:09 +01:00
Max Kellermann 803a48e96d Merge tag 'v0.21.18'
release v0.21.18
2019-12-24 16:31:06 +01:00
Max Kellermann 7770298a65 util/Compiler.h: use [[fallthrough]] on clang
Older clang versions don't support the GCC __attribute__ syntax.  For
those, don't use anything at all, and new clang versions shall use the
standard syntax.
2019-12-24 08:04:48 +01:00
Max Kellermann a1afe9afc6 util/Compiler.h: add gcc_fallthrough
Works around build failures with ccache which may feed processed code
to GCC, which doesn't have the "fall through" code comments.
2019-12-23 17:53:57 +01:00
Max Kellermann bd4df1ae5d util/AllocatedArray: add WritableBuffer/ConstBuffer cast operators 2019-12-17 20:18:54 +01:00
Max Kellermann a93b7172aa util/AllocatedArray: add ConstBuffer copy constructor 2019-12-17 20:18:49 +01:00
Max Kellermann 908b6a1939 util/AllocatedArray: use WritableBuffer::operator[] 2019-12-17 20:18:45 +01:00
Max Kellermann 561ccf600f util/AllocatedArray: remove bogus assertions
`new T[0]` must not be nullptr.
2019-12-17 20:18:39 +01:00
Max Kellermann aee861c009 util/AllocatedArray: copy constructor copies "nulled" state 2019-12-17 20:18:34 +01:00
Max Kellermann 2cc1dd28cd util/AllocatedArray: add capacity()
For STL completeness.
2019-12-17 20:18:24 +01:00
Max Kellermann f8d7bc1c34 util/AllocatedArray: use std::exchange() 2019-12-17 20:18:14 +01:00
Max Kellermann 683d5848f4 Merge tag 'v0.21.17'
release v0.21.17
2019-12-16 23:44:20 +01:00
Max Kellermann e9af692973 util/Time*: move to time/ 2019-12-16 23:02:14 +01:00
Max Kellermann 2e8f42c6ad util/StringBuffer: use std::size_t instead of size_t 2019-12-16 22:51:23 +01:00
Max Kellermann 2c276770f0 util/PrintException, ...: update copyright 2019-12-04 12:33:36 +01:00
Max Kellermann b2c4a5db14 util/UTF8: use uint8_t instead of unsigned char 2019-10-14 13:44:11 +02:00
Max Kellermann cadfccfd0c util/UTF8: add noexcept 2019-10-14 13:41:06 +02:00
Max Kellermann c9590db188 util/StringView: enable string_view support only on C++17 2019-09-25 21:34:48 +02:00
Max Kellermann 9caf90f74f util/UriRelative: add uri_apply_relative() 2019-09-08 00:07:37 +02:00
Max Kellermann 71448e645c util/UriExtract: use uri_get_scheme() in uri_has_scheme() 2019-09-08 00:06:52 +02:00
Max Kellermann 0509472636 util/UriExtract: add uri_is_relative_path() 2019-09-08 00:04:49 +02:00
Max Kellermann 0b956cf968 util/StringAPI: add memrchr() wrapper 2019-09-07 23:59:59 +02:00
Max Kellermann 58363cf4dd util/UriRelative: allow "parent" to end with slash 2019-09-07 23:27:24 +02:00
Max Kellermann 2574615fa3 util/UriRelative: use StringAfterPrefix() instead of memcmp()
memcmp() can overrun the buffer.
2019-09-07 23:24:41 +02:00
Max Kellermann 15fbd2b4ab util/UriRelative: use StringIsEqual() 2019-09-07 23:22:16 +02:00
Max Kellermann e7c5a59e39 util/Exception: support "const char *" 2019-08-26 20:24:22 +02:00
Max Kellermann a478af6759 util/PrintException, ...: update copyright 2019-08-19 19:11:59 +02:00
Max Kellermann e98ce710b8 util/WStringAPI: add wcsncmp() wrapper 2019-08-16 14:48:54 +02:00
Max Kellermann 79d1004544 util/StringView: add method Compare() 2019-08-16 13:32:00 +02:00