Merge pull request #1582 from MaddTheSane/printfFixes

Logging fixes
This commit is contained in:
Connor McLaughlin 2021-02-05 11:47:38 +10:00 committed by GitHub
commit f943aa0489
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 16 additions and 16 deletions

View File

@ -141,7 +141,7 @@ bool CDImageCueSheet::OpenAndParse(const char* filename)
file_size /= track_sector_size;
if (track_start >= file_size)
{
Log_ErrorPrintf("Failed to open track %u in '%s': track start is out of range (%u vs %u)", track_num, filename,
Log_ErrorPrintf("Failed to open track %u in '%s': track start is out of range (%ld vs %ld)", track_num, filename,
track_start, file_size);
return false;
}

View File

@ -81,7 +81,7 @@ bool CDImageMemory::CopyImage(CDImage* image, ProgressCallback* progress)
{
if (!image->ReadSectorFromIndex(memory_ptr, index, lba))
{
Log_ErrorPrintf("Failed to read LBA %u in index %u", lba, index);
Log_ErrorPrintf("Failed to read LBA %u in index %u", lba, i);
return false;
}

View File

@ -159,7 +159,7 @@ bool Program::GetBinary(std::vector<u8>* out_data, u32* out_data_format)
}
else if (static_cast<size_t>(binary_size) != out_data->size())
{
Log_WarningPrintf("Size changed from %zu to %d after glGetProgramBinary()", out_data->data(), binary_size);
Log_WarningPrintf("Size changed from %zu to %d after glGetProgramBinary()", out_data->size(), binary_size);
out_data->resize(static_cast<size_t>(binary_size));
}
@ -618,4 +618,4 @@ Program& Program::operator=(Program&& prog)
return *this;
}
} // namespace GL
} // namespace GL

View File

@ -85,7 +85,7 @@ void WAVWriter::WriteFrames(const s16* samples, u32 num_frames)
const u32 num_frames_written =
static_cast<u32>(std::fwrite(samples, sizeof(s16) * m_num_channels, num_frames, m_file));
if (num_frames_written != num_frames)
Log_ErrorPrintf("Only wrote %u of %u frames to output file", num_frames_written);
Log_ErrorPrintf("Only wrote %u of %u frames to output file", num_frames_written, num_frames);
m_num_frames += num_frames_written;
}
@ -112,4 +112,4 @@ bool WAVWriter::WriteHeader()
return (std::fwrite(&header, sizeof(header), 1, m_file) == 1);
}
} // namespace Common
} // namespace Common

View File

@ -919,7 +919,7 @@ ALWAYS_INLINE static TickCount DoEXP3Access(u32 offset, u32& value)
{
if constexpr (type == MemoryAccessType::Read)
{
Log_WarningPrintf("EXP3 read: 0x%08X -> 0x%08X", EXP3_BASE | offset);
Log_WarningPrintf("EXP3 read: 0x%08X -> 0x%08X", offset, EXP3_BASE | offset);
value = UINT32_C(0xFFFFFFFF);
return 0;

View File

@ -1488,7 +1488,7 @@ void CheatCode::Apply() const
}
else
{
Log_ErrorPrintf("Invalid command in second slide parameter 0x%02X", write_type);
Log_ErrorPrintf("Invalid command in second slide parameter 0x%02hhX", write_type);
}
index += 2;

View File

@ -341,7 +341,7 @@ void GPU_HW_OpenGL::SetCapabilities(HostDisplay* host_display)
if (GLAD_GL_VERSION_4_3 || GLAD_GL_ES_VERSION_3_1 || GLAD_GL_ARB_shader_storage_buffer_object)
glGetInteger64v(GL_MAX_SHADER_STORAGE_BLOCK_SIZE, &max_ssbo_size);
Log_InfoPrintf("Max shader storage buffer size: %u", max_ssbo_size);
Log_InfoPrintf("Max shader storage buffer size: %lld", max_ssbo_size);
m_use_ssbo_for_vram_writes = (max_ssbo_size >= (VRAM_WIDTH * VRAM_HEIGHT * sizeof(u16)));
if (m_use_ssbo_for_vram_writes)
{

View File

@ -187,7 +187,7 @@ void HostInterface::ReportDebuggerMessage(const char* message)
bool HostInterface::ConfirmMessage(const char* message)
{
Log_WarningPrintf("ConfirmMessage(\"%s\") -> Yes");
Log_WarningPrintf("ConfirmMessage(\"%s\") -> Yes", message);
return true;
}

View File

@ -2086,7 +2086,7 @@ bool SaveRewindState()
s_rewind_states.push_back(std::move(mss));
Log_DevPrintf("Saved rewind state (%u bytes, took %.4f ms)", s_rewind_states.back().state_stream->GetSize(),
Log_DevPrintf("Saved rewind state (%llu bytes, took %.4f ms)", s_rewind_states.back().state_stream->GetSize(),
save_timer.GetTimeMilliseconds());
return true;
@ -2245,4 +2245,4 @@ void SetRunaheadReplayFlag()
s_runahead_replay_pending = true;
}
} // namespace System
} // namespace System

View File

@ -239,7 +239,7 @@ u32 Timers::ReadRegister(u32 offset)
return cs.target;
default:
Log_ErrorPrintf("Read unknown register in timer %u (offset 0x%02X)", offset);
Log_ErrorPrintf("Read unknown register in timer %u (offset 0x%02X)", timer_index, offset);
return UINT32_C(0xFFFFFFFF);
}
}
@ -302,7 +302,7 @@ void Timers::WriteRegister(u32 offset, u32 value)
break;
default:
Log_ErrorPrintf("Write unknown register in timer %u (offset 0x%02X, value 0x%X)", offset, value);
Log_ErrorPrintf("Write unknown register in timer %u (offset 0x%02X, value 0x%X)", timer_index, offset, value);
break;
}
}

View File

@ -328,13 +328,13 @@ static void APIENTRY GLDebugCallback(GLenum source, GLenum type, GLuint id, GLen
switch (severity)
{
case GL_DEBUG_SEVERITY_HIGH_KHR:
Log_ErrorPrintf(message);
Log_ErrorPrint(message);
break;
case GL_DEBUG_SEVERITY_MEDIUM_KHR:
Log_WarningPrint(message);
break;
case GL_DEBUG_SEVERITY_LOW_KHR:
Log_InfoPrintf(message);
Log_InfoPrint(message);
break;
case GL_DEBUG_SEVERITY_NOTIFICATION:
// Log_DebugPrint(message);