Limpiando warnings

This commit is contained in:
2025-06-28 15:27:24 -04:00
parent d8e3aa16f8
commit b9d2377088
8 changed files with 18 additions and 18 deletions

View File

@@ -32,6 +32,6 @@ target_sources(
UI/Disassembler.h
)
add_compile_options(-Wall -Wextra -Wpedantic -Werror)
target_link_libraries(${PROJECT_NAME} PRIVATE vendor)
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -Wpedantic -Werror)
target_link_options(${PROJECT_NAME} PRIVATE)

View File

@@ -219,7 +219,7 @@ std::vector<Instruction> Interpreter::disassembly() const
{
std::vector<Instruction> instructions(std::size(machine_state->memory) / 2);
for (auto address = 0; address < std::size(machine_state->memory); address += 2)
for (std::size_t address = 0; address < std::size(machine_state->memory); address += 2)
{
const auto word = this->get_word(address);
instructions[address / 2] = (this->decode(word, address));

View File

@@ -20,11 +20,11 @@ Machine::Machine() :
interpreter{std::make_unique<Interpreter>(this->machine_state)},
ui_manager{std::make_unique<UIManager>(this->graphics, this->machine_state, this->callback_manager)},
running{false},
ips{60},
last_update_time{0},
accumulator{0},
target_cycle_time{1.0 / this->ips}
target_cycle_time{1.0 / this->ips},
running{false}
{
this->register_callbacks();
this->callback_manager->trigger(this->callback_manager->ips_callback, this->ips);

View File

@@ -122,7 +122,7 @@ void ControlPanel::on_click_load_rom()
);
}
void ControlPanel::on_callback_load_rom(void* self, const char* const* filelist, int filter)
void ControlPanel::on_callback_load_rom(void* self, const char* const* filelist, int)
{
const auto control_panel = static_cast<ControlPanel*>(self);

View File

@@ -64,7 +64,7 @@ void Display::update_texture() const
)
);
for (int i = 0; i < display.size(); i++)
for (std::size_t i = 0; i < display.size(); i++)
{
if (display[i])
{

View File

@@ -42,7 +42,7 @@ void MemoryViewer::render()
ImGui::End();
}
std::string MemoryViewer::get_memory_line(int line) const
std::string MemoryViewer::get_memory_line(const int line) const
{
auto& memory = this->machine_state->memory;
@@ -58,9 +58,9 @@ std::string MemoryViewer::get_memory_line(int line) const
<< static_cast<unsigned int>(i)
<< " | ";
for (auto j = 0; j < this->width; j++)
for (int j = 0; j < this->width; j++)
{
if (i + j >= size)
if (static_cast<std::size_t>(i + j) >= size)
{
text_builder << " ";
}
@@ -77,9 +77,9 @@ std::string MemoryViewer::get_memory_line(int line) const
text_builder << "| ";
for (auto j = 0; j < this->width; j++)
for (int j = 0; j < this->width; j++)
{
if (i + j >= size)
if (static_cast<std::size_t>(i + j) >= size)
{
text_builder << ".";
}

View File

@@ -4,7 +4,7 @@
#include <memory>
#include "Machine.h"
SDL_AppResult SDL_AppInit(void** appstate, int argc, char* argv[])
SDL_AppResult SDL_AppInit(void** appstate, [[maybe_unused]] int argc, [[maybe_unused]] char* argv[])
{
auto machine = std::make_unique<Machine>();
*appstate = machine.release();
@@ -33,7 +33,7 @@ SDL_AppResult SDL_AppEvent(void* appstate, SDL_Event* event)
return SDL_APP_CONTINUE;
}
void SDL_AppQuit(void* appstate, SDL_AppResult result)
void SDL_AppQuit(void* appstate, [[maybe_unused]] SDL_AppResult result)
{
std::unique_ptr<Machine> chip8(static_cast<Machine*>(appstate));
}