mirror of
				https://github.com/Ryujinx/GtkSharp.git
				synced 2025-11-04 13:04:53 +00:00 
			
		
		
		
	glib: Switch to generic collections in Marshaller and ValueArray
This commit is contained in:
		
							parent
							
								
									6e3e73e2ac
								
							
						
					
					
						commit
						df751f87ce
					
				| 
						 | 
				
			
			@ -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<string> ();
 | 
			
		||||
			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)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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<IntPtr> PendingFrees = new List<IntPtr> ();
 | 
			
		||||
		static private bool idle_queued = false;
 | 
			
		||||
 | 
			
		||||
		[DllImport ("libgobject-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue