From df751f87ceb8d2e99700b967b141e8e0dc6ce28c Mon Sep 17 00:00:00 2001 From: Bertrand Lorentz Date: Sun, 4 Nov 2012 16:43:35 +0100 Subject: [PATCH] glib: Switch to generic collections in Marshaller and ValueArray --- glib/Marshaller.cs | 5 +++-- glib/ValueArray.cs | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/glib/Marshaller.cs b/glib/Marshaller.cs index 457beed45..d28d57e9b 100644 --- a/glib/Marshaller.cs +++ b/glib/Marshaller.cs @@ -23,6 +23,7 @@ namespace GLib { using System; + using System.Collections.Generic; using System.Runtime.InteropServices; public class Marshaller { @@ -202,7 +203,7 @@ namespace GLib { return new string [0]; int count = 0; - System.Collections.ArrayList result = new System.Collections.ArrayList (); + var result = new List (); IntPtr s = Marshal.ReadIntPtr (null_term_array, count++ * IntPtr.Size); while (s != IntPtr.Zero) { result.Add (Utf8PtrToString (s)); @@ -212,7 +213,7 @@ namespace GLib { if (owned) g_strfreev (null_term_array); - return (string[]) result.ToArray (typeof(string)); + return result.ToArray (); } public static string[] PtrToStringArrayGFree (IntPtr string_array) diff --git a/glib/ValueArray.cs b/glib/ValueArray.cs index 4f42cb5f7..6483c9bef 100644 --- a/glib/ValueArray.cs +++ b/glib/ValueArray.cs @@ -23,13 +23,14 @@ namespace GLib { using System; using System.Collections; + using System.Collections.Generic; using System.Runtime.InteropServices; public class ValueArray : IDisposable, ICollection, ICloneable, IWrapper { private IntPtr handle = IntPtr.Zero; - static private ArrayList PendingFrees = new ArrayList (); + static private IList PendingFrees = new List (); static private bool idle_queued = false; [DllImport ("libgobject-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]