* refactor: remove unused field tr_torrent.prefetchMagnetMetadata
* refactor: remove unused field tr_torrent.dhtAnnounce6InProgress
* refactor: remove unused field tr_torrent.dhtAnnounceInProgress
* refactor: fold etaULSpeed and etaDLSpeed into one field
* refactor: re-arrange fields to avoid padding
* 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
* Modernize bitfield.cc: Storage changed to vector of bytes, return vector from getRaw, new Span readonly memory view
Modernize bitfield.cc: Code style/review notes
Modernize bitfield.cc: Code format
* Modernize bitfield.cc: Swap end and begin in bit counting code assertion
* Modernize bitfield.cc: Rewrite states and simplify code
* Modernize bitfield.cc: Fixing the code and tests
* Modernize bitfield.cc: Fixing tests
* Modernize bitfield.cc: Formatting; +std::size, +const
* Modernize bitfield.cc: Grouped member functions into the struct; C++ construction
* Modernize bitfield.cc: Naming style similar to qt/ C++ source
* Modernize bitfield.cc: Bitfield test updated to new API
* Modernize bitfield.cc: Renames for private functions
* Modernize bitfield.cc: Formatting
* Modernize bitfield.cc: Remove struct in 'struct Bitfield' and update commented code too
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Port libtransmission to C++. This PR doesn't refactor everything to c++.
Its code changes are only what was necessary to compile and link as c++.
See libtransmission/README.md for details on how to submit modernization
patches!
Co-authored-by: Mike Gelfand <mikedld@mikedld.com>
This way all the qualifiers (`const`, `volatile`, `mutable`) are grouped
together, e.g. `T const* const x` vs. `const T* const x`. Also helps reading
types right-to-left, e.g. "constant pointer to constant T" vs. "constant
pointer to T which is constant".
There're places where manual intervention is still required as uncrustify
is not ideal (unfortunately), but at least one may rely on it to do the
right thing most of the time (e.g. when sending in a patch).
The style itself is quite different from what we had before but making it
uniform across all the codebase is the key. I also hope that it'll make the
code more readable (YMMV) and less sensitive to further changes.
1. add the option the code to be used under GPLv2 or GPLv3; previously only GPLv2 was allowed
2. add the "proxy option" as described in GPLv3 so we can add future licenses without having to bulk-edit everything again :)
3. remove the awkward "exception for MIT code in Mac client" clause; it was unnecessary and confusing.
This is partially to address #4145 "Downloads stuck at 100%" by refactoring the bitset, bitfield, and tr_completion; however, the ripple effect is larger than usual so things may get worse in the short term before getting better.
livings124: to fix the mac build, remove bitset.[ch] from xcode
The Berne Convention says that the copyright year is moot, so instead of adding another year to each file as in previous years, I've removed the year altogether from the source code comments in libtransmission, gtk, qt, utils, daemon, and cli.
Juliusz's copyright notice in tr-dht and Johannes' copyright notice in tr-lpd have been left alone; it didn't seem appropriate to modify them.