Skip to content

Commit c3a4c46

Browse files
authored
Merge pull request #212 from TotalCaesar659/warnings
Fix compilation warnings
2 parents 85c9ed7 + 2deb0c3 commit c3a4c46

5 files changed

Lines changed: 26 additions & 26 deletions

File tree

src/gui/gui.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -889,15 +889,15 @@ void PCSX::GUI::about() {
889889
checkGL();
890890
ImGui::TextWrapped("%s: %s", str, value);
891891
};
892-
ImGui::Text(_("OpenGL information"));
892+
ImGui::TextUnformatted(_("OpenGL information"));
893893
someString(_("vendor"), GL_VENDOR);
894894
someString(_("renderer"), GL_RENDERER);
895895
someString(_("version"), GL_VERSION);
896896
someString(_("shading language version"), GL_SHADING_LANGUAGE_VERSION);
897897
GLint n, i;
898898
glGetIntegerv(GL_NUM_EXTENSIONS, &n);
899899
checkGL();
900-
ImGui::Text(_("extensions:"));
900+
ImGui::TextUnformatted(_("extensions:"));
901901
ImGui::BeginChild("GLextensions", ImVec2(0, 0), true);
902902
for (i = 0; i < n; i++) {
903903
const char* extension = (const char*)glGetStringi(GL_EXTENSIONS, i);

src/gui/widgets/assembly.cc

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ void PCSX::Widgets::Assembly::GPR(uint8_t reg) {
138138
sameLine();
139139
ImGui::Text(" $");
140140
sameLine();
141-
ImGui::Text(s_disRNameGPR[reg]);
141+
ImGui::TextUnformatted(s_disRNameGPR[reg]);
142142
if (ImGui::IsItemHovered()) {
143143
ImGui::BeginTooltip();
144144
ImGui::PushTextWrapPos(ImGui::GetFontSize() * 35.0f);
@@ -152,7 +152,7 @@ void PCSX::Widgets::Assembly::CP0(uint8_t reg) {
152152
sameLine();
153153
ImGui::Text(" $");
154154
sameLine();
155-
ImGui::Text(s_disRNameCP0[reg]);
155+
ImGui::TextUnformatted(s_disRNameCP0[reg]);
156156
if (ImGui::IsItemHovered()) {
157157
ImGui::BeginTooltip();
158158
ImGui::PushTextWrapPos(ImGui::GetFontSize() * 35.0f);
@@ -166,7 +166,7 @@ void PCSX::Widgets::Assembly::CP2C(uint8_t reg) {
166166
sameLine();
167167
ImGui::Text(" $");
168168
sameLine();
169-
ImGui::Text(s_disRNameCP2C[reg]);
169+
ImGui::TextUnformatted(s_disRNameCP2C[reg]);
170170
if (ImGui::IsItemHovered()) {
171171
ImGui::BeginTooltip();
172172
ImGui::PushTextWrapPos(ImGui::GetFontSize() * 35.0f);
@@ -180,7 +180,7 @@ void PCSX::Widgets::Assembly::CP2D(uint8_t reg) {
180180
sameLine();
181181
ImGui::Text(" $");
182182
sameLine();
183-
ImGui::Text(s_disRNameCP2D[reg]);
183+
ImGui::TextUnformatted(s_disRNameCP2D[reg]);
184184
if (ImGui::IsItemHovered()) {
185185
ImGui::BeginTooltip();
186186
ImGui::PushTextWrapPos(ImGui::GetFontSize() * 35.0f);
@@ -263,7 +263,7 @@ void PCSX::Widgets::Assembly::Target(uint32_t value) {
263263
comma();
264264
sameLine();
265265
char label[21];
266-
ImGui::Text("");
266+
ImGui::TextUnformatted("");
267267
ImGui::SameLine();
268268
if (m_displayArrowForJumps) m_arrows.push_back({m_currentAddr, value});
269269
std::snprintf(label, sizeof(label), "0x%8.8x##%8.8x", value, m_currentAddr);
@@ -341,7 +341,7 @@ void PCSX::Widgets::Assembly::OfB(int16_t offset, uint8_t reg, int size) {
341341
std::snprintf(label, sizeof(label), "0x%4.4x($%s)##%08x", offset, s_disRNameGPR[reg], m_currentAddr);
342342
}
343343
uint32_t addr = m_registers->GPR.r[reg] + offset;
344-
ImGui::Text("");
344+
ImGui::TextUnformatted("");
345345
ImGui::SameLine();
346346
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0, 0));
347347
if (ImGui::Button(label)) jumpToMemory(addr, size);
@@ -368,7 +368,7 @@ void PCSX::Widgets::Assembly::BranchDest(uint32_t value) {
368368
comma();
369369
sameLine();
370370
char label[21];
371-
ImGui::Text("");
371+
ImGui::TextUnformatted("");
372372
ImGui::SameLine();
373373
m_arrows.push_back({m_currentAddr, value});
374374
std::snprintf(label, sizeof(label), "0x%8.8x##%8.8x", value, m_currentAddr);
@@ -398,7 +398,7 @@ void PCSX::Widgets::Assembly::Offset(uint32_t addr, int size) {
398398
std::string longLabel = label;
399399
auto symbols = findSymbol(addr);
400400
if (symbols.size() != 0) longLabel = *symbols.begin() + " ;" + label;
401-
ImGui::Text("");
401+
ImGui::TextUnformatted("");
402402
ImGui::SameLine();
403403
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0, 0));
404404
if (ImGui::Button(longLabel.c_str())) jumpToMemory(addr, size);
@@ -455,7 +455,7 @@ void PCSX::Widgets::Assembly::draw(psxRegisters* registers, Memory* memory, Dwar
455455
if (ImGui::IsItemHovered()) {
456456
ImGui::BeginTooltip();
457457
ImGui::PushTextWrapPos(glyphWidth * 35.0f);
458-
ImGui::TextWrapped(
458+
ImGui::TextUnformatted(
459459
_("When two instructions are detected to be a single pseudo-instruction, combine them into the "
460460
"actual pseudo-instruction."));
461461
ImGui::PopTextWrapPos();
@@ -465,7 +465,7 @@ void PCSX::Widgets::Assembly::draw(psxRegisters* registers, Memory* memory, Dwar
465465
if (ImGui::IsItemHovered()) {
466466
ImGui::BeginTooltip();
467467
ImGui::PushTextWrapPos(glyphWidth * 35.0f);
468-
ImGui::TextWrapped(
468+
ImGui::TextUnformatted(
469469
_("When combining two instructions into a single pseudo-instruction, add a placeholder for the "
470470
"second one."));
471471
ImGui::PopTextWrapPos();
@@ -475,7 +475,7 @@ void PCSX::Widgets::Assembly::draw(psxRegisters* registers, Memory* memory, Dwar
475475
if (ImGui::IsItemHovered()) {
476476
ImGui::BeginTooltip();
477477
ImGui::PushTextWrapPos(glyphWidth * 35.0f);
478-
ImGui::TextWrapped(
478+
ImGui::TextUnformatted(
479479
_("Add a small visible notch to indicate instructions that are on the delay slot of a branch."));
480480
ImGui::PopTextWrapPos();
481481
ImGui::EndTooltip();
@@ -484,7 +484,7 @@ void PCSX::Widgets::Assembly::draw(psxRegisters* registers, Memory* memory, Dwar
484484
if (ImGui::IsItemHovered()) {
485485
ImGui::BeginTooltip();
486486
ImGui::PushTextWrapPos(glyphWidth * 35.0f);
487-
ImGui::TextWrapped(_("Display arrows for jumps. This might crowd the display a bit too much."));
487+
ImGui::TextUnformatted(_("Display arrows for jumps. This might crowd the display a bit too much."));
488488
ImGui::PopTextWrapPos();
489489
ImGui::EndTooltip();
490490
}
@@ -637,7 +637,7 @@ void PCSX::Widgets::Assembly::draw(psxRegisters* registers, Memory* memory, Dwar
637637
}
638638

639639
for (int i = 0; i < m_numColumns * ImGui::GetWindowDpiScale(); i++) {
640-
ImGui::Text("");
640+
ImGui::TextUnformatted("");
641641
ImGui::SameLine();
642642
}
643643

@@ -930,7 +930,7 @@ void PCSX::Widgets::Assembly::draw(psxRegisters* registers, Memory* memory, Dwar
930930
dwarf->m_pc = fmt::format("{:08x}", symbol.second);
931931
}
932932
ImGui::SameLine();
933-
ImGui::Text(label.c_str());
933+
ImGui::TextUnformatted(label.c_str());
934934
}
935935
}
936936
ImGui::EndChild();

src/gui/widgets/breakpoints.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ void PCSX::Widgets::Breakpoints::draw(const char* title) {
5656
ImGui::SameLine();
5757
ImGui::Checkbox(_("Break on word write map"), &debugger->m_breakmp_w32);
5858
ImGui::Separator();
59-
ImGui::Text(_("Breakpoints"));
59+
ImGui::TextUnformatted(_("Breakpoints"));
6060
if (ImGui::Button(_("Show all breakpoints"))) {
6161
m_filterE = m_filterR1 = m_filterR2 = m_filterR4 = m_filterW1 = m_filterW2 = m_filterW4 = true;
6262
}

src/gui/widgets/dwarf.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,15 @@ void dumpTree(const dwarf::die& node, const PCSX::Elf& elf) {
8888
if (ImGui::TreeNode(attribute.c_str())) {
8989
auto strs = expr.to_strings();
9090
for (auto& s : strs) {
91-
ImGui::Text(s.c_str());
91+
ImGui::TextUnformatted(s.c_str());
9292
}
9393
ImGui::TreePop();
9494
}
9595
break;
9696
}
9797
default: {
9898
std::string attribute = fmt::format("{:30} {}", to_string(attr.first), to_string(attr.second));
99-
ImGui::Text(attribute.c_str());
99+
ImGui::TextUnformatted(attribute.c_str());
100100
break;
101101
}
102102
}
@@ -148,7 +148,7 @@ void PCSX::Widgets::Dwarf::draw(const char* title) {
148148
}
149149
case BY_PC: {
150150
auto [entry, stack] = e.findByAddress(strtoul(m_pc.c_str(), nullptr, 16));
151-
if (entry.valid()) ImGui::Text(entry.get_description().c_str());
151+
if (entry.valid()) ImGui::TextUnformatted(entry.get_description().c_str());
152152
for (auto& d : stack) {
153153
dumpTree(d, e);
154154
}

src/gui/widgets/filedialog.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ bool PCSX::Widgets::FileDialog::draw() {
179179

180180
if (ImGui::Button(_("Home"))) goHome = true;
181181
ImGui::SameLine();
182-
ImGui::Text(reinterpret_cast<const char*>(m_currentPath.u8string().c_str()));
182+
ImGui::TextUnformatted(reinterpret_cast<const char*>(m_currentPath.u8string().c_str()));
183183
{
184184
ImGui::BeginChild("Directories", ImVec2(250, 350), true, ImGuiWindowFlags_HorizontalScrollbar);
185185
if (ImGui::TreeNode(_("Roots"))) {
@@ -304,11 +304,11 @@ bool PCSX::Widgets::FileDialog::draw() {
304304
}
305305
}
306306
ImGui::SameLine();
307-
ImGui::Text(reinterpret_cast<const char*>(p.filename.c_str()));
307+
ImGui::TextUnformatted(reinterpret_cast<const char*>(p.filename.c_str()));
308308
ImGui::NextColumn();
309-
ImGui::Text(std::to_string(p.size).c_str());
309+
ImGui::TextUnformatted(std::to_string(p.size).c_str());
310310
ImGui::NextColumn();
311-
ImGui::Text(p.dateTime.c_str());
311+
ImGui::TextUnformatted(p.dateTime.c_str());
312312
ImGui::NextColumn();
313313

314314
if (p.selected) selected = &p;
@@ -319,15 +319,15 @@ bool PCSX::Widgets::FileDialog::draw() {
319319
PCSX::u8string selectedStr;
320320
bool gotSelected = selected;
321321
if (m_flags & NewFile) {
322-
ImGui::Text(reinterpret_cast<const char*>(m_currentPath.u8string().c_str()));
322+
ImGui::TextUnformatted(reinterpret_cast<const char*>(m_currentPath.u8string().c_str()));
323323
ImGui::SameLine();
324324
std::string label = std::string("##") + m_title() + "Filename";
325325
InputText(label.c_str(), &m_newFile);
326326
selectedStr = m_newFile;
327327
gotSelected = !m_newFile.empty();
328328
} else {
329329
selectedStr = (m_currentPath / std::filesystem::path(selected ? selected->filename : MAKEU8(u8"..."))).u8string();
330-
ImGui::Text(reinterpret_cast<const char*>(selectedStr.c_str()));
330+
ImGui::TextUnformatted(reinterpret_cast<const char*>(selectedStr.c_str()));
331331
}
332332
if (!gotSelected) {
333333
const ImVec4 lolight = ImGui::GetStyle().Colors[ImGuiCol_TextDisabled];

0 commit comments

Comments
 (0)