RWops size_t fixes, remove unused unsafe keyword

This commit is contained in:
Ethan Lee 2019-10-23 10:05:22 -04:00
parent 1c0c33ff5b
commit 3185ae7eba

View file

@ -147,35 +147,38 @@ namespace SDL2
public const UInt32 SDL_RWOPS_MEMORY_RO = 5; /* Read-Only memory stream */ public const UInt32 SDL_RWOPS_MEMORY_RO = 5; /* Read-Only memory stream */
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate long SDLRWopsSizeCallback( public delegate long SDLRWopsSizeCallback(IntPtr context);
IntPtr context);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate long SDLRWopsSeekCallback( public delegate long SDLRWopsSeekCallback(
IntPtr context, IntPtr context,
long offset, long offset,
int whence); int whence
);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate uint SDLRWopsReadCallback( public delegate uint SDLRWopsReadCallback(
IntPtr context, IntPtr context,
IntPtr ptr, IntPtr ptr,
uint size, IntPtr size,
uint maxnum); IntPtr maxnum
);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate uint SDLRWopsWriteCallback( public delegate uint SDLRWopsWriteCallback(
IntPtr context, IntPtr context,
IntPtr ptr, IntPtr ptr,
uint size, IntPtr size,
uint num); IntPtr num
);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate int SDLRWopsCloseCallback( public delegate int SDLRWopsCloseCallback(
IntPtr context); IntPtr context
);
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public unsafe struct SDL_RWops public struct SDL_RWops
{ {
public IntPtr size; public IntPtr size;
public IntPtr seek; public IntPtr seek;
@ -185,8 +188,7 @@ namespace SDL2
public UInt32 type; public UInt32 type;
/* /* NOTE: This isn't the full structure since
* This isn't the full structure since
* the native SDL_RWops contains a hidden union full of * the native SDL_RWops contains a hidden union full of
* internal information and platform-specific stuff depending * internal information and platform-specific stuff depending
* on what conditions the native library was built with * on what conditions the native library was built with
@ -254,8 +256,8 @@ namespace SDL2
public static extern long SDL_RWread( public static extern long SDL_RWread(
IntPtr context, IntPtr context,
IntPtr ptr, IntPtr ptr,
uint size, IntPtr size,
uint maxnum IntPtr maxnum
); );
/* Only available in SDL 2.0.10 or higher. */ /* Only available in SDL 2.0.10 or higher. */
@ -264,8 +266,8 @@ namespace SDL2
public static extern long SDL_RWwrite( public static extern long SDL_RWwrite(
IntPtr context, IntPtr context,
IntPtr ptr, IntPtr ptr,
uint size, IntPtr size,
uint maxnum IntPtr maxnum
); );
/* Read endian functions */ /* Read endian functions */