Remove build warning for use of deprecated API
authorDongsun Lee <ds73.lee@samsung.com>
Fri, 21 Oct 2016 04:13:16 +0000 (13:13 +0900)
committerkidong kim <kd0228.kim@samsung.com>
Fri, 21 Oct 2016 05:40:41 +0000 (14:40 +0900)
- Marshal.PtrToStructure(ptr, type) --> Marshal.PtrToStructure<T>(ptr)

Change-Id: I2543a61091ab50d2d31b529f8977e43a894419bf
Signed-off-by: Dongsun Lee <ds73.lee@samsung.com>
src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Certificate.cs [changed mode: 0644->0755]
src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Key.cs [changed mode: 0644->0755]
src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Pkcs12.cs [changed mode: 0644->0755]
src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/SafeAliasListHandle.cs [changed mode: 0644->0755]
src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/SafeCertificateListHandle.cs [changed mode: 0644->0755]
src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/SafeRawBufferHandle.cs [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 8e96852..91236c1
@@ -57,7 +57,7 @@ namespace Tizen.Security.SecureRepository
         {
             base.SetHandle(ptrCkmcCert);
 
-            CkmcCert ckmcCert = (CkmcCert)Marshal.PtrToStructure(ptrCkmcCert, typeof(CkmcCert));
+            CkmcCert ckmcCert = Marshal.PtrToStructure<CkmcCert>(ptrCkmcCert);
             Binary = new byte[ckmcCert.size];
             Marshal.Copy(ckmcCert.rawCert, Binary, 0, Binary.Length);
             Format = (DataFormat)ckmcCert.dataFormat;
old mode 100644 (file)
new mode 100755 (executable)
index 6e6ebdf..c64b32b
@@ -43,7 +43,7 @@ namespace Tizen.Security.SecureRepository
         {
             base.SetHandle(ptr);
 
-            CkmcKey ckmcKey = (CkmcKey)Marshal.PtrToStructure(handle, typeof(CkmcKey));
+            CkmcKey ckmcKey = Marshal.PtrToStructure<CkmcKey>(handle);
             Binary = new byte[ckmcKey.size];
             Marshal.Copy(ckmcKey.rawKey, Binary, 0, Binary.Length);
             Type = (KeyType)ckmcKey.keyType;
old mode 100644 (file)
new mode 100755 (executable)
index 7fc49ee..e682c65
@@ -82,7 +82,7 @@ namespace Tizen.Security.SecureRepository
         {
             this.SetHandle(ptrCkmcPkcs12);
 
-            CkmcPkcs12 ckmcPkcs12 = (CkmcPkcs12)Marshal.PtrToStructure(handle, typeof(CkmcPkcs12));
+            CkmcPkcs12 ckmcPkcs12 = Marshal.PtrToStructure<CkmcPkcs12>(handle);
             this.PrivateKey = new Key(ckmcPkcs12.privateKey, false);
             if (ckmcPkcs12.certificate != IntPtr.Zero)
                 this.Certificate = new Certificate(ckmcPkcs12.certificate, false);
old mode 100644 (file)
new mode 100755 (executable)
index 8da2127..d7a5005
@@ -30,7 +30,7 @@ namespace Tizen.Security.SecureRepository
             List<string> aliases = new List<string>();
             while (ptrAliases != IntPtr.Zero)
             {
-                CkmcAliasList ckmcAliasList = (CkmcAliasList)Marshal.PtrToStructure(ptrAliases, typeof(CkmcAliasList));
+                CkmcAliasList ckmcAliasList = Marshal.PtrToStructure<CkmcAliasList>(ptrAliases);
                 aliases.Add(Marshal.PtrToStringAnsi(ckmcAliasList.alias));
                 ptrAliases = ckmcAliasList.next;
             }
old mode 100644 (file)
new mode 100755 (executable)
index b0be5e9..9f87d46
@@ -39,7 +39,7 @@ namespace Tizen.Security.SecureRepository
             IntPtr ptrCurr = handle;
             while (ptrCurr != IntPtr.Zero)
             {
-                CkmcCertList ckmcCertList = (CkmcCertList)Marshal.PtrToStructure(ptrCurr, typeof(CkmcCertList));
+                CkmcCertList ckmcCertList = Marshal.PtrToStructure<CkmcCertList>(ptrCurr);
                 certs.Add(new Certificate(ckmcCertList.cert, false));
                 ptrCurr = ckmcCertList.next;
             }
old mode 100644 (file)
new mode 100755 (executable)
index 4e4ba5a..54d383b
@@ -29,7 +29,7 @@ namespace Tizen.Security.SecureRepository
             if (ptrRawBuffer == IntPtr.Zero)
                 return;
 
-            CkmcRawBuffer buff = (CkmcRawBuffer)Marshal.PtrToStructure(ptrRawBuffer, typeof(CkmcRawBuffer));
+            CkmcRawBuffer buff = Marshal.PtrToStructure<CkmcRawBuffer>(ptrRawBuffer);
             byte[] data = new byte[buff.size];
             Marshal.Copy(buff.data, data, 0, data.Length);