[NUI] Fix some SVACE issues.
authorzhouhao02 <haozhou.zhou@samsung.com>
Wed, 27 Sep 2023 03:03:30 +0000 (11:03 +0800)
committerEunki Hong <h.pichulia@gmail.com>
Wed, 25 Oct 2023 12:48:44 +0000 (21:48 +0900)
src/Tizen.NUI.Gadget/Tizen.NUI/NUIGadgetManager.cs
src/Tizen.NUI.Physics2D/src/public/chipmunk/BoundingBox.cs
src/Tizen.NUI.Physics2D/src/public/chipmunk/ContactPoint.cs
src/Tizen.NUI.Physics2D/src/public/chipmunk/ContactPointSet.cs
src/Tizen.NUI.Physics2D/src/public/chipmunk/DebugColor.cs
src/Tizen.NUI.Physics2D/src/public/chipmunk/SegmentQueryInfo.cs
src/Tizen.NUI.Physics2D/src/public/chipmunk/Transform.cs
src/Tizen.NUI/src/public/ParticleSystem/ParticleEmitter.cs

index 022d975..bd3025c 100755 (executable)
@@ -346,8 +346,9 @@ namespace Tizen.NUI
 
         internal static bool HandleAppControl(AppControlReceivedEventArgs args)
         {
-            if (!args.ReceivedAppControl.ExtraData.TryGet("__K_GADGET_RES_TYPE", out string resourceType) ||
-                !args.ReceivedAppControl.ExtraData.TryGet("__K_GADGET_CLASS_NAME", out string className))
+            var extraData = args.ReceivedAppControl?.ExtraData;
+            if (extraData == null||!extraData.TryGet("__K_GADGET_RES_TYPE", out string resourceType) ||
+                !extraData.TryGet("__K_GADGET_CLASS_NAME", out string className))
             {
                 return false;
             }
index 535bf4e..99f50d9 100644 (file)
@@ -111,16 +111,19 @@ namespace Tizen.NUI.Physics2D.Chipmunk
         [EditorBrowsable(EditorBrowsableState.Never)]
         public override int GetHashCode()
         {
-            var hashCode = -1064806749;
+            unchecked
+            {
+                var hashCode = -1064806749;
 
 #pragma warning disable RECS0025 // Non-readonly field referenced in 'GetHashCode()'
-            hashCode = hashCode * -1521134295 + left.GetHashCode();
-            hashCode = hashCode * -1521134295 + bottom.GetHashCode();
-            hashCode = hashCode * -1521134295 + right.GetHashCode();
-            hashCode = hashCode * -1521134295 + top.GetHashCode();
+                hashCode = hashCode * -1521134295 + left.GetHashCode();
+                hashCode = hashCode * -1521134295 + bottom.GetHashCode();
+                hashCode = hashCode * -1521134295 + right.GetHashCode();
+                hashCode = hashCode * -1521134295 + top.GetHashCode();
 #pragma warning restore RECS0025 // Non-readonly field referenced in 'GetHashCode()'
 
-            return hashCode;
+                return hashCode;
+            }
         }
 
         /// <summary>
index d1233d3..dcd5c08 100644 (file)
@@ -108,13 +108,16 @@ namespace Tizen.NUI.Physics2D.Chipmunk
         [EditorBrowsable(EditorBrowsableState.Never)]
         public override int GetHashCode()
         {
-            var hashCode = -1285340573;
+            unchecked
+            {
+                var hashCode = -1285340573;
 
-            hashCode = hashCode * -1521134295 + pointA.GetHashCode();
-            hashCode = hashCode * -1521134295 + pointB.GetHashCode();
-            hashCode = hashCode * -1521134295 + distance.GetHashCode();
+                hashCode = hashCode * -1521134295 + pointA.GetHashCode();
+                hashCode = hashCode * -1521134295 + pointB.GetHashCode();
+                hashCode = hashCode * -1521134295 + distance.GetHashCode();
 
-            return hashCode;
+                return hashCode;
+            }
         }
 
         /// <summary>
index 8a623f0..f569709 100644 (file)
@@ -88,13 +88,16 @@ namespace Tizen.NUI.Physics2D.Chipmunk
         [EditorBrowsable(EditorBrowsableState.Never)]
         public override int GetHashCode()
         {
-            var hashCode = -475635172;
+            unchecked
+            {
+                var hashCode = -475635172;
 
-            hashCode = hashCode * -1521134295 + count.GetHashCode();
-            hashCode = hashCode * -1521134295 + normal.GetHashCode();
-            hashCode = hashCode * -1521134295 + EqualityComparer<ContactPoint[]>.Default.GetHashCode(points);
+                hashCode = hashCode * -1521134295 + count.GetHashCode();
+                hashCode = hashCode * -1521134295 + normal.GetHashCode();
+                hashCode = hashCode * -1521134295 + EqualityComparer<ContactPoint[]>.Default.GetHashCode(points);
 
-            return hashCode;
+                return hashCode;
+            }
         }
 
         /// <summary>
index 223e869..90ad56f 100644 (file)
@@ -114,14 +114,17 @@ namespace Tizen.NUI.Physics2D.Chipmunk
         [EditorBrowsable(EditorBrowsableState.Never)]
         public override int GetHashCode()
         {
-            var hashCode = -1813971818;
+            unchecked
+            {
+                var hashCode = -1813971818;
 
-            hashCode = hashCode * -1521134295 + red.GetHashCode();
-            hashCode = hashCode * -1521134295 + green.GetHashCode();
-            hashCode = hashCode * -1521134295 + blue.GetHashCode();
-            hashCode = hashCode * -1521134295 + alpha.GetHashCode();
+                hashCode = hashCode * -1521134295 + red.GetHashCode();
+                hashCode = hashCode * -1521134295 + green.GetHashCode();
+                hashCode = hashCode * -1521134295 + blue.GetHashCode();
+                hashCode = hashCode * -1521134295 + alpha.GetHashCode();
 
-            return hashCode;
+                return hashCode;
+            }
         }
 
         /// <summary>
index 2a97790..e492336 100644 (file)
@@ -167,12 +167,15 @@ namespace Tizen.NUI.Physics2D.Chipmunk
         [EditorBrowsable(EditorBrowsableState.Never)]
         public override int GetHashCode()
         {
-            var hashCode = -1275187100;
-            hashCode = hashCode * -1521134295 + shape.GetHashCode();
-            hashCode = hashCode * -1521134295 + point.GetHashCode();
-            hashCode = hashCode * -1521134295 + normal.GetHashCode();
-            hashCode = hashCode * -1521134295 + alpha.GetHashCode();
-            return hashCode;
+            unchecked
+            {
+                var hashCode = -1275187100;
+                hashCode = hashCode * -1521134295 + shape.GetHashCode();
+                hashCode = hashCode * -1521134295 + point.GetHashCode();
+                hashCode = hashCode * -1521134295 + normal.GetHashCode();
+                hashCode = hashCode * -1521134295 + alpha.GetHashCode();
+                return hashCode;
+            }
         }
     }
 }
index b5f92a3..9eeac76 100644 (file)
@@ -156,16 +156,19 @@ namespace Tizen.NUI.Physics2D.Chipmunk
         [EditorBrowsable(EditorBrowsableState.Never)]
         public override int GetHashCode()
         {
-            var hashCode = -884009331;
+            unchecked
+            {
+                var hashCode = -884009331;
 #pragma warning disable RECS0025 // Non-readonly field referenced in 'GetHashCode()'
-            hashCode = hashCode * -1521134295 + a.GetHashCode();
-            hashCode = hashCode * -1521134295 + b.GetHashCode();
-            hashCode = hashCode * -1521134295 + c.GetHashCode();
-            hashCode = hashCode * -1521134295 + d.GetHashCode();
-            hashCode = hashCode * -1521134295 + tx.GetHashCode();
-            hashCode = hashCode * -1521134295 + ty.GetHashCode();
+                hashCode = hashCode * -1521134295 + a.GetHashCode();
+                hashCode = hashCode * -1521134295 + b.GetHashCode();
+                hashCode = hashCode * -1521134295 + c.GetHashCode();
+                hashCode = hashCode * -1521134295 + d.GetHashCode();
+                hashCode = hashCode * -1521134295 + tx.GetHashCode();
+                hashCode = hashCode * -1521134295 + ty.GetHashCode();
 #pragma warning restore RECS0025 // Non-readonly field referenced in 'GetHashCode()'
-            return hashCode;
+                return hashCode;
+            }
         }
 
         /// <summary>
index 37d41f4..5751fc6 100644 (file)
@@ -568,13 +568,16 @@ namespace Tizen.NUI.ParticleSystem
         
         internal T Get(IntPtr cPtr)
         {
-            var result = mBasePtr.FindIndex(0, x => x == cPtr );
-            if (result >= 0)
+            lock (mBasePtr)
             {
-                return mInterfaces[result];
-            }
+                var result = mBasePtr.FindIndex(0, x => x == cPtr);
+                if (result >= 0)
+                {
+                    return mInterfaces[result];
+                }
 
-            return null;
+                return null;
+            }
         }
         
         private List<IntPtr> mBasePtr = new List<IntPtr>();