You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ac...@apache.org on 2017/07/21 09:01:05 UTC

[03/16] incubator-weex git commit: * [ios] avoid compiler warnings

* [ios] avoid compiler warnings


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/6ed7f92d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/6ed7f92d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/6ed7f92d

Branch: refs/heads/0.15-dev
Commit: 6ed7f92d7f13476e85a750afffebcb427fe9e49e
Parents: 99cd3e0
Author: acton393 <zh...@gmail.com>
Authored: Wed Jun 21 19:24:43 2017 +0800
Committer: acton393 <zh...@gmail.com>
Committed: Wed Jun 21 19:24:43 2017 +0800

----------------------------------------------------------------------
 ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.h               | 2 +-
 ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m               | 5 ++---
 .../WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.h   | 3 ++-
 .../WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.m   | 5 ++++-
 .../Sources/Component/Recycler/WXSectionDataController.h       | 2 ++
 ios/sdk/WeexSDK/Sources/Component/WXCanvasComponent.h          | 2 +-
 ios/sdk/WeexSDK/Sources/Component/WXFooterComponent.h          | 2 +-
 ios/sdk/WeexSDK/Sources/Component/WXHeaderComponent.h          | 3 ++-
 ios/sdk/WeexSDK/Sources/Component/WXListComponent.m            | 6 +++---
 ios/sdk/WeexSDK/Sources/Controller/WXRootViewController.m      | 1 +
 ios/sdk/WeexSDK/Sources/Display/WXComponent+BoxShadow.h        | 4 ----
 ios/sdk/WeexSDK/Sources/Display/WXInnerLayer.h                 | 1 +
 ios/sdk/WeexSDK/Sources/Display/WXRoundedRect.h                | 2 +-
 ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m            | 1 +
 ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.h           | 3 +++
 ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.m           | 1 +
 ios/sdk/WeexSDK/Sources/Manager/WXServiceFactory.h             | 2 +-
 ios/sdk/WeexSDK/Sources/Model/WXComponent.m                    | 2 +-
 ios/sdk/WeexSDK/Sources/Model/WXJSExceptionInfo.m              | 1 +
 .../WeexSDK/Sources/View/WXComponent+PseudoClassManagement.h   | 4 ++--
 20 files changed, 31 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/6ed7f92d/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.h b/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.h
index 31ee3de..8ef129f 100644
--- a/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.h
+++ b/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.h
@@ -94,7 +94,7 @@
 
 /**
  *  Register Components Method
- *  @param components:   component list
+ *  @param components   component list
  **/
 - (void)registerComponents:(NSArray *)components;
 

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/6ed7f92d/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m b/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m
index 8b54377..ae0e3d6 100644
--- a/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m
+++ b/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m
@@ -20,7 +20,6 @@
 #import "WXBridgeContext.h"
 #import "WXBridgeProtocol.h"
 #import "WXJSCoreBridge.h"
-#import "WXDebugLoggerBridge.h"
 #import "WXLog.h"
 #import "WXUtility.h"
 #import "WXModuleFactory.h"
@@ -52,7 +51,7 @@ _Pragma("clang diagnostic pop") \
 @interface WXBridgeContext ()
 
 @property (nonatomic, strong) id<WXBridgeProtocol>  jsBridge;
-@property (nonatomic, strong) WXDebugLoggerBridge *devToolSocketBridge;
+@property (nonatomic, strong) id<WXBridgeProtocol> devToolSocketBridge;
 @property (nonatomic, assign) BOOL  debugJS;
 //store the methods which will be executed from native to js
 @property (nonatomic, strong) NSMutableDictionary   *sendQueue;
