ibireme / YYImage

Image framework for iOS to display/encode/decode animated WebP, APNG, GIF, and more.
MIT License
1.76k stars 479 forks source link

Fix compiler warnings on iOS #135

Closed HormyAJP closed 5 years ago

HormyAJP commented 5 years ago

We have strict compiler warnings set on our iOS project to keep code quality high. We hit one problem with YYImage:

❌  /Users/distiller/Library/Developer/Xcode/DerivedData/XXX-harsuoanjhotjgaokoqoxnxskwpq/Build/Products/UnitTest-iphonesimulator/YYImage/YYImage.framework/Headers/YYImageCoder.h:374:54: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]

CG_EXTERN CGColorSpaceRef YYCGColorSpaceGetDeviceGray();
                                                    ^
❌  /Users/distiller/Library/Developer/Xcode/DerivedData/XXX-harsuoanjhotjgaokoqoxnxskwpq/Build/Products/UnitTest-iphonesimulator/YYImage/YYImage.framework/Headers/YYImageCoder.h:449:36: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]

CG_EXTERN BOOL YYImageWebPAvailable();

The fix is pretty simple, just need to add void to these two declarations in YYImageCoder.h

/// Returns the shared DeviceRGB color space.
CG_EXTERN CGColorSpaceRef YYCGColorSpaceGetDeviceRGB(void);

/// Returns the shared DeviceGray color space.
CG_EXTERN CGColorSpaceRef YYCGColorSpaceGetDeviceGray(void);

Happy to create a PR if given permissions, otherwise would appreciate someone making the small change :+1: