Merge pull request #1984 from dreampiggy/fix_unreachable_code
Fix unreachable code build warning on macOS
This commit is contained in:
commit
4cfb2e4b9f
|
@ -21,7 +21,7 @@
|
|||
|
||||
#if SD_MAC
|
||||
return [[UIImage alloc] initWithData:data];
|
||||
#endif
|
||||
#else
|
||||
|
||||
CGImageSourceRef source = CGImageSourceCreateWithData((__bridge CFDataRef)data, NULL);
|
||||
|
||||
|
@ -53,6 +53,7 @@
|
|||
CFRelease(source);
|
||||
|
||||
return staticImage;
|
||||
#endif
|
||||
}
|
||||
|
||||
- (BOOL)isGIF {
|
||||
|
|
|
@ -60,8 +60,8 @@ static void FreeImageData(void *info, const void *data, size_t size) {
|
|||
|
||||
#if SD_UIKIT || SD_WATCH
|
||||
int loopCount = WebPDemuxGetI(demuxer, WEBP_FF_LOOP_COUNT);
|
||||
#endif
|
||||
int frameCount = WebPDemuxGetI(demuxer, WEBP_FF_FRAME_COUNT);
|
||||
#endif
|
||||
int canvasWidth = WebPDemuxGetI(demuxer, WEBP_FF_CANVAS_WIDTH);
|
||||
int canvasHeight = WebPDemuxGetI(demuxer, WEBP_FF_CANVAS_HEIGHT);
|
||||
CGBitmapInfo bitmapInfo;
|
||||
|
@ -78,8 +78,10 @@ static void FreeImageData(void *info, const void *data, size_t size) {
|
|||
}
|
||||
|
||||
NSMutableArray<UIImage *> *images = [NSMutableArray array];
|
||||
#if SD_UIKIT || SD_WATCH
|
||||
NSTimeInterval totalDuration = 0;
|
||||
int durations[frameCount];
|
||||
#endif
|
||||
|
||||
do {
|
||||
UIImage *image;
|
||||
|
@ -97,7 +99,7 @@ static void FreeImageData(void *info, const void *data, size_t size) {
|
|||
|
||||
#if SD_MAC
|
||||
break;
|
||||
#endif
|
||||
#else
|
||||
|
||||
int duration = iter.duration;
|
||||
if (duration <= 10) {
|
||||
|
@ -108,7 +110,7 @@ static void FreeImageData(void *info, const void *data, size_t size) {
|
|||
totalDuration += duration;
|
||||
size_t count = images.count;
|
||||
durations[count - 1] = duration;
|
||||
|
||||
#endif
|
||||
} while (WebPDemuxNextFrame(&iter));
|
||||
|
||||
WebPDemuxReleaseIterator(&iter);
|
||||
|
|
Loading…
Reference in New Issue