Commit Graph

13725 Commits

Author SHA1 Message Date
Charles Kerr 3b72a1feea
refactor: use C++ inheritance for tr_peer, tr_peerMsgs, and tr_webseed (#1877)
* refactor: use C++ inheritance for tr_peer, tr_peerMsgs, and tr_webseed
2021-10-07 08:33:55 -05:00
Charles Kerr 83f21b8e0e
refactor: prefer constexpr functions over static inline ones (#1887)
* refactor: prefer constexpr functions over static inline ones
2021-10-06 17:24:04 -05:00
Charles Kerr f876a100a0
refactor: add [[fallthrough]] annotation (#1886) 2021-10-06 12:24:02 -05:00
Charles Kerr 003685b40a
refactor: use nullptr instead of NULL (#1884)
* refactor: use nullptr instead of NULL.

No functional changes; just more C++ification
2021-10-06 11:32:17 -05:00
Charles Kerr cc204e0b2c
refactor: prefer "using" over "typedef" (#1883)
* refactor: prefer "using" over "typedef"
2021-10-06 09:26:07 -05:00
Charles Kerr 035ca23226
fix: sonarcloud false error from O_SEQUENTIAL use. (#1882)
Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AXvcFXmBqMngl89XhIRU&open=AXvcFXmBqMngl89XhIRU
2021-10-06 08:09:16 -05:00
Charles Kerr 396afd8a42
refactor: remove unused tr_variant_string.session (#1881)
This was assigned but never used. Shrinks sizeof(tr_bandwidth) by 8 bytes.
2021-10-05 19:06:18 -05:00
Charles Kerr 3b49fa993c
refactor: remove unused tr_variant_string.quark (#1880)
This was assigned but never used. Shrinks sizeof(tr_variant) by 8 bytes.
2021-10-05 14:33:02 -05:00
Charles Kerr 8983af7e46
refactor: make some tr_session methods private (#1879)
These public methods weren't used anywhere except in tr_session, so make
them private.

tr_sessionGetAltSpeed_Bps()
tr_sessionGetPieceSpeed_Bps()
tr_sessionGetRawSpeed_Bps()
tr_sessionSetAltSpeed_Bps()
tr_sessionSetSpeedLimit_Bps()
2021-10-05 13:54:02 -05:00
Mike Gelfand c8d0c8db2e Switch from zip to 7z for PDBs archive on AppVeyor
This reduces its size by more than 1.5 times.
2021-10-05 20:33:09 +03:00
Charles Kerr 6b7f2f9e53
refactor: make tr_info.errorString a const char*. (#1878)
this field now points to tr_torrent.errorString instead of copying into
a standalone char array.

old: sizeof(tr_torrent) 2640
new: sizeof(tr_torrent) 2136
2021-10-05 12:23:07 -05:00
Charles Kerr 976fec6e94
refactor: make mime-type array inline constexpr (#1872)
* refactor: make mime-type array inline constexpr

* fix: iwyu <iterator> for std::back_inserter

* fix: remove newly-unused variable in mime-types.js
2021-10-01 17:55:19 -05:00
Charles Kerr 6b71050000
fix: recent regressions (#1873)
* fixup! refactor: use std::set in tr_webseed (#1847)

fix: use placement new to instantiate tr_webseeds.tasks

* fixup! refactor: use std::string in tr_scrape_response (#1866)

fix: avoid assigning a nullptr to std::string

* fixup! refactor: use std::string in tr_scrape_response (#1866)

fix: avoid assigning a nullptr to std::string
2021-10-01 16:57:30 -05:00
Charles Kerr 916d418824
fix: some Coverity regressions reported on 2021-09-16 (#1870)
* fix: coverity regressions reported on 2021-10-01

leaks introduced by 3fd5c81a

* fix: resource leak in test utility filesAreIdentical()

* fix: use-after-free warning in test code for tr_urlParse()

* fix: false warning for unterminated c string

* fix: false unchecked return value in test code

cid 1491881

* fix: unterminated c string in test code

cid 1491890

* refactor: slightly better assertions in file-test
2021-10-01 15:28:01 -05:00
Charles Kerr b546fd423f
fix: sonarcloud getopt warnings (#1871)
* fix: sonarcloud out-of-bound memory access warning

* fix: sonarcloud out-of-bound memory access warning

* fix: sonarcloud 64-to-32 narrowing warning
2021-10-01 12:47:23 -05:00
Charles Kerr c87d22d53f
fix: coverity regressions reported on 2021-10-01 (#1869)
leaks introduced by 3fd5c81a
2021-10-01 08:21:05 -05:00
Charles Kerr 392c375b17
refactor: use std::vector in tau_announce_request (#1868) 2021-10-01 07:18:49 -05:00
Charles Kerr d8af31a866
refactor: use std::string in tau_tracker (#1867) 2021-10-01 06:29:53 -05:00
Charles Kerr 3fd5c81a22
refactor: use std::string in tr_scrape_response (#1866) 2021-09-30 16:33:31 -05:00
Charles Kerr 14fc626943
refactor: use std::vector for tau_scrape_request.payload (#1865) 2021-09-30 14:00:02 -05:00
Charles Kerr a76cf22211
refactor: use std::map for tr_announcer.scrape_info (#1864)
* refactor: use std::map for tr_announcer.scrape_info
2021-09-30 13:18:46 -05:00
Charles Kerr 7c4f66c44e
refactor: use a std:: container in getBlockRequestPeers() (#1863)
* refactor: use std::vector in getBlockRequestPeers()
2021-09-30 10:08:34 -05:00
Charles Kerr 766d95b352
refactor: use std::vector in rechokeUploads() (#1862) 2021-09-30 09:20:55 -05:00
Charles Kerr 5395e2e545
refactor: use std::vector and std::array in quark.cc (#1861)
* refactor: use std::vector and std::array in quark.cc
2021-09-30 07:01:04 -05:00
Charles Kerr e47762c7ca
refactor: use std::vector in extract_parts_from_multipart() (#1860)
* refactor: use std::vector in extract_parts_from_multipart()
2021-09-29 21:14:31 -05:00
Charles Kerr 78e571d6f2
refactor: use std::set in tr_announcer.stops (#1859)
* refactor: use std::set for tr_announcer.stops
2021-09-29 18:42:50 -05:00
Charles Kerr 20b5a8c62b
refactor: use std::vector in tr_sessionGetNextQueuedTorrents (#1858) 2021-09-29 17:21:04 -05:00
Charles Kerr 27068cb4a6
refactor: use std::unordered_set in loadBlocklists (#1857)
* refactor: use std::unordered_set in loadBlocklists
2021-09-29 16:23:34 -05:00
Charles Kerr baafb68bfd
refactor: use std::unordered_set for tr_torrent.labels (#1856) 2021-09-29 14:52:19 -05:00
Charles Kerr e03bc8e5bc
refactor: replace tr_ptrArray with std::unordered_set in tr_watchdir_scan() (#1854)
* replace tr_ptrArray with std:: in tr_watchdir_scan
2021-09-29 12:25:52 -05:00
Charles Kerr 055a8ecb4d
refactor: use std::set in deleteLocalData() (#1853) 2021-09-29 10:22:04 -05:00
Charles Kerr b413e934ba
in variant-benc, use std::deque not tr_ptrArray (#1851) 2021-09-28 19:09:01 -05:00
Charles Kerr e2f0432146
in variant-json, use std::deque not tr_ptrArray (#1850) 2021-09-28 08:56:46 -05:00
Charles Kerr 7d2f65455c
refactor: remove unused tr_list code (#1849) 2021-09-27 17:57:20 -05:00
Charles Kerr 16a70e57d2
refactor: use std::set in verify.cc's verifyList (#1848)
* refactor: use std::set in verify.cc
2021-09-27 17:07:58 -05:00
Charles Kerr 2554adba9c
refactor: use std::set in tr_webseed (#1847) 2021-09-27 14:28:11 -05:00
Charles Kerr 12f052621d
refactor: replace tr_list with std::list in tr_session.blocklists (#1846) 2021-09-27 13:28:41 -05:00
Charles Kerr c42a6c785d
refactor: replace tr_list with std::set in web.cc (#1845) 2021-09-27 11:27:02 -05:00
Charles Kerr 3504933fba
refactor: replace tr_list with std::list in rpc-server whitelists (#1844) 2021-09-27 10:03:54 -05:00
Charles Kerr 96d3559a18
refactor: replace tr_list with std::list in tr_getWebClientDir() (#1843) 2021-09-27 08:45:21 -05:00
Charles Kerr 643074e7bb
refactor: use std::list in variant-json.cc (#1842)
* refactor: replace tr_list with std::deque in variant-json.cc struct ParentState
2021-09-27 07:46:38 -05:00
Charles Kerr 78d2074335
refactor: replace tr_list with std::list in sessionLoadTorrents() (#1841) 2021-09-26 17:23:11 -05:00
Charles Kerr 7f2578008d
refactor: tr_parseNumberRange returns std::vector. (#1838)
* refactor: tr_parseNumberRange returns std::vector.
2021-09-25 14:37:28 -05:00
Charles Kerr 17ee032dd8
refactor: remove TR_BEGIN_DECLS, TR_END_DECLS (#1837)
* refactor: remove TR_BEGIN_DECLS, TR_END_DECLS
2021-09-25 11:07:22 -05:00
Mike Gelfand c646a26c43
Reimplement quarks order check as a static assert (#1836) 2021-09-25 08:56:34 -05:00
Mike Gelfand 4ac1c601f5
Port GTK client to C++ (#1833)
* Rename GTK client .c files to .cc

* Fix GTK client build errors after C to C++ switch

* Remove `G_{BEGIN,END}_DECLS`

Co-authored-by: Charles Kerr <charles@charleskerr.com>
2021-09-25 13:47:09 +03:00
Charles Kerr b92c609ed9
refactor: use std container for session torrents (#1832)
* refactor: use std container for session's torrents
2021-09-24 18:31:02 -05:00
Charles Kerr 6c77fa92ce
Port transmission-cli to C++ (#1831)
* move transmission-cli to C++
2021-09-24 09:38:09 -05:00
Mike Gelfand b7ba261359
Port macOS client to C++ (#1830)
* Rename all .m (Obj-C) files to .mm (Obj-C++)

* Fix build in Obj-C++ mode

* Fix Xcode build
2021-09-24 07:56:57 -05:00
dependabot[bot] 5c9b34c676
chore(deps): bump url-parse from 1.5.1 to 1.5.3 in /web (#1828)
Bumps [url-parse](https://github.com/unshiftio/url-parse) from 1.5.1 to 1.5.3.
- [Release notes](https://github.com/unshiftio/url-parse/releases)
- [Commits](https://github.com/unshiftio/url-parse/compare/1.5.1...1.5.3)

---
updated-dependencies:
- dependency-name: url-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2021-09-22 17:24:46 -05:00