Skip to content
This repository has been archived by the owner on Aug 3, 2024. It is now read-only.

Commit

Permalink
fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
galister committed Mar 31, 2023
1 parent 9efb4a9 commit 429c57b
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Core/AudioManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class AudioManager
private AudioManager()
{
var values = Environment.GetEnvironmentVariable("PATH");
foreach (var path in values.Split(Path.PathSeparator))
foreach (var path in values!.Split(Path.PathSeparator))
{
if (!Directory.Exists(path))
continue;
Expand Down
1 change: 1 addition & 0 deletions Core/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ namespace WlxOverlay.Core;

public static class Extensions
{
#pragma warning disable CS1998
public static async IAsyncEnumerable<T> AsAsync<T>(this IEnumerable<T> e)
{
foreach(var item in e)
Expand Down
6 changes: 3 additions & 3 deletions Desktop/DBus/DBusConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ public void SetResult(T result)

public ValueTaskSourceStatus GetStatus(short token) => _core.GetStatus(token);

public void OnCompleted(Action<object> continuation, object state, short token, ValueTaskSourceOnCompletedFlags flags)
public void OnCompleted(Action<object> continuation, object? state, short token, ValueTaskSourceOnCompletedFlags flags)
{
_core.OnCompleted(continuation, state, token, flags);
_core.OnCompleted(continuation!, state, token, flags);
_continuationSet = true;
}

Expand Down Expand Up @@ -403,7 +403,7 @@ private void EmitOnSynchronizationContextHelper(Observer observer, Synchronizati
// note: Send blocks the current thread until the SynchronizationContext ran the delegate.
synchronizationContext.Send(static o =>
{
DBusConnection conn = (DBusConnection)o;
DBusConnection conn = (DBusConnection)o!;
conn._currentObserver!.Emit(conn._currentMessage!);
}, this);

Expand Down
2 changes: 1 addition & 1 deletion Desktop/DBus/UnixFdCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public IntPtr DangerousGetHandle(int index)
return null;
}
_rawHandles[index] = (rawHandle, false);
return (T)Activator.CreateInstance(typeof(T), new object[] { rawHandle, true });
return (T)Activator.CreateInstance(typeof(T), new object[] { rawHandle, true })!;
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion Desktop/Desktop.DBus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4528,7 +4528,7 @@ protected static uint ReadMessage_v_u(Message message, DesktopObject _)
protected static SafeHandle ReadMessage_h(Message message, DesktopObject _)
{
var reader = message.GetBodyReader();
return reader.ReadHandle<SafeHandle>();
return reader.ReadHandle<SafeHandle>()!;
}
protected static bool ReadMessage_v_b(Message message, DesktopObject _)
{
Expand Down
2 changes: 1 addition & 1 deletion Desktop/Wayland/WaylandOutput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class WaylandOutput : BaseOutput, IDisposable

public uint IdName;

public WaylandOutput(uint idName, WlOutput handle)
public WaylandOutput(uint idName, WlOutput? handle)
{
IdName = idName;
Handle = handle;
Expand Down
7 changes: 6 additions & 1 deletion Numerics/Vector2Int.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,13 @@ public static explicit operator Vector2(Vector2Int vi)

public override string ToString() => $"{X}x{Y}";

public override bool Equals(object obj)
public override bool Equals(object? obj)
{
throw new NotImplementedException();
}

public override int GetHashCode()
{
return HashCode.Combine(X, Y);
}
}

0 comments on commit 429c57b

Please sign in to comment.