Skip to content

Commit

Permalink
Fix warnings on .NET 8/C# 12
Browse files Browse the repository at this point in the history
  • Loading branch information
PJB3005 committed Dec 13, 2023
1 parent 1ec2c31 commit 5e546cf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Lidgren.Network/Sockets/NetFastSocket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ internal static unsafe class NetFastSocket

// Only Linux and Windows supported right now.
// I couldn't get macOS to work and gave up for now.

public static int SendTo(Socket socket, byte[] buffer, int offset, int size, SocketFlags socketFlags,
IPEndPoint endPoint)
{
Expand Down Expand Up @@ -83,7 +83,7 @@ public static int SendTo(
{
sockaddr_in6 address6 = default;

ref var refAddress6 = ref Unsafe.AsRef(socketAddress.V6);
ref var refAddress6 = ref Unsafe.AsRef(in socketAddress.V6);

address6.sin6_port = htons(refAddress6.Port);
address6.sin6_family = AF_INET6;
Expand All @@ -97,7 +97,7 @@ public static int SendTo(
{
Debug.Assert(socketAddress.Family == NetIpAddressFamily.V4);

ref var refAddress4 = ref Unsafe.AsRef(socketAddress.V4);
ref var refAddress4 = ref Unsafe.AsRef(in socketAddress.V4);

sockaddr_in address4 = default;
address4.sin_port = htons(refAddress4.Port);
Expand Down

0 comments on commit 5e546cf

Please sign in to comment.