@@ -589,7 +588,7 @@ _Pragma("clang diagnostic pop") \
 
 - (void)connectToWebSocket:(NSURL *)url
 {
-    _devToolSocketBridge = [[WXDebugLoggerBridge alloc] initWithURL:url];
+    _devToolSocketBridge = [[NSClassFromString(@"WXDebugLoggerBridge") alloc] initWithURL:url];
 }
 
 - (void)logToWebSocket:(NSString *)flag message:(NSString *)message

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/6ed7f92d/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.h b/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.h
index a9c2539..5a25efd 100644
--- a/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.h
+++ b/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.h
@@ -16,7 +16,8 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-#import <WeexSDK/WeexSDK.h>
+
+#import "WXScrollerComponent.h"
 
 @interface WXRecyclerComponent : WXScrollerComponent
 

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/6ed7f92d/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.m b/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.m
index 8d266e0..c954e9f 100644
--- a/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.m
+++ b/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.m
@@ -28,6 +28,9 @@
 #import "WXCellComponent.h"
 #import "WXAssert.h"
 #import "WXConvert.h"
+#import "WXUtility.h"
+#import "WXMonitor.h"
+#import "NSObject+WXSwizzle.h"
 
 static NSString * const kCollectionCellReuseIdentifier = @"WXRecyclerCell";
 static NSString * const kCollectionHeaderReuseIdentifier = @"WXRecyclerHeader";
