refactor: clang-tidy --fix modernize-deprecated-headers (#1980)

This commit is contained in:
Charles Kerr 2021-10-17 15:17:18 -05:00 committed by GitHub
parent 2bd2f0738e
commit 16e9a99fe9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
30 changed files with 76 additions and 71 deletions

View File

@ -2,9 +2,14 @@
# Many of these checks are disabled only because the code hasn't been
# cleaned up yet. Pull requests welcomed.
Checks: >
misc-static-assert,
modernize-deprecated-headers,
modernize-loop-convert,
modernize-pass-by-value,
modernize-return-braced-init-list,
modernize-use-default-member-init,
modernize-use-emplace,
modernize-use-equals-default,
modernize-use-nullptr,
modernize-use-override,
modernize-use-using,

View File

@ -6,9 +6,9 @@
*
*/
#include <limits.h> /* USHRT_MAX */
#include <stdio.h> /* fprintf() */
#include <string.h> /* strchr(), memcmp(), memcpy() */
#include <climits> /* USHRT_MAX */
#include <cstdio> /* fprintf() */
#include <cstring> /* strchr(), memcmp(), memcpy() */
#include <event2/buffer.h>
#include <event2/http.h> /* for HTTP_OK */

View File

@ -6,8 +6,8 @@
*
*/
#include <errno.h> /* errno, EAFNOSUPPORT */
#include <string.h> /* memcpy(), memset() */
#include <cerrno> /* errno, EAFNOSUPPORT */
#include <cstring> /* memcpy(), memset() */
#include <vector>
#include <event2/buffer.h>

View File

@ -6,10 +6,10 @@
*
*/
#include <errno.h>
#include <stdio.h>
#include <stdlib.h> /* bsearch(), qsort() */
#include <string.h>
#include <cerrno>
#include <cstdio>
#include <cstdlib> /* bsearch(), qsort() */
#include <cstring>
#include "transmission.h"
#include "blocklist.h"

View File

@ -6,7 +6,7 @@
*
*/
#include <stdlib.h> /* qsort() */
#include <cstdlib> /* qsort() */
#include <event2/buffer.h>

View File

@ -13,9 +13,9 @@
#include <iterator>
#include <optional>
#include <string_view>
#include <ctype.h> /* isprint() */
#include <stdlib.h> /* strtol() */
#include <string.h>
#include <cctype> /* isprint() */
#include <cstdlib> /* strtol() */
#include <cstring>
#include <tuple>
#include "transmission.h"

View File

@ -6,9 +6,9 @@
*
*/
#include <stdarg.h>
#include <stdlib.h> /* abs(), srand(), rand() */
#include <string.h> /* memcpy(), memmove(), memset(), strcmp(), strlen() */
#include <cstdarg>
#include <cstdlib> /* abs(), srand(), rand() */
#include <cstring> /* memcpy(), memmove(), memset(), strcmp(), strlen() */
#include <arc4.h>

View File

@ -6,7 +6,7 @@
*
*/
#include <string.h> /* memcpy(), memmove(), memset() */
#include <cstring> /* memcpy(), memmove(), memset() */
#include <arc4.h>

View File

@ -6,8 +6,8 @@
*
*/
#include <errno.h>
#include <string.h> /* strcmp(), strlen(), strncmp() */
#include <cerrno>
#include <cstring> /* strcmp(), strlen(), strncmp() */
#include <event2/buffer.h>
#include <event2/event.h>

View File

@ -6,8 +6,8 @@
*
*/
#include <errno.h>
#include <stdio.h>
#include <cerrno>
#include <cstdio>
#include <event2/buffer.h>

View File

@ -6,8 +6,8 @@
*
*/
#include <string.h> /* strchr() */
#include <stdio.h> /* sscanf() */
#include <cstring> /* strchr() */
#include <cstdio> /* sscanf() */
#include "transmission.h"
#include "crypto-utils.h" /* tr_hex_to_sha1() */

View File

@ -8,7 +8,7 @@
#include <algorithm>
#include <array>
#include <string.h> /* strlen() */
#include <cstring> /* strlen() */
#include <string_view>
#include <typeinfo>

View File

@ -6,9 +6,9 @@
*
*/
#include <errno.h>
#include <time.h>
#include <inttypes.h>
#include <cerrno>
#include <ctime>
#include <cinttypes>
#include <event2/util.h> /* evutil_inet_ntop() */

View File

@ -20,9 +20,9 @@
* DEALINGS IN THE SOFTWARE.
*****************************************************************************/
#include <errno.h>
#include <limits.h>
#include <string.h>
#include <cerrno>
#include <climits>
#include <cstring>
#include <sys/types.h>
@ -34,7 +34,7 @@
#include <event2/util.h>
#include <stdint.h>
#include <cstdint>
#include <libutp/utp.h>
#include "transmission.h"

View File

@ -6,9 +6,9 @@
*
*/
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <cerrno>
#include <cstdlib>
#include <cstring>
#include <event2/util.h> /* evutil_ascii_strcasecmp() */

View File

@ -6,8 +6,8 @@
*
*/
#include <string.h>
#include <time.h>
#include <cstring>
#include <ctime>
#ifndef _WIN32
#include <sys/stat.h>

View File

@ -6,9 +6,9 @@
*
*/
#include <errno.h>
#include <signal.h>
#include <stdlib.h>
#include <cerrno>
#include <csignal>
#include <cstdlib>
#include <fcntl.h>
#include <sys/types.h>

View File

@ -6,7 +6,7 @@
*
*/
#include <errno.h> /* EINVAL */
#include <cerrno> /* EINVAL */
#include "transmission.h"
#include "file.h"

View File

@ -6,8 +6,8 @@
*
*/
#include <limits.h> /* INT_MAX */
#include <string.h> /* memcpy(), memset(), memcmp() */
#include <climits> /* INT_MAX */
#include <cstring> /* memcpy(), memset(), memcmp() */
#include <event2/buffer.h>

View File

@ -6,9 +6,9 @@
*
*/
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <cstdarg>
#include <cstdio>
#include <cstdlib>
#include "tr-assert.h"

View File

@ -21,8 +21,8 @@ THE SOFTWARE.
*/
#include <string.h> /* memcmp(), memcpy(), memset() */
#include <stdlib.h> /* malloc(), free() */
#include <cstring> /* memcmp(), memcpy(), memset() */
#include <cstdlib> /* malloc(), free() */
#ifdef _WIN32
#include <io.h> /* dup2() */
@ -32,7 +32,7 @@ THE SOFTWARE.
#include <event2/event.h>
#include <stdint.h>
#include <cstdint>
#include <libutp/utp.h>
#include "transmission.h"

View File

@ -23,7 +23,7 @@ THE SOFTWARE.
#include <event2/event.h>
#include <stdint.h>
#include <cstdint>
#include <libutp/utp.h>
#include "transmission.h"

View File

@ -6,10 +6,10 @@
*
*/
#include <errno.h>
#include <string.h>
#include <cerrno>
#include <cstring>
#include <signal.h>
#include <csignal>
#ifdef _WIN32
#include <winsock2.h>

View File

@ -6,7 +6,7 @@
*
*/
#include <errno.h>
#include <cerrno>
#ifdef SYSTEM_MINIUPNP
#include <miniupnpc/miniupnpc.h>

View File

@ -6,11 +6,11 @@
*
*/
#include <ctype.h> /* isdigit() */
#include <cctype> /* isdigit() */
#include <deque>
#include <errno.h>
#include <stdlib.h> /* strtoul() */
#include <string.h> /* strlen(), memchr() */
#include <cerrno>
#include <cstdlib> /* strtoul() */
#include <cstring> /* strlen(), memchr() */
#include <string_view>
#include <optional>

View File

@ -7,12 +7,12 @@
*/
#include <array>
#include <ctype.h>
#include <cctype>
#include <deque>
#include <errno.h> /* EILSEQ, EINVAL */
#include <math.h> /* fabs() */
#include <stdio.h>
#include <string.h>
#include <cerrno> /* EILSEQ, EINVAL */
#include <cmath> /* fabs() */
#include <cstdio>
#include <cstring>
#include <event2/buffer.h> /* evbuffer_add() */
#include <event2/util.h> /* evutil_strtoll() */

View File

@ -16,17 +16,17 @@
#endif
#include <algorithm> // std::sort
#include <errno.h>
#include <cerrno>
#include <stack>
#include <stdlib.h> /* strtod() */
#include <string.h>
#include <cstdlib> /* strtod() */
#include <cstring>
#include <vector>
#ifdef _WIN32
#include <share.h>
#endif
#include <locale.h> /* setlocale() */
#include <clocale> /* setlocale() */
#if defined(HAVE_USELOCALE) && defined(HAVE_XLOCALE_H)
#include <xlocale.h>

View File

@ -6,7 +6,7 @@
*
*/
#include <errno.h>
#include <cerrno>
#include <string>
#include <unordered_set>

View File

@ -6,9 +6,9 @@
*
*/
#include <errno.h>
#include <limits.h> /* NAME_MAX */
#include <stdlib.h> /* realloc() */
#include <cerrno>
#include <climits> /* NAME_MAX */
#include <cstdlib> /* realloc() */
#include <unistd.h> /* close() */

View File

@ -6,7 +6,7 @@
*
*/
#include <string.h> /* strcmp() */
#include <cstring> /* strcmp() */
#include <event2/event.h>
#include <event2/util.h>