File tree Expand file tree Collapse file tree
src/libraries/System.Data.Odbc/src/System/Data/Odbc Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66
77namespace System . Data . Odbc
88{
9- internal struct SQLLEN
9+ internal readonly struct SQLLEN
1010 {
1111 private readonly IntPtr _value ;
1212
@@ -17,11 +17,7 @@ internal SQLLEN(int value)
1717
1818 internal SQLLEN ( long value )
1919 {
20- #if WIN32
21- _value = new IntPtr ( checked ( ( int ) value ) ) ;
22- #else
2320 _value = new IntPtr ( value ) ;
24- #endif
2521 }
2622
2723 internal SQLLEN ( IntPtr value )
@@ -30,7 +26,7 @@ internal SQLLEN(IntPtr value)
3026 }
3127
3228 public static implicit operator SQLLEN ( int value )
33- { //
29+ {
3430 return new SQLLEN ( value ) ;
3531 }
3632
@@ -39,22 +35,17 @@ public static explicit operator SQLLEN(long value)
3935 return new SQLLEN ( value ) ;
4036 }
4137
42- public static unsafe implicit operator int ( SQLLEN value )
38+ public static implicit operator int ( SQLLEN value )
4339 {
44- #if WIN32
45- return ( int ) value . _value . ToInt32 ( ) ;
46- #else
47- long l = ( long ) value . _value . ToInt64 ( ) ;
48- return checked ( ( int ) l ) ;
49- #endif
40+ return value . _value . ToInt32 ( ) ;
5041 }
5142
52- public static unsafe explicit operator long ( SQLLEN value )
43+ public static explicit operator long ( SQLLEN value )
5344 {
5445 return value . _value . ToInt64 ( ) ;
5546 }
5647
57- public unsafe long ToInt64 ( )
48+ public long ToInt64 ( )
5849 {
5950 return _value . ToInt64 ( ) ;
6051 }
You can’t perform that action at this time.
0 commit comments