Commit Graph

132 Commits

Author SHA1 Message Date
Mike Gelfand 128cf34123
Move jsonsl and wildmat to third-party (#4402)
* Move jsonsl to third-party

This treats it as proper 3rd-party code to which our warning and style
settings don't extend.

* Move wildmat to third-party

This treats it as proper 3rd-party code to which our warning and style
settings don't extend.

* Fixup Xcode project to match new project structure
2022-12-18 19:19:07 +00:00
Cœur 9e0b42a61d
Fixed logic in tr_wildmat (#4353) 2022-12-12 16:35:40 -06:00
Charles Kerr 59335eac03
fix: sonarcloud cpp:S6004 (#4270)
reduce scope of variables by using if-based initializer
2022-11-28 21:03:28 -06:00
Charles Kerr 49393daf01
refactor: use std::optional.value_or() (#4255) 2022-11-27 14:56:34 -06:00
Charles Kerr 250e055c1d
fix: warnings from clang tidy sonarcloud coverity (#4143) 2022-11-12 09:53:09 -06:00
Charles Kerr 162035a653
fix: minor recent clang warnings (#4111)
* refactor: fix modernize-use-default-member-init warning in session-thread.cc

* refactor: fix readability-named-parameter warning in session-thread.cc

* refactor: fix clang-diagnostic-unused-function warning for isSupportedSocket()

* refactor: fix clang-analyzer-deadcode.DeadStores warning in buildHandshakeMessage()

* chore: fix readability-identifier-naming warning for tr_session::session_mutex_

* chore: fix readability-identifier-naming warning for Watchdir::generic_rescan_interval_

* chore: fix readability-identifier-naming warning for __tr_current_time
2022-11-07 11:48:26 -06:00
Charles Kerr 09bb1a60f0
refactor: add more nodiscard, constexpr, and noexcept (#4089) 2022-11-03 18:08:02 -05:00
A Cœur 12e564096b
fix: "Implicit conversion loses integer precision" warnings (#3960) 2022-10-25 11:14:42 -05:00
Charles Kerr 56e0a1bda8
chore: add cppcoreguidelines-pro-type-member-init to libtransmission/.clang-tidy (#3840) 2022-09-23 00:51:15 -05:00
Charles Kerr dd12fd010a
chore: iwyu headers (#3833) 2022-09-21 18:34:18 -05:00
Charles Kerr 1782dc6d7a
refactor: use readability-identifier-naming in clang-tidy (#3784) 2022-09-07 11:04:28 -05:00
Charles Kerr 1062ae8f1f
refactor: split tr_parseNum inout var into two vars (#3748)
build: re-enable cert-err34-c warning
2022-09-02 01:04:09 -05:00
Charles Kerr cee339e10d
refactor: remove tr_removeElementFromArray() (#3731) 2022-08-28 21:51:26 -05:00
Charles Kerr a24679d89f
refactor: modernize-avoid-c-arrays pt. 2 (#3713) 2022-08-26 13:35:28 -05:00
Charles Kerr e8686095ed
refactor: local peer discovery (#3696) 2022-08-24 16:03:30 -05:00
Charles Kerr c532728c42
refactor: remove TR_N_ELEMENTS macro (#3674)
* refactor: use std::array for keys in transmission-remote

* refactor: use std::array for wide_module_path in platform.cc

* refactor: use std::array for value in tr_env_get_int()

* refactor: use std::array for SysStoreNames in web.cc

* chore: remove unused macro TR_N_ELEMENTS
2022-08-18 21:31:53 -05:00
Charles Kerr c171d6df7c
refactor: remove tr_utf8_validate from public API (#3671)
it was only used as an impl helper, so make it private
2022-08-18 13:23:59 -05:00
Charles Kerr 76a7994eef
refactor: remove tr_free() (#3668) 2022-08-18 09:14:12 -05:00
Charles Kerr 963a8112a1
refactor: remove tr_strvDup() (#3666) 2022-08-17 21:18:44 -05:00
Charles Kerr 36675d183a
refactor: avoid tr_new() in tr_main_win32() (#3664) 2022-08-17 18:26:52 -05:00
Charles Kerr 7fe2cf68b9
refactor: avoid tr_new(), tr_free() in tr_variant (#3663)
* refactor: remove unused tr_renew()

* refactor: remove unused tr_realloc()

* refactor: avoid tr_strvDup() in tr-quark
2022-08-17 14:44:18 -05:00
Charles Kerr 29f57bc296
chore: iwyu headers (#3661) 2022-08-17 11:08:36 -05:00
Charles Kerr 6b25a57899
refactor: don't use tr_free in tr_strvUtf8Clean() (#3658) 2022-08-16 21:47:07 -05:00
Charles Kerr e49747ab51
feat: add tr_strvToBuf() (#3657)
* feat: add tr_getDefaultConfigDirToBuf()

* feat: add tr_getDefaultDownloadDirToBuf()

* feat: add tr_strvToBuf()

* feat: add tr_torrentFindFileToBuf()

* feat: add tr_torrentGetMagnetLinkToBuf()

* refactor: remove unused makeString() from tests

* feat: add tr_torrentFilenameToBuf()

* feat: add tr_torrentGetTrackerListToBuf()

* chore: remove obsolete comment references to tr_free

* chore: remove unused tr_strdup()

* chore: remove unused forward declarations
2022-08-16 19:28:57 -05:00
Charles Kerr c7466b3ff4
fix: coverity warnings (#3632)
* fix: uninitialized field natpmp

* fix: unchecked downcast result

* fix: potential tr_error leak

* fix: potential tr_error leak

* fix: potential tr_error leak

* fix: potential nullptr dereference in test fixtures

* fix: handshake fields not initialized in constructor

* chore: cast unchecked return value to void

* chore: cast unchecked return value to void

* chore: cast unchecked return value to void

* chore: make single-arg constructors explicit

* fix: code smell make variable a pointer-to-const

* fix: code smell make variable a pointer-to-const

* chore: make single-arg constructors explicit

* chore: silence sonarcloud false warning on commented-out-code

* chore: fix code smell use std::array

* chore: make EvTimer::handleTimer() const

* chore: mark tr_bandwidth remove_child as noexcept
2022-08-13 12:11:07 -05:00
Charles Kerr 63eab54fd5
refactor: timer pt 2 (#3617)
* feat: add convenience variants of TimerMaker::create()

* refactor: use libtransmission::Timer in peer-mgr

* refactor: use libtransmission::Timer in peer-msgs

* refactor: use libtransmission::Timer in tr-utp

* refactor: use libtransmission::Timer in tr-dht

* refactor: use libtransmission::Timer in port-forwarding

* refactor: use libtransmission::Timer in webseed

* refactor: use libtransmission::Timer in tr-lpd

* refactor: use libtransmission::Timer in rpc-server

* chore: remove unused function tr_timerAdd()

* chore: remove unused function tr_gettimeofday()

* fixup! chore: remove unused function tr_timerAdd()

* fixup! refactor: use libtransmission::Timer in port-forwarding
2022-08-11 12:28:37 -05:00
Charles Kerr c66303fae2
refactor: watchdir (#3606) 2022-08-10 08:34:51 -05:00
Charles Kerr 31a733fab7
refactor: make tr_session_id a class (#3598) 2022-08-06 14:27:37 -05:00
Charles Kerr 4bc1589c5d
refactor: remove tr_win32_utf8_to_native_ex() (#3590) 2022-08-05 14:16:25 -05:00
Charles Kerr 8b983b3d1c
refactor: tr_sys_path_resolve() returns a std::string (#3587)
* refactor: tr_sys_path_resolve returns std::string
2022-08-05 11:36:01 -05:00
Charles Kerr ef34c7c4dc
refactor: use std::wstring on win32 (#3578) 2022-08-03 18:07:38 -05:00
Charles Kerr dab81c1af6
fix: readability-inconsistent-declaration-parameter-name warnings in libtransmission (#3572) 2022-08-03 01:15:37 -05:00
Charles Kerr 5eb7f75010
refactor: tr_sys_path_get_info() now returns a tr_sys_path_info (#3566)
* refactor: tr_sys_path_get_info() now returns a tr_sys_path_info

* refactor: tr_sys_file_get_info() now returns a tr_sys_path_info
2022-08-02 12:41:04 -05:00
Charles Kerr fa6ba14dc3
refactor: remove closure struct in tr-dht (#3550)
This was the last use of tr_memdup(), so remove that too
2022-07-29 14:38:43 -05:00
Charles Kerr e0ca366b2d
refactor: remove tr_loadFile() (#3540)
* refactor: use the std::vector variant of tr_loadFile() in rpc-server.cc

* refactor: use the std::vector variant of tr_loadFile() in rename-test.cc

* refactor: remove the unused raw ptr variant of tr_loadFile()
2022-07-28 14:22:32 -05:00
Charles Kerr b7bc21cdb6
refactor: reimplement tr_strlcpy() using fmt::format_to_n() (#3530) 2022-07-27 12:38:46 -05:00
Charles Kerr ec79a2a888
fix: clang-tidy misc-const-correctness warnings (#3529) 2022-07-27 09:03:13 -05:00
Charles Kerr 0e7ef51d5c
refactor: tr_env_get_string() now returns a std::string (#3527) 2022-07-26 23:26:37 -05:00
Charles Kerr d62a0bd81e
Instantiate `tr_parseNum()` template using basic types (#3404)
There're places where e.g. `size_t` is used which may or may not match one of
`(u)intXX_t` types.

Authored-by: Mike Gelfand <mikedld@mikedld.com>
2022-07-03 23:28:41 -05:00
Charles Kerr 8806f9af68
fix: duplicate template instantiation on raspberry pi armv7 (#3200) 2022-06-05 00:01:23 -05:00
Charles Kerr fe288b45e5
perf: do not use tr_variant when parsing .torrent files 2022-05-23 23:05:16 -05:00
Charles Kerr c0bb2d40f1
refactor: add pathbuf and std::string-friendly helpers to tr_sys file and path funcs (#3118)
* refactor: add sv-friendly tr_sys_dir_create() variant

* refactor: add sv-friendly tr_sys_path_get_info() variant

* refactor: add sv-friendly tr_sys_path_exists() variant

* refactor: add sv-friendly tr_sys_path_remove() variant

* refactor: add sv-friendly tr_sys_path_rename() variant

* fixup! refactor: add sv-friendly tr_sys_path_rename() variant
2022-05-21 20:17:00 -05:00
Charles Kerr 690cf50e53
perf: tr_sys_path_dirname() returns a std::string_view (#2990)
* refactor: use nodejs impl of path.win32.dirname()

* refactor: use nodejs impl of path.posix.dirname()
2022-05-21 11:10:58 -05:00
Charles Kerr 2293f4336a
perf: use fast_float to parse floating-point numbers (#3092) 2022-05-16 00:06:17 -05:00
Charles Kerr 1ebac744a5
build: re-enable cert-err33-c clang-tidy warning (#2968)
* refactor: re-enable cert-err33-c clang-tidy warning

* refactor: use fmt::chrono in transmission-remote

* refactor: use fmt::chrono in transmission-show

* refactor: use fmt::chrono in GTK details dialog

* refactor: use fmt::chrono in tr_session

* refactor: remove tr_localtime_r

* refactor: remove tr_gmtime_r
2022-04-22 14:56:54 -05:00
Charles Kerr ed897f93f2
refactor: remove evbuffer_free_to_str() (#2967) 2022-04-22 13:05:49 -05:00
Antoine Cœur bdac708762
docs: fix various typos and misspellings (#2955) 2022-04-21 09:28:38 -05:00
Charles Kerr b256da02e3
refactor: remove unused macros (#2897)
* refactor: remove unused fu nction tr_lowerBound()

* refactor: tr_timerAdd() takes a reference, not a pointer

* refactor: tr_timerAddMsec() takes a reference, not a pointer

* refactor: tr_moveFile() takes a reference, not a pointer

* refactor: tr_wildmat() takes std::string_views

* refactor: remove unused macro TR_GNUC_NONNULL

* refactor: remove unused macro TR_GNUC_PRINTF

* refactor: remove unused macro TR_GNUC_NULL_TERMINATED

* refactor: remove unused macro TR_GNUC_HOT

* refactor: remove unused macro __has_feature

* refactor: remove unused macro __has_attribute

* refactor: remove unused macro TR_DEPRECATED

* refactor: remove unused macro TR_DISABLE_COPY_MOVE
2022-04-07 19:20:29 -05:00
Charles Kerr ffda5bb68a
refactor: remove tr_strip_positional_args() (#2881)
* refactor: use fmt in gtk/SystemIconTray

* refactor: use fmt in gtk/MakeDialog

* refactor: remove unused tr_strip_positional_args()

Co-authored-by: Mike Gelfand <mikedld@mikedld.com>
2022-04-07 08:23:04 -05:00
Charles Kerr 7ff1382503
refactor: remove tr_strcmp0() (#2882) 2022-04-05 12:45:26 -05:00