misc: chore: Use explicit types in common project

This commit is contained in:
Evan Husted 2025-01-25 14:04:12 -06:00
parent 97188556d8
commit a97fd4beb1
15 changed files with 59 additions and 56 deletions

View file

@ -41,7 +41,7 @@ namespace Ryujinx.Common.Logging.Formatters
sb.Append('{');
foreach (var prop in props)
foreach (PropertyInfo prop in props)
{
sb.Append(prop.Name);
sb.Append(": ");
@ -52,7 +52,7 @@ namespace Ryujinx.Common.Logging.Formatters
if (array is not null)
{
foreach (var item in array)
foreach (object? item in array)
{
sb.Append(item);
sb.Append(", ");

View file

@ -193,7 +193,7 @@ namespace Ryujinx.Common.Logging
_stdErrAdapter.Dispose();
foreach (var target in _logTargets)
foreach (ILogTarget target in _logTargets)
{
target.Dispose();
}
@ -203,9 +203,9 @@ namespace Ryujinx.Common.Logging
public static IReadOnlyCollection<LogLevel> GetEnabledLevels()
{
var logs = new[] { Debug, Info, Warning, Error, Guest, AccessLog, Stub, Trace };
Log?[] logs = new[] { Debug, Info, Warning, Error, Guest, AccessLog, Stub, Trace };
List<LogLevel> levels = new(logs.Length);
foreach (var log in logs)
foreach (Log? log in logs)
{
if (log.HasValue)
levels.Add(log.Value.Level);

View file

@ -26,7 +26,7 @@ namespace Ryujinx.Common.Logging.Targets
public void Log(object sender, LogEventArgs e)
{
var logEventArgsJson = LogEventArgsJson.FromLogEventArgs(e);
LogEventArgsJson logEventArgsJson = LogEventArgsJson.FromLogEventArgs(e);
JsonHelper.SerializeToStream(_stream, logEventArgsJson, LogEventJsonSerializerContext.Default.LogEventArgsJson);
}