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
|
#if SD_MAC
|
||||||
return [[UIImage alloc] initWithData:data];
|
return [[UIImage alloc] initWithData:data];
|
||||||
#endif
|
#else
|
||||||
|
|
||||||
CGImageSourceRef source = CGImageSourceCreateWithData((__bridge CFDataRef)data, NULL);
|
CGImageSourceRef source = CGImageSourceCreateWithData((__bridge CFDataRef)data, NULL);
|
||||||
|
|
||||||
|
@ -53,6 +53,7 @@
|
||||||
CFRelease(source);
|
CFRelease(source);
|
||||||
|
|
||||||
return staticImage;
|
return staticImage;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)isGIF {
|
- (BOOL)isGIF {
|
||||||
|
|
|
@ -60,8 +60,8 @@ static void FreeImageData(void *info, const void *data, size_t size) {
|
||||||
|
|
||||||
#if SD_UIKIT || SD_WATCH
|
#if SD_UIKIT || SD_WATCH
|
||||||
int loopCount = WebPDemuxGetI(demuxer, WEBP_FF_LOOP_COUNT);
|
int loopCount = WebPDemuxGetI(demuxer, WEBP_FF_LOOP_COUNT);
|
||||||
#endif
|
|
||||||
int frameCount = WebPDemuxGetI(demuxer, WEBP_FF_FRAME_COUNT);
|
int frameCount = WebPDemuxGetI(demuxer, WEBP_FF_FRAME_COUNT);
|
||||||
|
#endif
|
||||||
int canvasWidth = WebPDemuxGetI(demuxer, WEBP_FF_CANVAS_WIDTH);
|
int canvasWidth = WebPDemuxGetI(demuxer, WEBP_FF_CANVAS_WIDTH);
|
||||||
int canvasHeight = WebPDemuxGetI(demuxer, WEBP_FF_CANVAS_HEIGHT);
|
int canvasHeight = WebPDemuxGetI(demuxer, WEBP_FF_CANVAS_HEIGHT);
|
||||||
CGBitmapInfo bitmapInfo;
|
CGBitmapInfo bitmapInfo;
|
||||||
|
@ -78,8 +78,10 @@ static void FreeImageData(void *info, const void *data, size_t size) {
|
||||||
}
|
}
|
||||||
|
|
||||||
NSMutableArray<UIImage *> *images = [NSMutableArray array];
|
NSMutableArray<UIImage *> *images = [NSMutableArray array];
|
||||||
|
#if SD_UIKIT || SD_WATCH
|
||||||
NSTimeInterval totalDuration = 0;
|
NSTimeInterval totalDuration = 0;
|
||||||
int durations[frameCount];
|
int durations[frameCount];
|
||||||
|
#endif
|
||||||
|
|
||||||
do {
|
do {
|
||||||
UIImage *image;
|
UIImage *image;
|
||||||
|
@ -97,7 +99,7 @@ static void FreeImageData(void *info, const void *data, size_t size) {
|
||||||
|
|
||||||
#if SD_MAC
|
#if SD_MAC
|
||||||
break;
|
break;
|
||||||
#endif
|
#else
|
||||||
|
|
||||||
int duration = iter.duration;
|
int duration = iter.duration;
|
||||||
if (duration <= 10) {
|
if (duration <= 10) {
|
||||||
|
@ -108,7 +110,7 @@ static void FreeImageData(void *info, const void *data, size_t size) {
|
||||||
totalDuration += duration;
|
totalDuration += duration;
|
||||||
size_t count = images.count;
|
size_t count = images.count;
|
||||||
durations[count - 1] = duration;
|
durations[count - 1] = duration;
|
||||||
|
#endif
|
||||||
} while (WebPDemuxNextFrame(&iter));
|
} while (WebPDemuxNextFrame(&iter));
|
||||||
|
|
||||||
WebPDemuxReleaseIterator(&iter);
|
WebPDemuxReleaseIterator(&iter);
|
||||||
|
|
Loading…
Reference in New Issue