Skip to content

Commit 3d20030

Browse files
Remove unused ifdef logic in ODBC (#44042)
1 parent a112379 commit 3d20030

1 file changed

Lines changed: 6 additions & 15 deletions

File tree

src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcStatementHandle.cs

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace 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
}

0 commit comments

Comments
 (0)