Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
kleisauke committed May 9, 2024
1 parent 3da60d6 commit b4f02cd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 17 deletions.
10 changes: 2 additions & 8 deletions src/NetVips/Internal/GObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ internal static class GObject
[StructLayout(LayoutKind.Sequential)]
internal struct Struct
{
internal GType.Instance GTypeInstance;
internal IntPtr GTypeInstance;

internal uint RefCount;

Expand Down Expand Up @@ -76,12 +76,6 @@ internal struct GEnumClass

internal static class GType
{
[StructLayout(LayoutKind.Sequential)]
internal struct Instance
{
internal IntPtr GClass;
}

[SuppressUnmanagedCodeSecurity]
[DllImport(Libraries.GObject, CallingConvention = CallingConvention.Cdecl,
EntryPoint = "g_type_name")]
Expand Down Expand Up @@ -218,7 +212,7 @@ internal static class GParamSpec
[StructLayout(LayoutKind.Sequential)]
internal struct Struct
{
internal GType.Instance GTypeInstance;
internal IntPtr GTypeInstance;

internal IntPtr Name;

Expand Down
10 changes: 2 additions & 8 deletions src/NetVips/Internal/Vips.cs
Original file line number Diff line number Diff line change
Expand Up @@ -260,16 +260,10 @@ internal static extern int SetFromString(VipsObjectManaged @object,
internal static extern IntPtr GetDescription(VipsObjectManaged @object);
}

[StructLayout(LayoutKind.Sequential)]
internal struct VipsArgument
{
internal IntPtr Pspec;
}

[StructLayout(LayoutKind.Sequential)]
internal struct VipsArgumentClass
{
internal VipsArgument Parent;
internal IntPtr Parent;
internal IntPtr ObjectClass;
internal ArgumentFlags Flags;

Expand All @@ -280,7 +274,7 @@ internal struct VipsArgumentClass
[StructLayout(LayoutKind.Sequential)]
internal struct VipsArgumentInstance
{
internal VipsArgument Parent;
internal IntPtr Parent;
internal IntPtr ArgumentClass;
internal IntPtr Object;

Expand Down
7 changes: 6 additions & 1 deletion src/NetVips/VipsProgress.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ public struct VipsProgress
/// <summary>
/// Start time.
/// </summary>
public GTimer Start;
private IntPtr StartPtr;

/// <summary>
/// Start time.
/// </summary>
public GTimer Start => Marshal.PtrToStructure<GTimer>(StartPtr);
}
}

0 comments on commit b4f02cd

Please sign in to comment.