[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 022d975e82b52e762d1bb21d980e6a27d442e6a5..bd3025cf5cbcc1589888e01433650fa722bfc4a7 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 535bf4e258d96d70227f1cd15bd968d4fdf97967..99f50d951d48774bcf1b617abe6fbba69bc48e31 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 d1233d3cefbea552f2d2e2c40b1e7465ab5092ea..dcd5c08f24f14f4a8c93894a6be6a2cd6de44a7e 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 8a623f0157eb4994c46f9063ca8ac2f43b85016a..f5697096665fd9f62acdc3517070e91f5beddd97 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 223e86986634f5b03cfa5efd5910b88f1f750a0e..90ad56fd6158cf46010b946f5a6536492d317934 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 2a9779095cf367b03bfb88e35fcbb81cf428b350..e492336cadbc96af4110ef491a04c9c3fdf973d0 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 b5f92a3afb025fd7cd6e6d9cbd639c96fcd97109..9eeac7629634fed92e3248c38d3a1f0633d16fc8 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 37d41f466bce0f740f9c67a9404ab27bc1c16570..5751fc6f15a14e1a6ae8d4fd401d31942623defd 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>();