Skip to content

Commit

Permalink
chore(ios): eliminate some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
wwwcg committed May 14, 2024
1 parent 745c7cf commit 2213315
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion dom/src/dom/taitank_layout_node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ TAITANK_GET_STYLE_DECL(Direction, TaitankDirection, TaitankDirection::DIRECTION_
}

static void CheckValueType(footstone::value::HippyValue::Type type) {
if (type == footstone::value::HippyValue::Type::kNumber || type == footstone::value::HippyValue::Type::kObject)
if (type == footstone::value::HippyValue::Type::kString || type == footstone::value::HippyValue::Type::kObject)
FOOTSTONE_DLOG(WARNING) << "Taitank Layout Node Value Type Error";
}

Expand Down
5 changes: 3 additions & 2 deletions modules/footstone/include/footstone/logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ class LogMessage {
}
delegate_ = delegate;
}

inline static void LogWithFormat(const char * file, int line, const char *format, ...){
char *log_msg = NULL;
va_list args;
Expand All @@ -124,9 +125,9 @@ class LogMessage {
<<"[thread:"<<pthread_self()<<"], "<<log_msg<<std::endl;

if (LogMessage::delegate_) {
delegate_(s, TDF_LOG_WARNING);
delegate_(s, TDF_LOG_INFO);
} else {
default_delegate_(s, TDF_LOG_WARNING);
default_delegate_(s, TDF_LOG_INFO);
}

free(log_msg);
Expand Down
8 changes: 4 additions & 4 deletions renderer/native/ios/renderer/HippyComponent.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ typedef void (^HippyDirectEventBlock)(NSDictionary *body);
/// Inset
/// - Parameters:
/// - subview: id
/// - atIndex: NSInteger
- (void)insertHippySubview:(id<HippyComponent>)subview atIndex:(NSInteger)atIndex;
/// - atIndex: NSUInteger
- (void)insertHippySubview:(id<HippyComponent>)subview atIndex:(NSUInteger)atIndex;

/// Remove
/// - Parameter subview: id
Expand All @@ -62,8 +62,8 @@ typedef void (^HippyDirectEventBlock)(NSDictionary *body);
/// Move
/// - Parameters:
/// - subview: id
/// - atIndex: NSInteger
- (void)moveHippySubview:(id<HippyComponent>)subview toIndex:(NSInteger)atIndex;
/// - atIndex: NSUInteger
- (void)moveHippySubview:(id<HippyComponent>)subview toIndex:(NSUInteger)atIndex;

/// Remove from superview
- (void)removeFromHippySuperview;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ - (void)reloadData {
}
}

- (void)insertHippySubview:(UIView *)subview atIndex:(NSInteger)atIndex {
- (void)insertHippySubview:(UIView *)subview atIndex:(NSUInteger)atIndex {
if ([subview isKindOfClass:[HippyHeaderRefresh class]]) {
if (_headerRefreshView) {
[_headerRefreshView unsetFromScrollView];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ - (UIView *)createView:(HippyViewCreationBlock)creationBlock insertChildren:(Hip
return container;
}

- (void)insertHippySubview:(HippyShadowView *)subview atIndex:(NSInteger)atIndex {
- (void)insertHippySubview:(HippyShadowView *)subview atIndex:(NSUInteger)atIndex {
if (atIndex <= [_objectSubviews count]) {
[_objectSubviews insertObject:subview atIndex:atIndex];
}
Expand All @@ -190,7 +190,7 @@ - (void)insertHippySubview:(HippyShadowView *)subview atIndex:(NSInteger)atIndex
[self dirtyPropagation:NativeRenderUpdateLifecycleLayoutDirtied];
}

- (void)moveHippySubview:(id<HippyComponent>)subview toIndex:(NSInteger)atIndex {
- (void)moveHippySubview:(id<HippyComponent>)subview toIndex:(NSUInteger)atIndex {
if ([_objectSubviews containsObject:subview]) {
[_objectSubviews removeObject:subview];
}
Expand Down
7 changes: 3 additions & 4 deletions renderer/native/ios/renderer/component/view/UIView+Hippy.mm
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ - (void)setParent:(id<HippyComponent>)parent {
}
}

- (void)insertHippySubview:(UIView *)subview atIndex:(NSInteger)atIndex {
- (void)insertHippySubview:(UIView *)subview atIndex:(NSUInteger)atIndex {
// We access the associated object directly here in case someone overrides
// the `subcomponents` getter method and returns an immutable array.
if (nil == subview) {
Expand All @@ -172,14 +172,13 @@ - (void)insertHippySubview:(UIView *)subview atIndex:(NSInteger)atIndex {

if (atIndex <= [subviews count]) {
[subviews insertObject:subview atIndex:atIndex];
}
else {
} else {
[subviews addObject:subview];
}
subview.parent = self;
}

- (void)moveHippySubview:(UIView *)subview toIndex:(NSInteger)atIndex {
- (void)moveHippySubview:(UIView *)subview toIndex:(NSUInteger)atIndex {
if (nil == subview) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ - (void)didMoveToSuperview {

#pragma mark native render native methods

- (void)insertHippySubview:(UIView *)view atIndex:(NSInteger)atIndex {
- (void)insertHippySubview:(UIView *)view atIndex:(NSUInteger)atIndex {
if (atIndex > self.viewPagerItems.count) {
HippyLogWarn(@"Error In HippyViewPager: addSubview —— out of bound of array");
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ - (WaterfallItemChangeContext *)itemChangeContext {
return _itemChangeContext;
}

- (void)insertHippySubview:(HippyShadowView *)subview atIndex:(NSInteger)atIndex {
- (void)insertHippySubview:(HippyShadowView *)subview atIndex:(NSUInteger)atIndex {
[super insertHippySubview:subview atIndex:atIndex];
if ([subview isKindOfClass:[HippyShadowWaterfallItem class]]) {
HippyShadowWaterfallItem *objectItem = (HippyShadowWaterfallItem *)subview;
Expand All @@ -168,7 +168,7 @@ - (void)removeHippySubview:(HippyShadowView *)subview {
[_itemChangeContext appendDeletedItem:subview];
}

- (void)moveHippySubview:(id<HippyComponent>)subview toIndex:(NSInteger)atIndex {
- (void)moveHippySubview:(id<HippyComponent>)subview toIndex:(NSUInteger)atIndex {
[super moveHippySubview:subview toIndex:atIndex];
[_itemChangeContext appendMovedItem:subview];
}
Expand Down

0 comments on commit 2213315

Please sign in to comment.