mirror of
https://github.com/transmission/transmission.git
synced 2025-12-24 20:35:36 +00:00
C++ modernize: Replace MIN/MAX with type safe std::min/std::max (#1806)
* C++ modernize: Replace MIN/MAX with type safe std::min/std::max
* Template std::min/max invocations now explicitly use largest integer type
* torrent.cc did not have <algorithm> included
* MIN/MAX Changes for subprocess-win32.cc
* Using type{} style cast instead of template parameter in std::min/max
* 32-bit type cast errors with uint64_t versus size_t
* 32-bit type cast errors inout.cc and file.cc
* Missing include in windows code; Type cast error fixed
* Missing macro in win32 daemon; Replaced MIN in commented code with std::min
* Update libtransmission/tr-getopt.cc
Co-authored-by: Mike Gelfand <mikedld@users.noreply.github.com>
* Update libtransmission/file-posix.cc
Co-authored-by: Mike Gelfand <mikedld@users.noreply.github.com>
* Update tests/libtransmission/copy-test.cc
Co-authored-by: Mike Gelfand <mikedld@users.noreply.github.com>
* Update libtransmission/peer-mgr.cc
Co-authored-by: Mike Gelfand <mikedld@users.noreply.github.com>
* Strlen returns size_t, remove cast
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: Mike Gelfand <mikedld@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
6aba12888a
commit
312d18281d
@@ -6,10 +6,11 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <ctype.h> /* isdigit */
|
||||
#include <errno.h>
|
||||
#include <stdlib.h> /* strtol */
|
||||
#include <string.h> /* strcmp */
|
||||
#include <algorithm>
|
||||
#include <cctype> /* isdigit */
|
||||
#include <cerrno>
|
||||
#include <cstdlib> /* strtol */
|
||||
#include <cstring> /* strcmp */
|
||||
|
||||
#ifndef ZLIB_CONST
|
||||
#define ZLIB_CONST
|
||||
@@ -1246,7 +1247,7 @@ static int copyTrackers(tr_tracker_info* tgt, tr_tracker_info const* src, int n)
|
||||
{
|
||||
tgt[i].tier = src[i].tier;
|
||||
tgt[i].announce = tr_strdup(src[i].announce);
|
||||
maxTier = MAX(maxTier, src[i].tier);
|
||||
maxTier = std::max(maxTier, src[i].tier);
|
||||
}
|
||||
|
||||
return maxTier;
|
||||
|
||||
Reference in New Issue
Block a user