diff options
author | sr55 <[email protected]> | 2013-02-12 20:37:59 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2013-02-12 20:37:59 +0000 |
commit | d72b432378105f191bc7bf6f756bb7a7533dc79a (patch) | |
tree | c76b29f4e7248918f0011e9340d51bb3f9a7bfed /win/CS/HandBrake.Interop/HandBrakeInterop/InteropUtilities.cs | |
parent | 3a5365f662fdd94d12733e9c7b1e09745697b532 (diff) |
WinGui: A Stylecop cleanup pass on Interop Library. Note, moved the Eventargs into their own package.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5248 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrake.Interop/HandBrakeInterop/InteropUtilities.cs')
-rw-r--r-- | win/CS/HandBrake.Interop/HandBrakeInterop/InteropUtilities.cs | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/InteropUtilities.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/InteropUtilities.cs index de73dd607..8bf68b2e1 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/InteropUtilities.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/InteropUtilities.cs @@ -106,12 +106,9 @@ namespace HandBrake.Interop IntPtr nativeListInternal = Marshal.AllocHGlobal(capacity * intSize);
returnList.AllocatedMemory.Add(nativeListInternal);
- hb_list_s nativeListStruct = new hb_list_s();
- nativeListStruct.items = nativeListInternal;
- nativeListStruct.items_alloc = capacity;
- nativeListStruct.items_count = 0;
+ hb_list_s nativeListStruct = new hb_list_s { items = nativeListInternal, items_alloc = capacity, items_count = 0 };
- IntPtr nativeListStructPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(hb_list_s)));
+ IntPtr nativeListStructPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(hb_list_s)));
Marshal.StructureToPtr(nativeListStruct, nativeListStructPtr, false);
returnList.ListPtr = nativeListStructPtr;
@@ -135,12 +132,14 @@ namespace HandBrake.Interop Marshal.WriteIntPtr(nativeListInternal, i * intSize, list[i]);
}
- hb_list_s nativeListStruct = new hb_list_s();
- nativeListStruct.items = nativeListInternal;
- nativeListStruct.items_alloc = list.Count;
- nativeListStruct.items_count = list.Count;
+ hb_list_s nativeListStruct = new hb_list_s
+ {
+ items = nativeListInternal,
+ items_alloc = list.Count,
+ items_count = list.Count
+ };
- IntPtr nativeListStructPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(hb_list_s)));
+ IntPtr nativeListStructPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(hb_list_s)));
Marshal.StructureToPtr(nativeListStruct, nativeListStructPtr, false);
returnList.ListPtr = nativeListStructPtr;
@@ -169,12 +168,14 @@ namespace HandBrake.Interop Marshal.WriteIntPtr(nativeListInternal, i * intSize, itemPtr);
}
- hb_list_s nativeListStruct = new hb_list_s();
- nativeListStruct.items = nativeListInternal;
- nativeListStruct.items_alloc = list.Count;
- nativeListStruct.items_count = list.Count;
+ hb_list_s nativeListStruct = new hb_list_s
+ {
+ items = nativeListInternal,
+ items_alloc = list.Count,
+ items_count = list.Count
+ };
- IntPtr nativeListStructPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(hb_list_s)));
+ IntPtr nativeListStructPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(hb_list_s)));
Marshal.StructureToPtr(nativeListStruct, nativeListStructPtr, false);
returnList.ListPtr = nativeListStructPtr;
|