Skip to content

Commit

Permalink
Minor simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
kleisauke committed Nov 18, 2023
1 parent b0f1a1d commit 18a1620
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/NetVips/Introspect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ void AddArg(string name, Enums.ArgumentFlags flags)

for (var i = 0; i < nArgs; i++)
{
var flag = (Enums.ArgumentFlags)Marshal.PtrToStructure(flags + i * sizeof(int), typeof(int));
var flag = (Enums.ArgumentFlags)Marshal.PtrToStructure<int>(flags + i * sizeof(int));
if ((flag & Enums.ArgumentFlags.CONSTRUCT) == 0)
{
continue;
Expand Down
2 changes: 1 addition & 1 deletion src/NetVips/NetVips.cs
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ public static Dictionary<string, int> ValuesForEnum(IntPtr type)
var enumValue = Marshal.PtrToStructure<GEnumValue>(ptr);
values[enumValue.ValueNick] = enumValue.Value;

ptr += Marshal.SizeOf(typeof(GEnumValue));
ptr += Marshal.SizeOf<GEnumValue>();
}

return values;
Expand Down

0 comments on commit 18a1620

Please sign in to comment.