Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Xcode warnings and demo bugs #756

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Demo/YYTextDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@
D94EE9831F37304200F37AD6 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0900;
LastUpgradeCheck = 0910;
ORGANIZATIONNAME = ibireme;
TargetAttributes = {
D94EE98A1F37304200F37AD6 = {
Expand Down Expand Up @@ -627,6 +627,8 @@
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
Expand Down Expand Up @@ -680,6 +682,8 @@
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
Expand Down
4 changes: 2 additions & 2 deletions Demo/YYTextDemo/UIView+YYAdd.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
@end


double YYDeviceSystemVersion();
double YYDeviceSystemVersion(void);

#ifndef kSystemVersion
#define kSystemVersion YYDeviceSystemVersion()
Expand All @@ -73,7 +73,7 @@ double YYDeviceSystemVersion();
#define kiOS9Later (kSystemVersion >= 9)
#endif

CGSize YYDeviceScreenSize();
CGSize YYDeviceScreenSize(void);


/// 屏幕宽度
Expand Down
2 changes: 1 addition & 1 deletion Demo/YYTextDemo/YYImage/YYAnimatedImageView.m
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ - (void)setCurrentAnimatedImageIndex:(NSUInteger)currentAnimatedImageIndex {
if (currentAnimatedImageIndex >= _curAnimatedImage.animatedImageFrameCount) return;
if (_curIndex == currentAnimatedImageIndex) return;

void (^block)() = ^{
void (^block)(void) = ^{
LOCK(
[_requestQueue cancelAllOperations];
[_buffer removeAllObjects];
Expand Down
8 changes: 4 additions & 4 deletions Demo/YYTextDemo/YYImage/YYImageCoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ typedef NS_ENUM(NSUInteger, YYImageBlendOperation) {

/**
Add an image from a file path to encoder.
@param image Image file path.
@param path Image file path.
@param duration Image duration for animation. Pass 0 to ignore this parameter.
*/
- (void)addImageWithFile:(NSString *)path duration:(NSTimeInterval)duration;
Expand Down Expand Up @@ -368,10 +368,10 @@ CG_EXTERN NSString *_Nullable YYImageTypeGetExtension(YYImageType type);


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

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

/// Returns whether a color space is DeviceRGB.
CG_EXTERN BOOL YYCGColorSpaceIsDeviceRGB(CGColorSpaceRef space);
Expand Down Expand Up @@ -446,7 +446,7 @@ CG_EXTERN CFDataRef _Nullable YYCGImageCreateEncodedData(CGImageRef imageRef, YY
/**
Whether WebP is available in YYImage.
*/
CG_EXTERN BOOL YYImageWebPAvailable();
CG_EXTERN BOOL YYImageWebPAvailable(void);

/**
Get a webp image frame count;
Expand Down
7 changes: 6 additions & 1 deletion Demo/YYTextDemo/YYTextAsyncExample.m
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,16 @@ - (void)viewDidLoad {


UIView *toolbar;
UIVisualEffectView *toolbarEffectView;
if ([UIVisualEffectView class]) {
toolbar = [[UIVisualEffectView alloc] initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleExtraLight]];
toolbarEffectView = [[UIVisualEffectView alloc] initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleExtraLight]];
toolbar = [UIView new];
[toolbarEffectView.contentView addSubview:toolbar];
} else {
toolbar = [UIToolbar new];
}


toolbar.size = CGSizeMake(kScreenWidth, 40);
toolbar.top = kiOS7Later ? 64 : 0;
[self.view addSubview:toolbar];
Expand Down
5 changes: 4 additions & 1 deletion Demo/YYTextDemo/YYTextEditExample.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,11 @@ - (void)viewDidLoad {
__weak typeof(self) _self = self;

UIView *toolbar;
UIVisualEffectView *toolbarEffectView;
if ([UIVisualEffectView class]) {
toolbar = [[UIVisualEffectView alloc] initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleExtraLight]];
toolbarEffectView = [[UIVisualEffectView alloc] initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleExtraLight]];
toolbar = [UIView new];
[toolbarEffectView.contentView addSubview:toolbar];
} else {
toolbar = [UIToolbar new];
}
Expand Down
2 changes: 1 addition & 1 deletion YYText/Utility/YYTextAsyncLayer.m
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ - (void)_displayAsync:(BOOL)async {
if (task.willDisplay) task.willDisplay(self);
_YYTextSentinel *sentinel = _sentinel;
int32_t value = sentinel.value;
BOOL (^isCancelled)() = ^BOOL() {
BOOL (^isCancelled)(void) = ^BOOL() {
return value != sentinel.value;
};
CGSize size = self.bounds.size;
Expand Down
12 changes: 6 additions & 6 deletions YYText/Utility/YYTextUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -233,13 +233,13 @@ static inline CGRect YYTextEmojiGetGlyphBoundingRectWithFontSize(CGFloat fontSiz
Get the character set which should rotate in vertical form.
@return The shared character set.
*/
NSCharacterSet *YYTextVerticalFormRotateCharacterSet();
NSCharacterSet *YYTextVerticalFormRotateCharacterSet(void);

/**
Get the character set which should rotate and move in vertical form.
@return The shared character set.
*/
NSCharacterSet *YYTextVerticalFormRotateAndMoveCharacterSet();
NSCharacterSet *YYTextVerticalFormRotateAndMoveCharacterSet(void);



Expand Down Expand Up @@ -364,10 +364,10 @@ static inline CGFloat YYTextCGPointGetDistanceToRect(CGPoint p, CGRect r) {


/// Get main screen's scale.
CGFloat YYTextScreenScale();
CGFloat YYTextScreenScale(void);

/// Get main screen's size. Height is always larger than width.
CGSize YYTextScreenSize();
CGSize YYTextScreenSize(void);

/// Convert point to pixel.
static inline CGFloat YYTextCGFloatToPixel(CGFloat value) {
Expand Down Expand Up @@ -555,9 +555,9 @@ static inline CFRange YYTextCFRangeFromNSRange(NSRange range) {


/// Returns YES in App Extension.
BOOL YYTextIsAppExtension();
BOOL YYTextIsAppExtension(void);

/// Returns nil in App Extension.
UIApplication * _Nullable YYTextSharedApplication();
UIApplication * _Nullable YYTextSharedApplication(void);

NS_ASSUME_NONNULL_END