Skip to content

Commit 19d7865

Browse files
committed
change bitconvertercompat to bitconvertercompatible
1 parent 2a6c33f commit 19d7865

File tree

8 files changed

+13
-10
lines changed

8 files changed

+13
-10
lines changed

src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333
<Compile Include="..\..\src\Microsoft\Data\Common\AdapterUtil.cs">
3434
<Link>Microsoft\Data\Common\AdapterUtil.cs</Link>
3535
</Compile>
36+
<Compile Include="..\..\src\Microsoft\Data\Common\BitConverterCompatible.cs">
37+
<Link>Microsoft\Data\Common\BitConverterCompatible.cs</Link>
38+
</Compile>
3639
<Compile Include="..\..\src\Microsoft\Data\Common\DbConnectionOptions.Common.cs">
3740
<Link>Microsoft\Data\Common\DbConnectionOptions.Common.cs</Link>
3841
</Compile>
@@ -623,7 +626,6 @@
623626
<Compile Include="Microsoft\Data\ProviderBase\DbConnectionPoolIdentity.cs" />
624627
<Compile Include="Microsoft\Data\SqlClient\AAsyncCallContext.cs" />
625628
<Compile Include="Microsoft\Data\SqlClient\AlwaysEncryptedHelperClasses.cs" />
626-
<Compile Include="Microsoft\Data\SqlClient\BitConverterCompat.cs"/>
627629
<Compile Include="Microsoft\Data\SqlClient\LocalDBAPI.cs" />
628630
<Compile Include="Microsoft\Data\SqlClient\Reliability\SqlConfigurableRetryLogicManager.NetCoreApp.cs" />
629631
<Compile Include="Microsoft\Data\SqlClient\SNI\ConcurrentQueueSemaphore.cs" />
@@ -1009,4 +1011,4 @@
10091011
<Import Project="$(ToolsDir)targets\ResolveContract.targets" Condition="'$(OSGroup)' == 'AnyOS'" />
10101012
<Import Project="$(ToolsDir)targets\NotSupported.targets" Condition="'$(OSGroup)' == 'AnyOS'" />
10111013
<Import Project="..\..\src\tools\targets\GenerateResourceStringsSource.targets" />
1012-
</Project>
1014+
</Project>

src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.NetCoreApp.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ internal sealed partial class TdsParser
1414

1515
internal static void FillDoubleBytes(double value, Span<byte> buffer) => BinaryPrimitives.TryWriteInt64LittleEndian(buffer, BitConverter.DoubleToInt64Bits(value));
1616

17-
internal static void FillFloatBytes(float value, Span<byte> buffer) => BinaryPrimitives.TryWriteInt32LittleEndian(buffer, BitConverterCompat.SingleToInt32Bits(value));
17+
internal static void FillFloatBytes(float value, Span<byte> buffer) => BinaryPrimitives.TryWriteInt32LittleEndian(buffer, BitConverterCompatible.SingleToInt32Bits(value));
1818

1919
internal static Guid ConstructGuid(ReadOnlySpan<byte> bytes)
2020
{

src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1781,7 +1781,7 @@ internal byte[] SerializeFloat(float v)
17811781
}
17821782

17831783
var bytes = new byte[4];
1784-
BinaryPrimitives.WriteInt32LittleEndian(bytes, BitConverterCompat.SingleToInt32Bits(v));
1784+
BinaryPrimitives.WriteInt32LittleEndian(bytes, BitConverterCompatible.SingleToInt32Bits(v));
17851785
return bytes;
17861786
}
17871787

@@ -5842,7 +5842,7 @@ internal bool DeserializeUnencryptedValue(SqlBuffer value, byte[] unencryptedByt
58425842
return false;
58435843
}
58445844

5845-
singleValue = BitConverterCompat.Int32BitsToSingle(BinaryPrimitives.ReadInt32LittleEndian(unencryptedBytes));
5845+
singleValue = BitConverterCompatible.Int32BitsToSingle(BinaryPrimitives.ReadInt32LittleEndian(unencryptedBytes));
58465846
value.Single = singleValue;
58475847
break;
58485848

src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParserStateObject.netcore.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,6 @@ internal void StartSession(object cancellationOwner)
279279
_cancellationOwner.Target = cancellationOwner;
280280
}
281281

282-
283282
/////////////////////////////////////////
284283
// Value Skip Logic //
285284
/////////////////////////////////////////

src/Microsoft.Data.SqlClient/netfx/src/Microsoft.Data.SqlClient.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@
9595
<Compile Include="..\..\src\Microsoft\Data\Common\AdapterUtil.Windows.cs">
9696
<Link>Microsoft\Data\Common\AdapterUtil.Windows.cs</Link>
9797
</Compile>
98+
<Compile Include="..\..\src\Microsoft\Data\Common\BitConverterCompatible.cs">
99+
<Link>Microsoft\Data\Common\BitConverterCompatible.cs</Link>
100+
</Compile>
98101
<Compile Include="..\..\src\Microsoft\Data\Common\DbConnectionStringCommon.cs">
99102
<Link>Microsoft\Data\Common\DbConnectionStringCommon.cs</Link>
100103
</Compile>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Microsoft.Data.SqlClient
66
{
7-
internal static class BitConverterCompat
7+
internal static class BitConverterCompatible
88
{
99
public static unsafe int SingleToInt32Bits(float value)
1010
{

src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParserStateObject.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1487,15 +1487,15 @@ internal bool TryReadSingle(out float value)
14871487
}
14881488

14891489
AssertValidState();
1490-
value = BitConverterCompat.Int32BitsToSingle(BinaryPrimitives.ReadInt32LittleEndian(_bTmp));
1490+
value = BitConverterCompatible.Int32BitsToSingle(BinaryPrimitives.ReadInt32LittleEndian(_bTmp));
14911491
return true;
14921492
}
14931493
else
14941494
{
14951495
// The entire float is in the packet and in the buffer, so just return it
14961496
// and take care of the counters.
14971497

1498-
value = BitConverterCompat.Int32BitsToSingle(BinaryPrimitives.ReadInt32LittleEndian(_inBuff.AsSpan(_inBytesUsed)));
1498+
value = BitConverterCompatible.Int32BitsToSingle(BinaryPrimitives.ReadInt32LittleEndian(_inBuff.AsSpan(_inBytesUsed)));
14991499

15001500
_inBytesUsed += 4;
15011501
_inBytesPacket -= 4;

src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsValueSetter.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,6 @@ internal void SetDateTimeOffset(DateTimeOffset value)
705705
_stateObj.WriteByteArray(BitConverter.GetBytes(time), length - 5, 0); // time
706706
_stateObj.WriteByteArray(BitConverter.GetBytes(days), 3, 0); // date
707707
#endif
708-
709708
_stateObj.WriteByte((byte)(offset & 0xff)); // offset byte 1
710709
_stateObj.WriteByte((byte)((offset >> 8) & 0xff)); // offset byte 2
711710
}

0 commit comments

Comments
 (0)