From a05760c76ad7d7c5ab9a1734722b993f18239b66 Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Thu, 20 Feb 2020 12:41:17 +0000 Subject: [PATCH] intptr_t => IntPtr --- .../Generated/Interfaces/ISteamNetworkingUtils.cs | 12 ++++++------ Facepunch.Steamworks/SteamNetworkingUtils.cs | 10 +++++----- Generator/Types/BaseType.cs | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingUtils.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingUtils.cs index e18452a..30f265b 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingUtils.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingUtils.cs @@ -261,10 +261,10 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingUtils_SetConfigValue", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _SetConfigValue( IntPtr self, NetConfig eValue, NetConfigScope eScopeType, long scopeObj, NetConfigType eDataType, IntPtr pArg ); + private static extern bool _SetConfigValue( IntPtr self, NetConfig eValue, NetConfigScope eScopeType, IntPtr scopeObj, NetConfigType eDataType, IntPtr pArg ); #endregion - internal bool SetConfigValue( NetConfig eValue, NetConfigScope eScopeType, long scopeObj, NetConfigType eDataType, IntPtr pArg ) + internal bool SetConfigValue( NetConfig eValue, NetConfigScope eScopeType, IntPtr scopeObj, NetConfigType eDataType, IntPtr pArg ) { var returnValue = _SetConfigValue( Self, eValue, eScopeType, scopeObj, eDataType, pArg ); return returnValue; @@ -273,10 +273,10 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingUtils_SetConfigValueStruct", CallingConvention = Platform.CC)] [return: MarshalAs( UnmanagedType.I1 )] - private static extern bool _SetConfigValueStruct( IntPtr self, ref NetKeyValue opt, NetConfigScope eScopeType, long scopeObj ); + private static extern bool _SetConfigValueStruct( IntPtr self, ref NetKeyValue opt, NetConfigScope eScopeType, IntPtr scopeObj ); #endregion - internal bool SetConfigValueStruct( ref NetKeyValue opt, NetConfigScope eScopeType, long scopeObj ) + internal bool SetConfigValueStruct( ref NetKeyValue opt, NetConfigScope eScopeType, IntPtr scopeObj ) { var returnValue = _SetConfigValueStruct( Self, ref opt, eScopeType, scopeObj ); return returnValue; @@ -284,10 +284,10 @@ namespace Steamworks #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingUtils_GetConfigValue", CallingConvention = Platform.CC)] - private static extern NetConfigResult _GetConfigValue( IntPtr self, NetConfig eValue, NetConfigScope eScopeType, long scopeObj, ref NetConfigType pOutDataType, IntPtr pResult, ref UIntPtr cbResult ); + private static extern NetConfigResult _GetConfigValue( IntPtr self, NetConfig eValue, NetConfigScope eScopeType, IntPtr scopeObj, ref NetConfigType pOutDataType, IntPtr pResult, ref UIntPtr cbResult ); #endregion - internal NetConfigResult GetConfigValue( NetConfig eValue, NetConfigScope eScopeType, long scopeObj, ref NetConfigType pOutDataType, IntPtr pResult, ref UIntPtr cbResult ) + internal NetConfigResult GetConfigValue( NetConfig eValue, NetConfigScope eScopeType, IntPtr scopeObj, ref NetConfigType pOutDataType, IntPtr pResult, ref UIntPtr cbResult ) { var returnValue = _GetConfigValue( Self, eValue, eScopeType, scopeObj, ref pOutDataType, pResult, ref cbResult ); return returnValue; diff --git a/Facepunch.Steamworks/SteamNetworkingUtils.cs b/Facepunch.Steamworks/SteamNetworkingUtils.cs index 7dc263e..4321591 100644 --- a/Facepunch.Steamworks/SteamNetworkingUtils.cs +++ b/Facepunch.Steamworks/SteamNetworkingUtils.cs @@ -150,7 +150,7 @@ namespace Steamworks internal unsafe static bool GetConfigInt( NetConfig type, int value ) { int* ptr = &value; - return Internal.SetConfigValue( type, NetConfigScope.Global, 0, NetConfigType.Int32, (IntPtr)ptr ); + return Internal.SetConfigValue( type, NetConfigScope.Global, IntPtr.Zero, NetConfigType.Int32, (IntPtr)ptr ); } internal unsafe static int GetConfigInt( NetConfig type ) @@ -159,7 +159,7 @@ namespace Steamworks NetConfigType dtype = NetConfigType.Int32; int* ptr = &value; UIntPtr size = new UIntPtr( sizeof( int ) ); - var result = Internal.GetConfigValue( type, NetConfigScope.Global, 0, ref dtype, (IntPtr) ptr, ref size ); + var result = Internal.GetConfigValue( type, NetConfigScope.Global, IntPtr.Zero, ref dtype, (IntPtr) ptr, ref size ); if ( result != NetConfigResult.OK ) return 0; @@ -169,7 +169,7 @@ namespace Steamworks internal unsafe static bool SetConfigFloat( NetConfig type, float value ) { float* ptr = &value; - return Internal.SetConfigValue( type, NetConfigScope.Global, 0, NetConfigType.Float, (IntPtr)ptr ); + return Internal.SetConfigValue( type, NetConfigScope.Global, IntPtr.Zero, NetConfigType.Float, (IntPtr)ptr ); } internal unsafe static float GetConfigFloat( NetConfig type ) @@ -178,7 +178,7 @@ namespace Steamworks NetConfigType dtype = NetConfigType.Float; float* ptr = &value; UIntPtr size = new UIntPtr( sizeof( float ) ); - var result = Internal.GetConfigValue( type, NetConfigScope.Global, 0, ref dtype, (IntPtr)ptr, ref size ); + var result = Internal.GetConfigValue( type, NetConfigScope.Global, IntPtr.Zero, ref dtype, (IntPtr)ptr, ref size ); if ( result != NetConfigResult.OK ) return 0; @@ -191,7 +191,7 @@ namespace Steamworks fixed ( byte* ptr = bytes ) { - return Internal.SetConfigValue( type, NetConfigScope.Global, 0, NetConfigType.String, (IntPtr)ptr ); + return Internal.SetConfigValue( type, NetConfigScope.Global, IntPtr.Zero, NetConfigType.String, (IntPtr)ptr ); } } diff --git a/Generator/Types/BaseType.cs b/Generator/Types/BaseType.cs index 426400c..ff51c88 100644 --- a/Generator/Types/BaseType.cs +++ b/Generator/Types/BaseType.cs @@ -38,7 +38,7 @@ internal class BaseType if ( basicType == "unsigned short" ) return new UInt16Type { NativeType = type, VarName = varname }; // DANGER DANGER Danger - if ( basicType == "intptr_t" ) return new LongType { NativeType = type, VarName = varname }; + if ( basicType == "intptr_t" ) return new PointerType { NativeType = type, VarName = varname }; if ( basicType == "size_t" ) return new UIntPtrType { NativeType = type, VarName = varname }; if ( basicType == "uint64" ) return new ULongType { NativeType = type, VarName = varname };