diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2022-08-11 18:07:37 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-11 18:07:37 -0300 |
| commit | a5ff0024fb33964c802e1712e5b11a52390603e7 (patch) | |
| tree | fdc0b7781541215cd728b8e0288b729f73dbad88 /Ryujinx.HLE/HOS | |
| parent | f9661a54d21c3020783d14fd9935bb7b741a6915 (diff) | |
Rename ToSpan to AsSpan (#3556)
Diffstat (limited to 'Ryujinx.HLE/HOS')
14 files changed, 20 insertions, 20 deletions
diff --git a/Ryujinx.HLE/HOS/Applets/Controller/ControllerSupportArgV7.cs b/Ryujinx.HLE/HOS/Applets/Controller/ControllerSupportArgV7.cs index efb95ea5..98c413be 100644 --- a/Ryujinx.HLE/HOS/Applets/Controller/ControllerSupportArgV7.cs +++ b/Ryujinx.HLE/HOS/Applets/Controller/ControllerSupportArgV7.cs @@ -19,7 +19,7 @@ namespace Ryujinx.HLE.HOS.Applets { private byte element; - public Span<byte> ToSpan() => MemoryMarshal.CreateSpan(ref element, 8 * 0x81); + public Span<byte> AsSpan() => MemoryMarshal.CreateSpan(ref element, 8 * 0x81); } } #pragma warning restore CS0649 diff --git a/Ryujinx.HLE/HOS/Applets/Controller/ControllerSupportArgVPre7.cs b/Ryujinx.HLE/HOS/Applets/Controller/ControllerSupportArgVPre7.cs index ec977009..87417e16 100644 --- a/Ryujinx.HLE/HOS/Applets/Controller/ControllerSupportArgVPre7.cs +++ b/Ryujinx.HLE/HOS/Applets/Controller/ControllerSupportArgVPre7.cs @@ -19,7 +19,7 @@ namespace Ryujinx.HLE.HOS.Applets { private byte element; - public Span<byte> ToSpan() => MemoryMarshal.CreateSpan(ref element, 4 * 0x81); + public Span<byte> AsSpan() => MemoryMarshal.CreateSpan(ref element, 4 * 0x81); } } #pragma warning restore CS0649 diff --git a/Ryujinx.HLE/HOS/Applets/Error/ErrorApplet.cs b/Ryujinx.HLE/HOS/Applets/Error/ErrorApplet.cs index 6780f802..0ca90130 100644 --- a/Ryujinx.HLE/HOS/Applets/Error/ErrorApplet.cs +++ b/Ryujinx.HLE/HOS/Applets/Error/ErrorApplet.cs @@ -179,8 +179,8 @@ namespace Ryujinx.HLE.HOS.Applets.Error byte[] messageTextBuffer = new byte[0x800]; byte[] detailsTextBuffer = new byte[0x800]; - applicationErrorArg.MessageText.ToSpan().CopyTo(messageTextBuffer); - applicationErrorArg.DetailsText.ToSpan().CopyTo(detailsTextBuffer); + applicationErrorArg.MessageText.AsSpan().CopyTo(messageTextBuffer); + applicationErrorArg.DetailsText.AsSpan().CopyTo(detailsTextBuffer); string messageText = Encoding.ASCII.GetString(messageTextBuffer.TakeWhile(b => !b.Equals(0)).ToArray()); string detailsText = Encoding.ASCII.GetString(detailsTextBuffer.TakeWhile(b => !b.Equals(0)).ToArray()); diff --git a/Ryujinx.HLE/HOS/Services/Audio/IHardwareOpusDecoderManager.cs b/Ryujinx.HLE/HOS/Services/Audio/IHardwareOpusDecoderManager.cs index 81ea952b..58680db8 100644 --- a/Ryujinx.HLE/HOS/Services/Audio/IHardwareOpusDecoderManager.cs +++ b/Ryujinx.HLE/HOS/Services/Audio/IHardwareOpusDecoderManager.cs @@ -117,7 +117,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio OpusMultiStreamParametersEx parameters = context.Memory.Read<OpusMultiStreamParametersEx>(parametersAddress); - byte[] mappings = MemoryMarshal.Cast<uint, byte>(parameters.ChannelMappings.ToSpan()).ToArray(); + byte[] mappings = MemoryMarshal.Cast<uint, byte>(parameters.ChannelMappings.AsSpan()).ToArray(); // UseLargeFrameSize can be ignored due to not relying on fixed size buffers for storing the decoded result. MakeObject(context, new IHardwareOpusDecoder( diff --git a/Ryujinx.HLE/HOS/Services/Friend/ServiceCreator/IFriendService.cs b/Ryujinx.HLE/HOS/Services/Friend/ServiceCreator/IFriendService.cs index e417ffd5..1cf03f5b 100644 --- a/Ryujinx.HLE/HOS/Services/Friend/ServiceCreator/IFriendService.cs +++ b/Ryujinx.HLE/HOS/Services/Friend/ServiceCreator/IFriendService.cs @@ -131,7 +131,7 @@ namespace Ryujinx.HLE.HOS.Services.Friend.ServiceCreator return ResultCode.InvalidArgument; } - // TODO: Service mount the friends:/ system savedata and try to load friend.cache file, returns true if exists, false otherwise. + // TODO: Service mount the friends:/ system savedata and try to load friend.cache file, returns true if exists, false otherwise. // NOTE: If no cache is available, guest then calls nn::friends::EnsureFriendListAvailable, we can avoid that by faking the cache check. context.ResponseData.Write(true); @@ -190,7 +190,7 @@ namespace Ryujinx.HLE.HOS.Services.Friend.ServiceCreator } context.Device.System.AccountManager.OpenUserOnlinePlay(userId); - + Logger.Stub?.PrintStub(LogClass.ServiceFriend, new { UserId = userId.ToString() }); return ResultCode.Success; @@ -277,7 +277,7 @@ namespace Ryujinx.HLE.HOS.Services.Friend.ServiceCreator Array16<byte> randomGuid = new Array16<byte>(); - Guid.NewGuid().ToByteArray().AsSpan().CopyTo(randomGuid.ToSpan()); + Guid.NewGuid().ToByteArray().AsSpan().CopyTo(randomGuid.AsSpan()); PlayHistoryRegistrationKey playHistoryRegistrationKey = new PlayHistoryRegistrationKey { diff --git a/Ryujinx.HLE/HOS/Services/Hid/HidDevices/KeyboardDevice.cs b/Ryujinx.HLE/HOS/Services/Hid/HidDevices/KeyboardDevice.cs index fa565a7f..8908b74d 100644 --- a/Ryujinx.HLE/HOS/Services/Hid/HidDevices/KeyboardDevice.cs +++ b/Ryujinx.HLE/HOS/Services/Hid/HidDevices/KeyboardDevice.cs @@ -26,7 +26,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid SamplingNumber = previousEntry.SamplingNumber + 1, }; - keyState.Keys.AsSpan().CopyTo(newState.Keys.RawData.ToSpan()); + keyState.Keys.AsSpan().CopyTo(newState.Keys.RawData.AsSpan()); newState.Modifiers = (KeyboardModifier)keyState.Modifier; lifo.Write(ref newState); diff --git a/Ryujinx.HLE/HOS/Services/Hid/HidDevices/NpadDevices.cs b/Ryujinx.HLE/HOS/Services/Hid/HidDevices/NpadDevices.cs index 528b6dce..edcc47d8 100644 --- a/Ryujinx.HLE/HOS/Services/Hid/HidDevices/NpadDevices.cs +++ b/Ryujinx.HLE/HOS/Services/Hid/HidDevices/NpadDevices.cs @@ -543,7 +543,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid Attributes = SixAxisSensorAttribute.IsConnected }; - state.Orientation.AsSpan().CopyTo(newState.Direction.ToSpan()); + state.Orientation.AsSpan().CopyTo(newState.Direction.AsSpan()); ref RingLifo<SixAxisSensorState> lifo = ref GetSixAxisSensorLifo(ref currentNpad, isRightPair); diff --git a/Ryujinx.HLE/HOS/Services/Nfc/Nfp/NfpManager/INfp.cs b/Ryujinx.HLE/HOS/Services/Nfc/Nfp/NfpManager/INfp.cs index c29e0769..9dfa677c 100644 --- a/Ryujinx.HLE/HOS/Services/Nfc/Nfp/NfpManager/INfp.cs +++ b/Ryujinx.HLE/HOS/Services/Nfc/Nfp/NfpManager/INfp.cs @@ -628,7 +628,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.Nfp Reserved2 = new Array6<byte>() }; - Uuid.CopyTo(tagInfo.Uuid.ToSpan()); + Uuid.CopyTo(tagInfo.Uuid.AsSpan()); context.Memory.Write(outputPosition, tagInfo); diff --git a/Ryujinx.HLE/HOS/Services/Nfc/Nfp/VirtualAmiibo.cs b/Ryujinx.HLE/HOS/Services/Nfc/Nfp/VirtualAmiibo.cs index 00e35799..851b67a5 100644 --- a/Ryujinx.HLE/HOS/Services/Nfc/Nfp/VirtualAmiibo.cs +++ b/Ryujinx.HLE/HOS/Services/Nfc/Nfp/VirtualAmiibo.cs @@ -85,7 +85,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.Nfp Reserved1 = new Array64<byte>(), Reserved2 = new Array58<byte>() }; - Encoding.ASCII.GetBytes("Ryujinx").CopyTo(registerInfo.Nickname.ToSpan()); + Encoding.ASCII.GetBytes("Ryujinx").CopyTo(registerInfo.Nickname.AsSpan()); return registerInfo; } diff --git a/Ryujinx.HLE/HOS/Services/Nifm/StaticService/IGeneralService.cs b/Ryujinx.HLE/HOS/Services/Nifm/StaticService/IGeneralService.cs index ba91f08c..e04dd813 100644 --- a/Ryujinx.HLE/HOS/Services/Nifm/StaticService/IGeneralService.cs +++ b/Ryujinx.HLE/HOS/Services/Nifm/StaticService/IGeneralService.cs @@ -84,7 +84,7 @@ namespace Ryujinx.HLE.HOS.Services.Nifm.StaticService networkProfile.IpSettingData.IpAddressSetting = new IpAddressSetting(interfaceProperties, unicastAddress); networkProfile.IpSettingData.DnsSetting = new DnsSetting(interfaceProperties); - Encoding.ASCII.GetBytes("RyujinxNetwork").CopyTo(networkProfile.Name.ToSpan()); + Encoding.ASCII.GetBytes("RyujinxNetwork").CopyTo(networkProfile.Name.AsSpan()); context.Memory.Write(networkProfileDataPosition, networkProfile); diff --git a/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/BsdSockAddr.cs b/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/BsdSockAddr.cs index 916ca2bb..71926ceb 100644 --- a/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/BsdSockAddr.cs +++ b/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/BsdSockAddr.cs @@ -16,7 +16,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd public IPEndPoint ToIPEndPoint() { - IPAddress address = new IPAddress(Address.ToSpan()); + IPAddress address = new IPAddress(Address.AsSpan()); int port = (ushort)IPAddress.NetworkToHostOrder((short)Port); return new IPEndPoint(address, port); @@ -31,7 +31,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd Port = (ushort)IPAddress.HostToNetworkOrder((short)endpoint.Port) }; - endpoint.Address.GetAddressBytes().AsSpan().CopyTo(result.Address.ToSpan()); + endpoint.Address.GetAddressBytes().AsSpan().CopyTo(result.Address.AsSpan()); return result; } diff --git a/Ryujinx.HLE/HOS/Services/Sockets/Sfdnsres/Types/AddrInfo4.cs b/Ryujinx.HLE/HOS/Services/Sockets/Sfdnsres/Types/AddrInfo4.cs index e2041d2e..6e4d883b 100644 --- a/Ryujinx.HLE/HOS/Services/Sockets/Sfdnsres/Types/AddrInfo4.cs +++ b/Ryujinx.HLE/HOS/Services/Sockets/Sfdnsres/Types/AddrInfo4.cs @@ -22,7 +22,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Sfdnsres.Types Port = port; Address = new Array4<byte>(); - address.TryWriteBytes(Address.ToSpan(), out _); + address.TryWriteBytes(Address.AsSpan(), out _); } public void ToNetworkOrder() @@ -43,7 +43,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Sfdnsres.Types { if (BitConverter.IsLittleEndian) { - address.ToSpan().Reverse(); + address.AsSpan().Reverse(); } } } diff --git a/Ryujinx.HLE/HOS/Services/Time/TimeZone/TimeZone.cs b/Ryujinx.HLE/HOS/Services/Time/TimeZone/TimeZone.cs index 6cd16f75..3b13b583 100644 --- a/Ryujinx.HLE/HOS/Services/Time/TimeZone/TimeZone.cs +++ b/Ryujinx.HLE/HOS/Services/Time/TimeZone/TimeZone.cs @@ -1440,7 +1440,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.TimeZone int timeZoneSize = Math.Min(StringUtils.LengthCstr(timeZoneAbbreviation), 8); - timeZoneAbbreviation[..timeZoneSize].CopyTo(calendarAdditionalInfo.TimezoneName.ToSpan()); + timeZoneAbbreviation[..timeZoneSize].CopyTo(calendarAdditionalInfo.TimezoneName.AsSpan()); } return result; diff --git a/Ryujinx.HLE/HOS/Services/Vi/RootService/IApplicationDisplayService.cs b/Ryujinx.HLE/HOS/Services/Vi/RootService/IApplicationDisplayService.cs index 640e8be4..885a4cd7 100644 --- a/Ryujinx.HLE/HOS/Services/Vi/RootService/IApplicationDisplayService.cs +++ b/Ryujinx.HLE/HOS/Services/Vi/RootService/IApplicationDisplayService.cs @@ -49,7 +49,7 @@ namespace Ryujinx.HLE.HOS.Services.Vi.RootService Height = height }; - Encoding.ASCII.GetBytes(name).AsSpan().CopyTo(displayInfo.Name.ToSpan()); + Encoding.ASCII.GetBytes(name).AsSpan().CopyTo(displayInfo.Name.AsSpan()); _displayInfo.Add(displayInfo); } @@ -171,7 +171,7 @@ namespace Ryujinx.HLE.HOS.Services.Vi.RootService return ResultCode.InvalidValue; } - int displayId = _displayInfo.FindIndex(display => Encoding.ASCII.GetString(display.Name.ToSpan()).Trim('\0') == name); + int displayId = _displayInfo.FindIndex(display => Encoding.ASCII.GetString(display.Name.AsSpan()).Trim('\0') == name); if (displayId == -1) { |
