Skip to content

Commit 5e546cf

Browse files
committed
Fix warnings on .NET 8/C# 12
1 parent 1ec2c31 commit 5e546cf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Lidgren.Network/Sockets/NetFastSocket.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ internal static unsafe class NetFastSocket
1515

1616
// Only Linux and Windows supported right now.
1717
// I couldn't get macOS to work and gave up for now.
18-
18+
1919
public static int SendTo(Socket socket, byte[] buffer, int offset, int size, SocketFlags socketFlags,
2020
IPEndPoint endPoint)
2121
{
@@ -83,7 +83,7 @@ public static int SendTo(
8383
{
8484
sockaddr_in6 address6 = default;
8585

86-
ref var refAddress6 = ref Unsafe.AsRef(socketAddress.V6);
86+
ref var refAddress6 = ref Unsafe.AsRef(in socketAddress.V6);
8787

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

100-
ref var refAddress4 = ref Unsafe.AsRef(socketAddress.V4);
100+
ref var refAddress4 = ref Unsafe.AsRef(in socketAddress.V4);
101101

102102
sockaddr_in address4 = default;
103103
address4.sin_port = htons(refAddress4.Port);

0 commit comments

Comments
 (0)