@@ -335,7 +338,7 @@ typedef enum : NSUInteger {
 {
     NSInteger numberOfItems = [self.dataController numberOfItemsInSection:section];
     
-    WXLogDebug(@"Number of items is %ld in section:%ld", numberOfItems, section);
+    WXLogDebug(@"Number of items is %ld in section:%ld", (long)numberOfItems, (long)section);
     
     return numberOfItems;
 }

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/6ed7f92d/ios/sdk/WeexSDK/Sources/Component/Recycler/WXSectionDataController.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/Recycler/WXSectionDataController.h b/ios/sdk/WeexSDK/Sources/Component/Recycler/WXSectionDataController.h
index 75cd4b1..c7986bb 100644
--- a/ios/sdk/WeexSDK/Sources/Component/Recycler/WXSectionDataController.h
+++ b/ios/sdk/WeexSDK/Sources/Component/Recycler/WXSectionDataController.h
@@ -19,6 +19,8 @@
 
 #import <Foundation/Foundation.h>
 #import "WXDiffUtil.h"
+#import <UIKit/UIKit.h>
+
 @class WXComponent;
 @class WXCellComponent;
 @class WXHeaderComponent;

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/6ed7f92d/ios/sdk/WeexSDK/Sources/Component/WXCanvasComponent.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXCanvasComponent.h b/ios/sdk/WeexSDK/Sources/Component/WXCanvasComponent.h
index c6f5121..fefdd40 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXCanvasComponent.h
+++ b/ios/sdk/WeexSDK/Sources/Component/WXCanvasComponent.h
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-#import <WeexSDK/WeexSDK.h>
+#import "WXComponent.h"
 #import "WXCanvasModule.h"
 #import <GLKit/GLKit.h>
 

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/6ed7f92d/ios/sdk/WeexSDK/Sources/Component/WXFooterComponent.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXFooterComponent.h b/ios/sdk/WeexSDK/Sources/Component/WXFooterComponent.h
index 903ddc2..a849493 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXFooterComponent.h
+++ b/ios/sdk/WeexSDK/Sources/Component/WXFooterComponent.h
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-#import <WeexSDK/WeexSDK.h>
+#import "WXComponent.h"
 
 @interface WXFooterComponent : WXComponent
 

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/6ed7f92d/ios/sdk/WeexSDK/Sources/Component/WXHeaderComponent.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXHeaderComponent.h b/ios/sdk/WeexSDK/Sources/Component/WXHeaderComponent.h
index 16a8451..8cfd567 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXHeaderComponent.h
+++ b/ios/sdk/WeexSDK/Sources/Component/WXHeaderComponent.h
@@ -17,7 +17,8 @@
  * under the License.
  */
 
-#import <WeexSDK/WeexSDK.h>
+#import "WXComponent.h"
+
 @class WXHeaderComponent;
 
 @protocol WXHeaderRenderDelegate <NSObject>

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/6ed7f92d/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m
index ddee4b3..3b14889 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m
+++ b/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m
@@ -287,7 +287,7 @@
                     
                     [_completedSections insertObject:completedInsertSection atIndex:insertIndex];
                     if (completedReloadSection) {
-                        WXLogDebug(@"Reload section:%lu", insertIndex - 1);
+                        WXLogDebug(@"Reload section:%lu", (unsigned long)(insertIndex - 1));
                         _completedSections[insertIndex - 1] = completedReloadSection;
                     }
                     
@@ -363,10 +363,10 @@
     BOOL keepScrollPosition = header.keepScrollPosition;
     
     [self.weexInstance.componentManager _addUITask:^{
-        WXLogDebug(@"delete section:%ld", deleteIndex);
+        WXLogDebug(@"delete section:%lu", (unsigned long)deleteIndex);
         [_completedSections removeObjectAtIndex:deleteIndex];
         if (completedReloadSection) {
-            WXLogDebug(@"Reload section:%ld", deleteIndex - 1);
+            WXLogDebug(@"Reload section:%ld", (long)(deleteIndex - 1));
             _completedSections[deleteIndex - 1] = completedReloadSection;
         }
         

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/6ed7f92d/ios/sdk/WeexSDK/Sources/Controller/WXRootViewController.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Controller/WXRootViewController.m b/ios/sdk/WeexSDK/Sources/Controller/WXRootViewController.m
index efe618d..44bcf83 100644
--- a/ios/sdk/WeexSDK/Sources/Controller/WXRootViewController.m
+++ b/ios/sdk/WeexSDK/Sources/Controller/WXRootViewController.m
@@ -20,6 +20,7 @@
 #import "WXRootViewController.h"
 #import "WXBaseViewController.h"
 #import "WXThreadSafeMutableArray.h"
+#import "WXDefine.h"
 
 typedef void(^OperationBlock)(void);
 

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/6ed7f92d/ios/sdk/WeexSDK/Sources/Display/WXComponent+BoxShadow.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Display/WXComponent+BoxShadow.h b/ios/sdk/WeexSDK/Sources/Display/WXComponent+BoxShadow.h
index 55ed6f6..04eb295 100644
--- a/ios/sdk/WeexSDK/Sources/Display/WXComponent+BoxShadow.h
+++ b/ios/sdk/WeexSDK/Sources/Display/WXComponent+BoxShadow.h
@@ -26,10 +26,6 @@
 /**
  *  @abstract compare boxshadow
  *
- *  @param boxShadow
- *
- *  @param view
- *
  *  @return if not equal return NO, if equal return YES
  */
 - (BOOL)equalBoxShadow:(WXBoxShadow *_Nullable)boxShadow withBoxShadow:(WXBoxShadow *_Nullable)compareBoxShadow;

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/6ed7f92d/ios/sdk/WeexSDK/Sources/Display/WXInnerLayer.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Display/WXInnerLayer.h b/ios/sdk/WeexSDK/Sources/Display/WXInnerLayer.h
index ee33656..2ff40df 100644
--- a/ios/sdk/WeexSDK/Sources/Display/WXInnerLayer.h
+++ b/ios/sdk/WeexSDK/Sources/Display/WXInnerLayer.h
@@ -19,6 +19,7 @@
 
 #import <Foundation/Foundation.h>
 #import <QuartzCore/QuartzCore.h>
+#import <UIKit/UIKit.h>
 
 @interface WXInnerLayer : CAGradientLayer
 

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/6ed7f92d/ios/sdk/WeexSDK/Sources/Display/WXRoundedRect.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Display/WXRoundedRect.h b/ios/sdk/WeexSDK/Sources/Display/WXRoundedRect.h
index 0efe73d..01c9911 100644
--- a/ios/sdk/WeexSDK/Sources/Display/WXRoundedRect.h
+++ b/ios/sdk/WeexSDK/Sources/Display/WXRoundedRect.h
@@ -19,7 +19,7 @@
 
 
 #import <Foundation/Foundation.h>
-
+#import <CoreGraphics/CoreGraphics.h>
 
 @interface WXRadii : NSObject
 

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/6ed7f92d/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m b/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m
index a6f1f0e..4ef989d 100644
--- a/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m
+++ b/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m
@@ -24,6 +24,7 @@
 #import "WXComponent_internal.h"
 #import "WXSDKInstance_private.h"
 #import "WXComponent+BoxShadow.h"
+#import "WXLayoutDefine.h"
 
 @implementation WXComponent (Layout)
 

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/6ed7f92d/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.h b/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.h
index 5414fa2..53c5a38 100644
--- a/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.h
+++ b/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.h
@@ -17,6 +17,9 @@
  * under the License.
  */
 
+#import <CoreGraphics/CoreGraphics.h>
+#import <Foundation/Foundation.h>
+
 @class WXBridgeMethod;
 @class WXSDKInstance;
 @class WXComponent;

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/6ed7f92d/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.m b/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.m
index 180d2b3..cfb37b2 100644
--- a/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.m
+++ b/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.m
@@ -34,6 +34,7 @@
 #import "WXHandlerFactory.h"
 #import "WXValidateProtocol.h"
 #import "WXPrerenderManager.h"
+#import "WXLayoutDefine.h"
 
 static NSThread *WXComponentThread;
 

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/6ed7f92d/ios/sdk/WeexSDK/Sources/Manager/WXServiceFactory.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Manager/WXServiceFactory.h b/ios/sdk/WeexSDK/Sources/Manager/WXServiceFactory.h
index d65ca31..c61c6b9 100644
--- a/ios/sdk/WeexSDK/Sources/Manager/WXServiceFactory.h
+++ b/ios/sdk/WeexSDK/Sources/Manager/WXServiceFactory.h
@@ -28,7 +28,7 @@
  *
  * @param options The service options to register
  *
- * @param code service js code to invoke
+ * @param serviceScript service js code to invoke
  *
  * @return script
  *

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/6ed7f92d/ios/sdk/WeexSDK/Sources/Model/WXComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Model/WXComponent.m b/ios/sdk/WeexSDK/Sources/Model/WXComponent.m
index 2a0bbd9..c022d67 100644
--- a/ios/sdk/WeexSDK/Sources/Model/WXComponent.m
+++ b/ios/sdk/WeexSDK/Sources/Model/WXComponent.m
@@ -365,7 +365,7 @@
 {
     WXAssert(subcomponent, @"The subcomponent to insert to %@ at index %d must not be nil", self, index);
     if (index > [_subcomponents count]) {
-        WXLogError(@"the index of inserted %ld is out of range as the current is %ld", index, [_subcomponents count]);
+        WXLogError(@"the index of inserted %ld is out of range as the current is %lu", (long)index, (unsigned long)[_subcomponents count]);
         return;
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/6ed7f92d/ios/sdk/WeexSDK/Sources/Model/WXJSExceptionInfo.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Model/WXJSExceptionInfo.m b/ios/sdk/WeexSDK/Sources/Model/WXJSExceptionInfo.m
index 3a6116d..84883c6 100644
--- a/ios/sdk/WeexSDK/Sources/Model/WXJSExceptionInfo.m
+++ b/ios/sdk/WeexSDK/Sources/Model/WXJSExceptionInfo.m
@@ -19,6 +19,7 @@
 
 #import "WXJSExceptionInfo.h"
 #import "WXAppConfiguration.h"
+#import "WXDefine.h"
 
 @implementation WXJSExceptionInfo
 

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/6ed7f92d/ios/sdk/WeexSDK/Sources/View/WXComponent+PseudoClassManagement.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/View/WXComponent+PseudoClassManagement.h b/ios/sdk/WeexSDK/Sources/View/WXComponent+PseudoClassManagement.h
index 5465ff4..f3b3adc 100644
--- a/ios/sdk/WeexSDK/Sources/View/WXComponent+PseudoClassManagement.h
+++ b/ios/sdk/WeexSDK/Sources/View/WXComponent+PseudoClassManagement.h
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-#import <WeexSDK/WeexSDK.h>
+#import "WXComponent.h"
 
 @interface WXComponent (PseudoClassManagement)
 
@@ -58,7 +58,7 @@
 /**
  * @abstract Called when component's style are updated
  *
- * @param styles The updated style dictionary
+ * @param pseudoClassStyles The updated style dictionary
  * @discussion It can be overrided to handle specific style updating. The method is called on the main thread.
  **/
 - (void)updatePseudoClassStyles:(NSDictionary *)pseudoClassStyles;