Merge pull request #2860 from dreampiggy/fix_warnings
Fix warnings when deployment target version set to iOS 13+
This commit is contained in:
commit
1254de0756
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
#if SD_MAC
|
#if SD_MAC
|
||||||
#import <CoreVideo/CoreVideo.h>
|
#import <CoreVideo/CoreVideo.h>
|
||||||
static CVReturn renderCallback(CVDisplayLinkRef displayLink, const CVTimeStamp *inNow, const CVTimeStamp *inOutputTime, CVOptionFlags flagsIn, CVOptionFlags *flagsOut, void *displayLinkContext);
|
static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeStamp *inNow, const CVTimeStamp *inOutputTime, CVOptionFlags flagsIn, CVOptionFlags *flagsOut, void *displayLinkContext);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static NSUInteger SDDeviceTotalMemory() {
|
static NSUInteger SDDeviceTotalMemory() {
|
||||||
|
@ -314,7 +314,7 @@ static NSUInteger SDDeviceFreeMemory() {
|
||||||
if (error) {
|
if (error) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
CVDisplayLinkSetOutputCallback(_displayLink, renderCallback, (__bridge void *)self);
|
CVDisplayLinkSetOutputCallback(_displayLink, DisplayLinkCallback, (__bridge void *)self);
|
||||||
}
|
}
|
||||||
return _displayLink;
|
return _displayLink;
|
||||||
}
|
}
|
||||||
|
@ -580,7 +580,7 @@ static NSUInteger SDDeviceFreeMemory() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#if SD_MAC
|
#if SD_MAC
|
||||||
- (void)displayDidRefresh:(CVDisplayLinkRef)displayLink duration:(NSTimeInterval)duration
|
- (void)displayDidRefresh:(CVDisplayLinkRef)displayLink
|
||||||
#else
|
#else
|
||||||
- (void)displayDidRefresh:(CADisplayLink *)displayLink
|
- (void)displayDidRefresh:(CADisplayLink *)displayLink
|
||||||
#endif
|
#endif
|
||||||
|
@ -590,9 +590,16 @@ static NSUInteger SDDeviceFreeMemory() {
|
||||||
if (!self.shouldAnimate) {
|
if (!self.shouldAnimate) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// Calculate refresh duration
|
||||||
#if SD_UIKIT
|
#if SD_MAC
|
||||||
|
CVTimeStamp nowTime;
|
||||||
|
CVDisplayLinkGetCurrentTime(displayLink, &nowTime);
|
||||||
|
NSTimeInterval duration = (double)nowTime.videoRefreshPeriod / ((double)nowTime.videoTimeScale * nowTime.rateScalar);
|
||||||
|
#else
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||||
NSTimeInterval duration = displayLink.duration * displayLink.frameInterval;
|
NSTimeInterval duration = displayLink.duration * displayLink.frameInterval;
|
||||||
|
#pragma clang diagnostic pop
|
||||||
#endif
|
#endif
|
||||||
NSUInteger totalFrameCount = self.totalFrameCount;
|
NSUInteger totalFrameCount = self.totalFrameCount;
|
||||||
NSUInteger currentFrameIndex = self.currentFrameIndex;
|
NSUInteger currentFrameIndex = self.currentFrameIndex;
|
||||||
|
@ -785,14 +792,12 @@ static NSUInteger SDDeviceFreeMemory() {
|
||||||
@end
|
@end
|
||||||
|
|
||||||
#if SD_MAC
|
#if SD_MAC
|
||||||
static CVReturn renderCallback(CVDisplayLinkRef displayLink, const CVTimeStamp *inNow, const CVTimeStamp *inOutputTime, CVOptionFlags flagsIn, CVOptionFlags *flagsOut, void *displayLinkContext) {
|
static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeStamp *inNow, const CVTimeStamp *inOutputTime, CVOptionFlags flagsIn, CVOptionFlags *flagsOut, void *displayLinkContext) {
|
||||||
// Calculate refresh duration
|
|
||||||
NSTimeInterval duration = (double)inOutputTime->videoRefreshPeriod / ((double)inOutputTime->videoTimeScale * inOutputTime->rateScalar);
|
|
||||||
// CVDisplayLink callback is not on main queue
|
// CVDisplayLink callback is not on main queue
|
||||||
SDAnimatedImageView *imageView = (__bridge SDAnimatedImageView *)displayLinkContext;
|
SDAnimatedImageView *imageView = (__bridge SDAnimatedImageView *)displayLinkContext;
|
||||||
__weak SDAnimatedImageView *weakImageView = imageView;
|
__weak SDAnimatedImageView *weakImageView = imageView;
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
[weakImageView displayDidRefresh:displayLink duration:duration];
|
[weakImageView displayDidRefresh:displayLink];
|
||||||
});
|
});
|
||||||
return kCVReturnSuccess;
|
return kCVReturnSuccess;
|
||||||
}
|
}
|
||||||
|
|
|
@ -269,6 +269,8 @@
|
||||||
|
|
||||||
#define SD_MAX_FILE_EXTENSION_LENGTH (NAME_MAX - CC_MD5_DIGEST_LENGTH * 2 - 1)
|
#define SD_MAX_FILE_EXTENSION_LENGTH (NAME_MAX - CC_MD5_DIGEST_LENGTH * 2 - 1)
|
||||||
|
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||||
static inline NSString * _Nonnull SDDiskCacheFileNameForKey(NSString * _Nullable key) {
|
static inline NSString * _Nonnull SDDiskCacheFileNameForKey(NSString * _Nullable key) {
|
||||||
const char *str = key.UTF8String;
|
const char *str = key.UTF8String;
|
||||||
if (str == NULL) {
|
if (str == NULL) {
|
||||||
|
@ -287,5 +289,6 @@ static inline NSString * _Nonnull SDDiskCacheFileNameForKey(NSString * _Nullable
|
||||||
r[11], r[12], r[13], r[14], r[15], ext.length == 0 ? @"" : [NSString stringWithFormat:@".%@", ext]];
|
r[11], r[12], r[13], r[14], r[15], ext.length == 0 ? @"" : [NSString stringWithFormat:@".%@", ext]];
|
||||||
return filename;
|
return filename;
|
||||||
}
|
}
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -47,10 +47,13 @@ static NSInteger UIActivityIndicatorViewStyleLarge = 101;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if SD_UIKIT
|
#if SD_UIKIT
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||||
- (void)commonInit {
|
- (void)commonInit {
|
||||||
self.indicatorView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
|
self.indicatorView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
|
||||||
self.indicatorView.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleBottomMargin;
|
self.indicatorView.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleBottomMargin;
|
||||||
}
|
}
|
||||||
|
#pragma clang diagnostic pop
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if SD_MAC
|
#if SD_MAC
|
||||||
|
@ -85,6 +88,8 @@ static NSInteger UIActivityIndicatorViewStyleLarge = 101;
|
||||||
|
|
||||||
@implementation SDWebImageActivityIndicator (Conveniences)
|
@implementation SDWebImageActivityIndicator (Conveniences)
|
||||||
|
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||||
+ (SDWebImageActivityIndicator *)grayIndicator {
|
+ (SDWebImageActivityIndicator *)grayIndicator {
|
||||||
SDWebImageActivityIndicator *indicator = [SDWebImageActivityIndicator new];
|
SDWebImageActivityIndicator *indicator = [SDWebImageActivityIndicator new];
|
||||||
#if SD_UIKIT
|
#if SD_UIKIT
|
||||||
|
@ -168,6 +173,7 @@ static NSInteger UIActivityIndicatorViewStyleLarge = 101;
|
||||||
#endif
|
#endif
|
||||||
return indicator;
|
return indicator;
|
||||||
}
|
}
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue