1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-24 00:34:04 +00:00
transmission/macosx/Utils.h

11 lines
357 B
C
Raw Normal View History

chore: fix warnings when compiling macOS client with either Xcode or CMake (#6676) * chore: fix CGFloat comparison warnings in macOS code. There are 2 cases: 1. Speed comparisons. The lowest significant value displayed in UI is 0.1 bytes per sec. See [NSString stringForSpeed] and [NSString stringForSpeedCompact]. 2. Ratio limit comparison. The lowest significant value displayed in UI is 0.01 (no unit). This is based on maximumFractionDigits=2 set in related XIB file. Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com> * chore: fix warning about shadowed variable CGFloat const difference was used twice in the same scope Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com> * chore: fix unused block parameter warnings Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com> * chore: disable GCC_WARN_64_TO_32_BIT_CONVERSION for libtransmission This warnings are not reported with CMake build. Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com> * chore: disable CLANG_WARN_STRICT_PROTOTYPES for dht This is third party target, warning is not enabled with CMake build. Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com> * chore: disable '-Wexit-time-destructors' warning with CMake. There are two cases when this is reported in libtransmission: 1. `log_state` in anonymous namespace in `log.cc`. 2. static inline `dh_pool_mutex` in `tr_handshake` in `handshake.h`. I don't see how this may be improved or how this affects correctness, so don't nag about that. Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com> --------- Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>
2024-03-15 05:16:26 +00:00
// This file Copyright © Transmission authors and contributors.
// It may be used under the MIT (SPDX: MIT) license.
// License text can be found in the licenses/ folder.
#import <Foundation/Foundation.h>
chore: fix warnings when compiling macOS client with either Xcode or CMake (#6676) * chore: fix CGFloat comparison warnings in macOS code. There are 2 cases: 1. Speed comparisons. The lowest significant value displayed in UI is 0.1 bytes per sec. See [NSString stringForSpeed] and [NSString stringForSpeedCompact]. 2. Ratio limit comparison. The lowest significant value displayed in UI is 0.01 (no unit). This is based on maximumFractionDigits=2 set in related XIB file. Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com> * chore: fix warning about shadowed variable CGFloat const difference was used twice in the same scope Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com> * chore: fix unused block parameter warnings Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com> * chore: disable GCC_WARN_64_TO_32_BIT_CONVERSION for libtransmission This warnings are not reported with CMake build. Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com> * chore: disable CLANG_WARN_STRICT_PROTOTYPES for dht This is third party target, warning is not enabled with CMake build. Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com> * chore: disable '-Wexit-time-destructors' warning with CMake. There are two cases when this is reported in libtransmission: 1. `log_state` in anonymous namespace in `log.cc`. 2. static inline `dh_pool_mutex` in `tr_handshake` in `handshake.h`. I don't see how this may be improved or how this affects correctness, so don't nag about that. Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com> --------- Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>
2024-03-15 05:16:26 +00:00
// 0.1 precision
chore: fix warnings when compiling macOS client with either Xcode or CMake (#6676) * chore: fix CGFloat comparison warnings in macOS code. There are 2 cases: 1. Speed comparisons. The lowest significant value displayed in UI is 0.1 bytes per sec. See [NSString stringForSpeed] and [NSString stringForSpeedCompact]. 2. Ratio limit comparison. The lowest significant value displayed in UI is 0.01 (no unit). This is based on maximumFractionDigits=2 set in related XIB file. Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com> * chore: fix warning about shadowed variable CGFloat const difference was used twice in the same scope Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com> * chore: fix unused block parameter warnings Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com> * chore: disable GCC_WARN_64_TO_32_BIT_CONVERSION for libtransmission This warnings are not reported with CMake build. Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com> * chore: disable CLANG_WARN_STRICT_PROTOTYPES for dht This is third party target, warning is not enabled with CMake build. Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com> * chore: disable '-Wexit-time-destructors' warning with CMake. There are two cases when this is reported in libtransmission: 1. `log_state` in anonymous namespace in `log.cc`. 2. static inline `dh_pool_mutex` in `tr_handshake` in `handshake.h`. I don't see how this may be improved or how this affects correctness, so don't nag about that. Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com> --------- Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>
2024-03-15 05:16:26 +00:00
bool isSpeedEqual(CGFloat old_speed, CGFloat new_speed);
// 0.01 precision
chore: fix warnings when compiling macOS client with either Xcode or CMake (#6676) * chore: fix CGFloat comparison warnings in macOS code. There are 2 cases: 1. Speed comparisons. The lowest significant value displayed in UI is 0.1 bytes per sec. See [NSString stringForSpeed] and [NSString stringForSpeedCompact]. 2. Ratio limit comparison. The lowest significant value displayed in UI is 0.01 (no unit). This is based on maximumFractionDigits=2 set in related XIB file. Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com> * chore: fix warning about shadowed variable CGFloat const difference was used twice in the same scope Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com> * chore: fix unused block parameter warnings Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com> * chore: disable GCC_WARN_64_TO_32_BIT_CONVERSION for libtransmission This warnings are not reported with CMake build. Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com> * chore: disable CLANG_WARN_STRICT_PROTOTYPES for dht This is third party target, warning is not enabled with CMake build. Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com> * chore: disable '-Wexit-time-destructors' warning with CMake. There are two cases when this is reported in libtransmission: 1. `log_state` in anonymous namespace in `log.cc`. 2. static inline `dh_pool_mutex` in `tr_handshake` in `handshake.h`. I don't see how this may be improved or how this affects correctness, so don't nag about that. Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com> --------- Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>
2024-03-15 05:16:26 +00:00
bool isRatioEqual(CGFloat old_ratio, CGFloat new_ratio);