Skip to content

Commit

Permalink
Merge pull request #212 from TotalCaesar659/warnings
Browse files Browse the repository at this point in the history
Fix compilation warnings
  • Loading branch information
nicolasnoble authored May 22, 2020
2 parents 85c9ed7 + 2deb0c3 commit c3a4c46
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 26 deletions.
4 changes: 2 additions & 2 deletions src/gui/gui.cc
Original file line number Diff line number Diff line change
Expand Up @@ -889,15 +889,15 @@ void PCSX::GUI::about() {
checkGL();
ImGui::TextWrapped("%s: %s", str, value);
};
ImGui::Text(_("OpenGL information"));
ImGui::TextUnformatted(_("OpenGL information"));
someString(_("vendor"), GL_VENDOR);
someString(_("renderer"), GL_RENDERER);
someString(_("version"), GL_VERSION);
someString(_("shading language version"), GL_SHADING_LANGUAGE_VERSION);
GLint n, i;
glGetIntegerv(GL_NUM_EXTENSIONS, &n);
checkGL();
ImGui::Text(_("extensions:"));
ImGui::TextUnformatted(_("extensions:"));
ImGui::BeginChild("GLextensions", ImVec2(0, 0), true);
for (i = 0; i < n; i++) {
const char* extension = (const char*)glGetStringi(GL_EXTENSIONS, i);
Expand Down
28 changes: 14 additions & 14 deletions src/gui/widgets/assembly.cc
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ void PCSX::Widgets::Assembly::GPR(uint8_t reg) {
sameLine();
ImGui::Text(" $");
sameLine();
ImGui::Text(s_disRNameGPR[reg]);
ImGui::TextUnformatted(s_disRNameGPR[reg]);
if (ImGui::IsItemHovered()) {
ImGui::BeginTooltip();
ImGui::PushTextWrapPos(ImGui::GetFontSize() * 35.0f);
Expand All @@ -152,7 +152,7 @@ void PCSX::Widgets::Assembly::CP0(uint8_t reg) {
sameLine();
ImGui::Text(" $");
sameLine();
ImGui::Text(s_disRNameCP0[reg]);
ImGui::TextUnformatted(s_disRNameCP0[reg]);
if (ImGui::IsItemHovered()) {
ImGui::BeginTooltip();
ImGui::PushTextWrapPos(ImGui::GetFontSize() * 35.0f);
Expand All @@ -166,7 +166,7 @@ void PCSX::Widgets::Assembly::CP2C(uint8_t reg) {
sameLine();
ImGui::Text(" $");
sameLine();
ImGui::Text(s_disRNameCP2C[reg]);
ImGui::TextUnformatted(s_disRNameCP2C[reg]);
if (ImGui::IsItemHovered()) {
ImGui::BeginTooltip();
ImGui::PushTextWrapPos(ImGui::GetFontSize() * 35.0f);
Expand All @@ -180,7 +180,7 @@ void PCSX::Widgets::Assembly::CP2D(uint8_t reg) {
sameLine();
ImGui::Text(" $");
sameLine();
ImGui::Text(s_disRNameCP2D[reg]);
ImGui::TextUnformatted(s_disRNameCP2D[reg]);
if (ImGui::IsItemHovered()) {
ImGui::BeginTooltip();
ImGui::PushTextWrapPos(ImGui::GetFontSize() * 35.0f);
Expand Down Expand Up @@ -263,7 +263,7 @@ void PCSX::Widgets::Assembly::Target(uint32_t value) {
comma();
sameLine();
char label[21];
ImGui::Text("");
ImGui::TextUnformatted("");
ImGui::SameLine();
if (m_displayArrowForJumps) m_arrows.push_back({m_currentAddr, value});
std::snprintf(label, sizeof(label), "0x%8.8x##%8.8x", value, m_currentAddr);
Expand Down Expand Up @@ -341,7 +341,7 @@ void PCSX::Widgets::Assembly::OfB(int16_t offset, uint8_t reg, int size) {
std::snprintf(label, sizeof(label), "0x%4.4x($%s)##%08x", offset, s_disRNameGPR[reg], m_currentAddr);
}
uint32_t addr = m_registers->GPR.r[reg] + offset;
ImGui::Text("");
ImGui::TextUnformatted("");
ImGui::SameLine();
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0, 0));
if (ImGui::Button(label)) jumpToMemory(addr, size);
Expand All @@ -368,7 +368,7 @@ void PCSX::Widgets::Assembly::BranchDest(uint32_t value) {
comma();
sameLine();
char label[21];
ImGui::Text("");
ImGui::TextUnformatted("");
ImGui::SameLine();
m_arrows.push_back({m_currentAddr, value});
std::snprintf(label, sizeof(label), "0x%8.8x##%8.8x", value, m_currentAddr);
Expand Down Expand Up @@ -398,7 +398,7 @@ void PCSX::Widgets::Assembly::Offset(uint32_t addr, int size) {
std::string longLabel = label;
auto symbols = findSymbol(addr);
if (symbols.size() != 0) longLabel = *symbols.begin() + " ;" + label;
ImGui::Text("");
ImGui::TextUnformatted("");
ImGui::SameLine();
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0, 0));
if (ImGui::Button(longLabel.c_str())) jumpToMemory(addr, size);
Expand Down Expand Up @@ -455,7 +455,7 @@ void PCSX::Widgets::Assembly::draw(psxRegisters* registers, Memory* memory, Dwar
if (ImGui::IsItemHovered()) {
ImGui::BeginTooltip();
ImGui::PushTextWrapPos(glyphWidth * 35.0f);
ImGui::TextWrapped(
ImGui::TextUnformatted(
_("When two instructions are detected to be a single pseudo-instruction, combine them into the "
"actual pseudo-instruction."));
ImGui::PopTextWrapPos();
Expand All @@ -465,7 +465,7 @@ void PCSX::Widgets::Assembly::draw(psxRegisters* registers, Memory* memory, Dwar
if (ImGui::IsItemHovered()) {
ImGui::BeginTooltip();
ImGui::PushTextWrapPos(glyphWidth * 35.0f);
ImGui::TextWrapped(
ImGui::TextUnformatted(
_("When combining two instructions into a single pseudo-instruction, add a placeholder for the "
"second one."));
ImGui::PopTextWrapPos();
Expand All @@ -475,7 +475,7 @@ void PCSX::Widgets::Assembly::draw(psxRegisters* registers, Memory* memory, Dwar
if (ImGui::IsItemHovered()) {
ImGui::BeginTooltip();
ImGui::PushTextWrapPos(glyphWidth * 35.0f);
ImGui::TextWrapped(
ImGui::TextUnformatted(
_("Add a small visible notch to indicate instructions that are on the delay slot of a branch."));
ImGui::PopTextWrapPos();
ImGui::EndTooltip();
Expand All @@ -484,7 +484,7 @@ void PCSX::Widgets::Assembly::draw(psxRegisters* registers, Memory* memory, Dwar
if (ImGui::IsItemHovered()) {
ImGui::BeginTooltip();
ImGui::PushTextWrapPos(glyphWidth * 35.0f);
ImGui::TextWrapped(_("Display arrows for jumps. This might crowd the display a bit too much."));
ImGui::TextUnformatted(_("Display arrows for jumps. This might crowd the display a bit too much."));
ImGui::PopTextWrapPos();
ImGui::EndTooltip();
}
Expand Down Expand Up @@ -637,7 +637,7 @@ void PCSX::Widgets::Assembly::draw(psxRegisters* registers, Memory* memory, Dwar
}

for (int i = 0; i < m_numColumns * ImGui::GetWindowDpiScale(); i++) {
ImGui::Text("");
ImGui::TextUnformatted("");
ImGui::SameLine();
}

Expand Down Expand Up @@ -930,7 +930,7 @@ void PCSX::Widgets::Assembly::draw(psxRegisters* registers, Memory* memory, Dwar
dwarf->m_pc = fmt::format("{:08x}", symbol.second);
}
ImGui::SameLine();
ImGui::Text(label.c_str());
ImGui::TextUnformatted(label.c_str());
}
}
ImGui::EndChild();
Expand Down
2 changes: 1 addition & 1 deletion src/gui/widgets/breakpoints.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void PCSX::Widgets::Breakpoints::draw(const char* title) {
ImGui::SameLine();
ImGui::Checkbox(_("Break on word write map"), &debugger->m_breakmp_w32);
ImGui::Separator();
ImGui::Text(_("Breakpoints"));
ImGui::TextUnformatted(_("Breakpoints"));
if (ImGui::Button(_("Show all breakpoints"))) {
m_filterE = m_filterR1 = m_filterR2 = m_filterR4 = m_filterW1 = m_filterW2 = m_filterW4 = true;
}
Expand Down
6 changes: 3 additions & 3 deletions src/gui/widgets/dwarf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,15 @@ void dumpTree(const dwarf::die& node, const PCSX::Elf& elf) {
if (ImGui::TreeNode(attribute.c_str())) {
auto strs = expr.to_strings();
for (auto& s : strs) {
ImGui::Text(s.c_str());
ImGui::TextUnformatted(s.c_str());
}
ImGui::TreePop();
}
break;
}
default: {
std::string attribute = fmt::format("{:30} {}", to_string(attr.first), to_string(attr.second));
ImGui::Text(attribute.c_str());
ImGui::TextUnformatted(attribute.c_str());
break;
}
}
Expand Down Expand Up @@ -148,7 +148,7 @@ void PCSX::Widgets::Dwarf::draw(const char* title) {
}
case BY_PC: {
auto [entry, stack] = e.findByAddress(strtoul(m_pc.c_str(), nullptr, 16));
if (entry.valid()) ImGui::Text(entry.get_description().c_str());
if (entry.valid()) ImGui::TextUnformatted(entry.get_description().c_str());
for (auto& d : stack) {
dumpTree(d, e);
}
Expand Down
12 changes: 6 additions & 6 deletions src/gui/widgets/filedialog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ bool PCSX::Widgets::FileDialog::draw() {

if (ImGui::Button(_("Home"))) goHome = true;
ImGui::SameLine();
ImGui::Text(reinterpret_cast<const char*>(m_currentPath.u8string().c_str()));
ImGui::TextUnformatted(reinterpret_cast<const char*>(m_currentPath.u8string().c_str()));
{
ImGui::BeginChild("Directories", ImVec2(250, 350), true, ImGuiWindowFlags_HorizontalScrollbar);
if (ImGui::TreeNode(_("Roots"))) {
Expand Down Expand Up @@ -304,11 +304,11 @@ bool PCSX::Widgets::FileDialog::draw() {
}
}
ImGui::SameLine();
ImGui::Text(reinterpret_cast<const char*>(p.filename.c_str()));
ImGui::TextUnformatted(reinterpret_cast<const char*>(p.filename.c_str()));
ImGui::NextColumn();
ImGui::Text(std::to_string(p.size).c_str());
ImGui::TextUnformatted(std::to_string(p.size).c_str());
ImGui::NextColumn();
ImGui::Text(p.dateTime.c_str());
ImGui::TextUnformatted(p.dateTime.c_str());
ImGui::NextColumn();

if (p.selected) selected = &p;
Expand All @@ -319,15 +319,15 @@ bool PCSX::Widgets::FileDialog::draw() {
PCSX::u8string selectedStr;
bool gotSelected = selected;
if (m_flags & NewFile) {
ImGui::Text(reinterpret_cast<const char*>(m_currentPath.u8string().c_str()));
ImGui::TextUnformatted(reinterpret_cast<const char*>(m_currentPath.u8string().c_str()));
ImGui::SameLine();
std::string label = std::string("##") + m_title() + "Filename";
InputText(label.c_str(), &m_newFile);
selectedStr = m_newFile;
gotSelected = !m_newFile.empty();
} else {
selectedStr = (m_currentPath / std::filesystem::path(selected ? selected->filename : MAKEU8(u8"..."))).u8string();
ImGui::Text(reinterpret_cast<const char*>(selectedStr.c_str()));
ImGui::TextUnformatted(reinterpret_cast<const char*>(selectedStr.c_str()));
}
if (!gotSelected) {
const ImVec4 lolight = ImGui::GetStyle().Colors[ImGuiCol_TextDisabled];
Expand Down

0 comments on commit c3a4c46

Please sign in to comment.