ppctests: Fix compiler warnings.

This commit is contained in:
joevt 2023-12-01 18:05:56 -08:00 committed by dingusdev
parent 60a76e9348
commit 566706dd62
2 changed files with 12 additions and 12 deletions

View File

@ -113,7 +113,7 @@ static void read_test_data() {
continue;
}
opcode = stoul(tokens[1], NULL, 16);
opcode = (uint32_t)stoul(tokens[1], NULL, 16);
dest = 0;
src1 = 0;
@ -123,15 +123,15 @@ static void read_test_data() {
for (i = 2; i < tokens.size(); i++) {
if (tokens[i].rfind("rD=", 0) == 0) {
dest = stoul(tokens[i].substr(3), NULL, 16);
dest = (uint32_t)stoul(tokens[i].substr(3), NULL, 16);
} else if (tokens[i].rfind("rA=", 0) == 0) {
src1 = stoul(tokens[i].substr(3), NULL, 16);
src1 = (uint32_t)stoul(tokens[i].substr(3), NULL, 16);
} else if (tokens[i].rfind("rB=", 0) == 0) {
src2 = stoul(tokens[i].substr(3), NULL, 16);
src2 = (uint32_t)stoul(tokens[i].substr(3), NULL, 16);
} else if (tokens[i].rfind("XER=", 0) == 0) {
check_xer = stoul(tokens[i].substr(4), NULL, 16);
check_xer = (uint32_t)stoul(tokens[i].substr(4), NULL, 16);
} else if (tokens[i].rfind("CR=", 0) == 0) {
check_cr = stoul(tokens[i].substr(3), NULL, 16);
check_cr = (uint32_t)stoul(tokens[i].substr(3), NULL, 16);
} else {
cout << "Unknown parameter " << tokens[i] << " in line " << lineno << ". Exiting..."
<< endl;
@ -227,7 +227,7 @@ static void read_test_float_data() {
continue;
}
opcode = stoul(tokens[1], NULL, 16);
opcode = (uint32_t)stoul(tokens[1], NULL, 16);
src1 = 0;
src2 = 0;
@ -253,9 +253,9 @@ static void read_test_float_data() {
} else if (tokens[i].rfind("round=", 0) == 0) {
rounding_mode = tokens[i].substr(6, 3);
} else if (tokens[i].rfind("FPSCR=", 0) == 0) {
check_fpscr = stoul(tokens[i].substr(6), NULL, 16);
check_fpscr = (uint32_t)stoul(tokens[i].substr(6), NULL, 16);
} else if (tokens[i].rfind("CR=", 0) == 0) {
check_cr = stoul(tokens[i].substr(3), NULL, 16);
check_cr = (uint32_t)stoul(tokens[i].substr(3), NULL, 16);
} else {
cout << "Unknown parameter " << tokens[i] << " in line " << lineno << ". Exiting..."
<< endl;

View File

@ -65,15 +65,15 @@ static vector<PPCDisasmContext> read_test_data() {
}
ctx = {0};
ctx.instr_addr = stoul(tokens[0], NULL, 16);
ctx.instr_code = stoul(tokens[1], NULL, 16);
ctx.instr_addr = (uint32_t)stoul(tokens[0], NULL, 16);
ctx.instr_code = (uint32_t)stoul(tokens[1], NULL, 16);
/* build disassembly string out of comma-separated parts */
ostringstream idisasm;
/* put instruction mnemonic padded with trailing spaces */
idisasm << tokens[2];
idisasm << setw(8 - tokens[2].length()) << " ";
idisasm << setw(8 - (int)tokens[2].length()) << " ";
/* now add comma-separated operands */
for (i = 3; i < tokens.size(); i++) {