Commit Graph

84 Commits

Author SHA1 Message Date
Yat Ho
08ec7fb7c7 build: lint header files with clang-tidy (#7527)
* build: clang-tidy headers when building libtransmission

* chore: revert `= default` workaround

It was introduced in 6909ec0bad to fix build issues with macOS 10.14. We
no longer support that version.

* fix: clang-tidy warnings for libtransmission

* build: clang-tidy headers when building tests

* fix: clang-tidy warnings for tests

* build: clang-tidy headers when building qt

* code review: don't manually edit mime-types.h

* code review: unify variable naming for static private members
2025-05-07 22:10:16 +01:00
Charles Kerr
0518a2269e fix: do not mark Variant::make_map() as noexcept (#7466) 2025-03-04 18:42:08 -06:00
Yat Ho
5a05b37838 feat: support the JSON null type in tr_variant (#7255) 2024-12-15 16:50:19 -06:00
Yat Ho
90859fe115 test: use new tr_variant API (#7268)
* test: new `tr_variant` API in `json-test.cc`

* test: new `tr_variant` API in `variant-test.cc`

* chore: housekeeping

* test: new `tr_variant` API in `dht-test.cc`

* fix: use `reinterpret_cast` in `tr_variant::make_raw()`

* fix: add missing `typename` in `tr_variant::make_raw()`

* test: new `tr_variant` API in `settings-test.cc`

* test: new `tr_variant` API in `move-test.cc`

* test: new `tr_variant` API in `rpc-test.cc`

* test: new `tr_variant` API in `makemeta-test.cc`

* test: new `tr_variant` API in `session-test.cc`
2024-12-09 19:22:54 -06:00
Charles Kerr
d1a1a0adae fix: clang-tidy header warnings, pt. 1 (#7228)
* fix: warning: deleted member function should be public [modernize-use-equals-delete]

* fix: warning: variable has inline specifier but is implicitly inlined [readability-redundant-inline-specifier]

* fix: warning: enum uses a larger base type than necessary for its value set [performance-enum-size]

* fix: warning: initializer for member is redundant [readability-redundant-member-init]

* warning: parameter is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
2024-11-17 20:04:55 -06:00
Yat Ho
1e16912ae4 refactor: new tr_variant API in transmission-remote and other cleanup (#6798)
* refactor: remove `Arguments`

* refactor: replace pointer args with lvalue reference

* refactor: use `uint16_t` for port number

* chore: housekeeping

* refactor: replace `char*` with `std::string_view`

* refactor: simplify argument parsing code

* refactor: use new `tr_variant` API in remote

* chore: rename function to snake_case

* chore: move `break` statements in switches outside of compound statements

* chore: use `std::string` literals

* refactor: extract tor start/stop to `MODE_TORRENT_START_STOP`

* refactor: extract tor actions to `MODE_TORRENT_ACTION`

* chore: iwyu

* fix: msvc build failure

* chore: misc cleanup

* fix: dereference optional

* chore: misc cleanup

* ui: fix minor formatting errors

* fix: remove redundant if branches for response string

* code review: remove `o` prefix for optionals

* code review: add condition clause

* code review: check `left_until_done` instead

* fix: unchecked nullptr

* code review: don't reassign method name

* code review: revert accidentally renaming `addIdArg` to `get_id_arg`

* code review: use `TR_ASSERT` instead of `assert`

* refactor: fix static auto constexpr naming

* code review: assert array size

* code review: assert that `arguments` key exists
2024-08-17 20:04:49 +01:00
Yat Ho
e1c9fbde60 fix: restore loose data type parsing in RPC and settings.json (#6723)
* refactor: incorporate lenient parsing from `tr_variantGet*()` functions into `tr_variant`

* fix: restore loose data types in RPC and settings.json

* fix: workaround GCC defect

* fix: MSVC build
2024-03-31 14:06:36 -05:00
Cœur
6909ec0bad build: fix building on macOS 10.14.6, 10.15.7 and 11.7 (#6590) 2024-03-09 10:27:20 -06:00
Charles Kerr
c14d445cf5 refactor: libtransmission Settings (#6592)
* refactor: make tr_session_settings a libtransmission::Settings

* refactor: make VariantConverter private in settings.cc
2024-02-15 11:31:09 -06:00
Cœur
e5e768e2ab fix: implicit conversion loses integer precision (#6466) 2023-12-31 14:04:26 -06:00
Cœur
98b3e819ca fix: Local variable 'pex' will be copied despite being returned by name (#6300) 2023-11-26 11:27:40 -06:00
Charles Kerr
37f01fac4c refactor: migrate variant api (#6238) 2023-11-10 15:41:32 -06:00
Charles Kerr
a952a0731f refactor: remove the tr_error** idiom (#6198)
* refactor: remove the tr_error** idiom

* fix: tr_error::message() is only constexpr in c++20 and up

* chore: silence a couple of g++-12 Wshadow warnings
2023-11-04 11:39:41 -05:00
Yat Ho
a2b547fb50 chore: iwyu (#6201) 2023-11-03 12:03:26 -05:00
Charles Kerr
a6c5dea40c refactor: work around C3779 error in MSVC 14.37.32822 (#6197) 2023-11-02 23:18:11 -05:00
Julien
8ac323d5d6 chore: removed copyright timespans in headers (#4850) 2023-11-01 16:11:11 -05:00
Charles Kerr
165cf169e6 refactor: extract the lambda method in tr_variant::Map::find() (#6161)
experimental change for msvc 19.37 ftbfs
2023-10-25 15:36:28 -04:00
Charles Kerr
bbc3ce039f refactor: remove quark support from tr_variant (#6159) 2023-10-24 14:49:23 -04:00
Charles Kerr
114885d67b fixup! refactor: tr_variant API update (#5998) (#6036)
fix use of invalidated pointer in rpcipml
2023-09-25 13:24:46 -05:00
Charles Kerr
6ead147620 refactor: use new tr_variant API in tr_session (#6006) 2023-09-16 08:23:35 -05:00
Charles Kerr
9a82372e95 refactor: tr_variant API update (#5998) 2023-09-13 08:49:17 -05:00
Charles Kerr
ebb1b775af refactor: public tr_session settings API now returns tr_variants (#5983) 2023-09-07 19:05:16 -05:00
Charles Kerr
43030132fc refactor: use std::variant in tr_variant (#5936) 2023-08-23 12:57:58 -05:00
Charles Kerr
59c638c63d refactor: replace tr_variant::is_*() with tr_variant::holds_alternative() (#5930) 2023-08-21 16:16:54 -05:00
Charles Kerr
5837603b6f refactor: make tr_variant follow RAII (#5923) 2023-08-20 23:15:23 -05:00
Charles Kerr
a4d205612a refactor: add tr_variant_serde (#5903) 2023-08-17 11:02:45 -05:00
Charles Kerr
c6e47c232e refactor: use std::variant in tr_variant, pt 1: make tr_variant_string private (#5832) 2023-07-28 16:14:31 -05:00
tearfur
5ec4ca550e chore: iwyu (#5746) 2023-07-08 10:24:03 -05:00
Charles Kerr
ce66e5c442 iwyu: remove, add std headers where used (#5694)
* chore: remove unused #include <array>

* chore: remove unused #include <chrono>

* chore: remove unused #include <set>

* chore: remove unused #include <algorithm>

* chore: remove unused #include "interned-string.h"

* chore: remove unused #include <list>

* chore: remove unused #include <optional>

* chore: iwyu <cstddef>

* chore: iwyu <ctime>

* chore: remove unused #include <cerrno>

* chore: remove unused #include <deque>

* chore: remove unused #include <vector>

* chore: remove unused #include <memory>

* chore: remove unused #include <unordered_set>

* chore: remove unused #include <array>

* chore: remove unused #include <mutex>

* chore: remove unused #include <functional>

* chore: remove unused #include <cmath>
2023-06-29 23:51:55 -05:00
Julien
4b8cfa2e57 chore: update copyrights to 2023 (#4834) 2023-02-11 14:49:42 -06:00
Charles Kerr
724a0f48f0 fix: clang-tidy header warnings (#4686) 2023-01-28 17:58:20 -06:00
Cœur
c89edcd1f6 underscores in documentation comments should be code escaped (#4639) 2023-01-23 10:26:11 -06:00
Charles Kerr
7367d465b5 style: use the new paragraph comment style everywhere (#4634) 2023-01-22 13:21:30 -06:00
Charles Kerr
09bb1a60f0 refactor: add more nodiscard, constexpr, and noexcept (#4089) 2022-11-03 18:08:02 -05:00
Charles Kerr
611d36ac84 refactor: decouple session settings from the session class (#4053) 2022-11-01 19:32:26 -05:00
Charles Kerr
b32f3e0a24 refactor: add tr_address::toCompact() (#4014)
* refactor: add tr_address::toCompact()

* test: use the theory.org compact ipv4/6 examples in NetTest.compact4, NetTest.compact6

* refactor: add tr_address::toCompact()

* test: add toCompact, fromCompact tests

* refactor: add compact <--> sockaddr_storage conversion
2022-10-24 13:40:12 -05:00
Charles Kerr
450f1dcadc refactor: extract tr_buffer class from tr_peerIo (#3986) 2022-10-19 11:42:08 -05:00
Charles Kerr
c0f29a89ea refactor: add [[nodiscard]] (#3793) 2022-09-08 21:49:51 -05:00
Charles Kerr
bfec98c323 refactor: avoid tr_new() in transmission-remote (#3665) 2022-08-17 20:25:42 -05:00
Charles Kerr
83ffa6bf1b chore: fix spdx abbreviations (#3602) 2022-08-08 13:05:39 -05:00
Charles Kerr
868fc1ab78 Refactor/tr variant from buf (#3592)
* refactor: use std::string in tr_watchdir_inotify_on_event()

* refactor: add template tr_variantFromBuf() variant

if it has .data() and .size() it is good
2022-08-05 16:12:45 -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
205abbbcce refactor: iwyu string, vector, cstdint (#2898)
* refactor: use cstdint for intX_t types

* refactor: iwyu sstring_view

* refactor: iwyu <cstring>

* refactor: iwyu <vector>
2022-04-07 20:50:26 -05:00
Charles Kerr
4c2cb23c24 refactor: tr_variantToFile() takes a string_view filename (#2824)
* chore: fix shadowed variable warning

"byte" is declared by a third-party UTP header

* refactor: tr_variantFromFile, tr_variantToFile take a string_view filename
2022-03-25 22:39:08 -05:00
Charles Kerr
df1cca9b57 chore: update copyright years, make notices consistent (#2463) 2022-01-20 12:27:56 -06:00
Charles Kerr
db23ca4c6b refactor: replace tr_info with tr_torrent_metainfo (#2397)
* refactor: replace tr_info with tr_torrent_metafo
2022-01-15 13:33:57 -06:00
Charles Kerr
b0ee4007ff refactor: include cleanups (#2392)
* refactor: include <memory> when using shared_ptr or unique_ptr

* refactor: include <cstdio> iff we use it

* refactor: include <cstring> iff we use it

* refactor: include <cstdlib> iff we use it

* refactor: include <string_view> or <string> iff we use it

* refactor: include <array> iff we use it

* refactor: include <ctime> iff we use it

* refactor: include <cctype> iff we use it

* refactor: misc #include cleanups in libtransmission
2022-01-12 20:13:58 -06:00
Charles Kerr
fa35b8ad39 refactor: use std::string in tr_variantToStr() (#2351)
* refactor: use std::string in tr_variantToStr()
2021-12-27 16:47:25 -06:00
Charles Kerr
deee2b043e refactor: take string_view in tr_loadFile(), tr_saveFile() (#2335) 2021-12-24 13:37:34 -06:00
Charles Kerr
42b1362760 refactor: tidy libtransmission includes (#2316) 2021-12-15 15:25:42 -06:00