Skip to content

Commit

Permalink
Merge pull request #2 from msbit/qt514
Browse files Browse the repository at this point in the history
Replace `QString::sprintf` with `QString::asprintf`
  • Loading branch information
jdratlif authored Sep 10, 2022
2 parents ae7c47a + e390110 commit df478de
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions source/view/geniedialog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,14 @@ void GenieDialog::decode() {
NESGameGenieCode ggcode = NESGameGenieCode::create(text);
NESRawCode rawcode = Decoder::decodeNES(ggcode);

str.sprintf("%02X", rawcode.getValue());
str = QString::asprintf("%02X", rawcode.getValue());
ui.valueEdit->setText(str);

str.sprintf("%04X", rawcode.getAddress());
str = QString::asprintf("%04X", rawcode.getAddress());
ui.addressEdit->setText(str);

if (rawcode.hasCompare()) {
str.sprintf("%02X", rawcode.getCompare());
str = QString::asprintf("%02X", rawcode.getCompare());
ui.compareEdit->setText(str);
} else {
ui.compareEdit->clear();
Expand All @@ -115,32 +115,32 @@ void GenieDialog::decode() {
SNESGameGenieCode ggcode = SNESGameGenieCode::create(text);
SNESRawCode rawcode = Decoder::decodeSNES(ggcode);

str.sprintf("%02X", rawcode.getValue());
str = QString::asprintf("%02X", rawcode.getValue());
ui.valueEdit->setText(str);

str.sprintf("%04X", rawcode.getAddress());
str = QString::asprintf("%04X", rawcode.getAddress());
ui.addressEdit->setText(str);
} else if (system == GENESIS) {
GenesisGameGenieCode ggcode = GenesisGameGenieCode::create(text);
GenesisRawCode rawcode = Decoder::decodeGenesis(ggcode);

str.sprintf("%04X", rawcode.getValue());
str = QString::asprintf("%04X", rawcode.getValue());
ui.valueEdit->setText(str);

str.sprintf("%04X", rawcode.getAddress());
str = QString::asprintf("%04X", rawcode.getAddress());
ui.addressEdit->setText(str);
} else if (system == GBGG) {
GBGGGameGenieCode ggcode = GBGGGameGenieCode::create(text);
GBGGRawCode rawcode = Decoder::decodeGBGG(ggcode);

str.sprintf("%02X", rawcode.getValue());
str = QString::asprintf("%02X", rawcode.getValue());
ui.valueEdit->setText(str);

str.sprintf("%04X", rawcode.getAddress());
str = QString::asprintf("%04X", rawcode.getAddress());
ui.addressEdit->setText(str);

if (rawcode.hasCompare()) {
str.sprintf("%02X", rawcode.getCompare());
str = QString::asprintf("%02X", rawcode.getCompare());
ui.compareEdit->setText(str);
} else {
ui.compareEdit->clear();
Expand Down

0 comments on commit df478de

Please sign in to comment.