Remove ASSUME macro

It's dangerous and sometimes bluntly misused feature.
Its optimization potential is near-zero.
This commit is contained in:
Nekotekina 2020-12-10 13:37:26 +03:00
parent 61b882b2a6
commit b382d3b3e9
23 changed files with 40 additions and 68 deletions

View file

@ -367,7 +367,7 @@ static s32 savedata_check_args(u32 operation, u32 version, vm::cptr<char> dirNam
return 4;
}
case 0: break;
default: ASSUME(0);
default: fmt::throw_exception("Unreachable");
}
}
@ -426,7 +426,7 @@ static s32 savedata_check_args(u32 operation, u32 version, vm::cptr<char> dirNam
return 17;
}
case 0: break;
default: ASSUME(0);
default: fmt::throw_exception("Unreachable");
}
}
@ -776,7 +776,7 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v
break;
}
case 0: break;
default: ASSUME(0);
default: fmt::throw_exception("Unreachable");
}
selected_list.emplace(listSet->fixedList[i].dirName);
@ -826,7 +826,7 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v
break;
}
case 0: break;
default: ASSUME(0);
default: fmt::throw_exception("Unreachable");
}
}
@ -858,7 +858,7 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v
break;
}
case 0: break;
default: ASSUME(0);
default: fmt::throw_exception("Unreachable");
}
const std::string dirStr = listSet->focusDirName.get_ptr();
@ -1114,7 +1114,7 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v
return {CELL_SAVEDATA_ERROR_PARAM, "28"};
}
case 0: break;
default: ASSUME(0);
default: fmt::throw_exception("Unreachable");
}
const std::string dirStr = fixedSet->dirName.get_ptr();
@ -1973,7 +1973,7 @@ static NEVER_INLINE error_code savedata_get_list_item(vm::cptr<char> dirName, vm
return {CELL_SAVEDATA_ERROR_PARAM, "109"};
}
case 0: break;
default: ASSUME(0);
default: fmt::throw_exception("Unreachable");
}
const std::string base_dir = fmt::format("/dev_hdd0/home/%08u/savedata/", userId);