Since there is no way to mark parameters as [potentially] unused in
standard C and when using MSVC compiler, use the widely accepted
cast-to-void approach instead.
MSVC does not support GNU-style compiler flags, and vice versa. Not only
does it make no sense to test for those flags, with MSVC it also takes
considerably longer to do so.
The only flag that MSVC does support is -Wall (/Wall), but since it's
equivalent to Clang's -Weverything and thus issues lots of warnings
nobody usually cares about, including from system header files, it's
preferred to use /W4.
Some compilers issue additional CLI-level warning, that cannot be
suppressed, when passed flags that are irrelevant for a particular
invocation. Temporarily treat warnings as errors when testing flags
support so that those warnings lead to flags being excluded.
When built with CMake, CURL installation includes configuration package
that could be used instead of CMake-bundled find module. The former
doesn't define CURL_INCLUDE_DIRS and CURL_LIBRARIES variables, but only
imported targets.
* chore: disable deprecation warnings in GTK client
Yes, updating the GTK codebase is still a goal. (help welcomed!)
But there's a deluge of deprecation warnings that drown out other more
important warnings, so turn off deprecation warnings for now.
* fixup! chore: disable deprecation warnings in GTK client
* fix: gtk_tree_sortable_set_sort_column_id caller.
* fix: gtk_window_resize caller.
* Switch to new libcurl's polling interface
* Drop unused includes
* Use NOFILE limit value defined by operating system
* Avoid tight loops, ensure blocking for a small timeout
When there are no file descriptors to wait for, select() would work the
same as sleep(). But curl_multi_wait() returns immediately in this case,
so we need to add explicit wait to avoid tight loops.
Documentation: https://curl.haxx.se/libcurl/c/curl_multi_timeout.html
Discussion: https://curl.haxx.se/mail/lib-2018-03/0074.html
* Bump libcurl minimum version to 7.28.0
Minor optimization: since we don't actually change our request headers
very often, we can lazy-build the request once and reuse that instead of
having to rebuild it each time.
Explicitly delete the implied function to ensure we don't get bitten by
this again in the future.
Mark the string_views constexpr where possible so that we can avoid some
strlen() calls at runtime.
* chore: fix deprecation warnings of GTK_STOCK_ use.
This is just a tiny step towards getting all of the GTK code up-to-date,
but GTK_STOCK warnings are the lowest-hanging fruit of the warnings, so
let's fix them.
* refactor: make variant_headers reusable to qt app.
Torrent.cc's `change()` template methods are generically useful to deal
with tr_variant wrangling, but previously were only used in Torrent.cc.
This PR moves them into a new API `VariantHelpers.h` for use by Prefs,
Session, TorrentModel, etc.
* refactor: Torrent::update() returns a delta bitset
Setting up for followup PRs where, instead of doing expensive work every
time there is a change, we can be more fine-grained and do the work only
if the relevant Torrent properties changed.
* chore: make uncrustify happy
* refactor: update filterbar counts more selectively
Only rebuild the activity and tracker combobox models when the model's
size changes or when the relevant Torrent properties change.
Previously, rebuild would happen on any Torrent property change even if
the properties were unrelated to activity or trackers.
* chore: remove redundant "private:" key
* refactor: Torrent::update() returns a delta bitset
Setting up for followup PRs where, instead of doing expensive work every
time there is a change, we can be more fine-grained and do the work only
if the relevant Torrent properties changed.
* chore: make uncrustify happy
* chore: fix #includes
* refactor: faster action sensitivity updates
Currently we walk through every row in the model and pump its TorrentRole data, which can be expensive for long lists. However since we're only interested in the selected rows, let's save some traversal overhead by getting that list directly and walking it instead.
edit-date got added to the backend in 3.00, but I never finished adding
it properly to the Qt client. This PR rectifies that. When a torrent is
edited, the Application and DetailsDialogs will re-query the backend to
update the torrent properties that are needed.
* refactor: use snake_case field naming in qt client
* fix: some missed symbols
* chore: make uncrustify happy
* fixup! refactor: use snake_case field naming in qt client
* chore: remove qvariants from torrent class
* chore: remove unused Q_DECLARE macro calls
* refactor: remove unused includes from Torrent.h
* chore: make clang-tidy and linter happy
* refactor: rename 'setValue()' to 'change()'
* refactor: make tr_variant function paramters const
* chore: remove devel scaffolding
* refactor: rename peer_limit_ to peerLimit_
* refactor: do not use bitwise logic on booleans
GTK client: none.
Qt client: Finnish.
Mac client: none (there're suitable languages, but they're lacking XIB files
and we haven't switched to base localization yet).
* crypto-utils: do tr_rand_int without abs
There is really not much point in trying to abs a random int when you can just interpret it as unsigned in the first place.
* fixup! trailing space
how did this get in here?
* fixup! unsigned int
Co-authored-by: Charles Kerr <charles@charleskerr.com>