Closed GrimSqueaker closed 3 years ago
It seems to be just commenting them out, not removing them.
Definitely the right step, just please best mark this commit (removing unused variables) so that we can copy the code from it, if necessary in future. Tom.
Some functions adresses is hardcoded in data/structures. I add all functions, when used in my gameplay by all game, may we find next functions when test multiplayer or VR(this code we can copy from commit before deleting unused code), Tom.
Exactly, Clang tidy does not remove them, this is still up to us, because it could be a function in a library for which you do not want to automatically change the ABI/API. But when we are working on a function and notice that some of the parameters are commented out, then we can safely change the declaration and the call in all calling functions. Moreover, we can also check, if the variables that were originally passed to the function become obsolete in the calling function. This, sadly, is nothing that can be automated AFAIK.
I did run Clang tidy in 64bit on Linux. This is why both CI failed. I should be able to re-run it in 32 bit mode which should definitely fix the Linux CI and then try to check with Windows as well.
You must before this action disable COMPILE_FOR_64BIT, else it disabling used variables: void sub_98709_create_index_dattab_power_add(uint8_t tabbuffer, uint8_t tabbufferend, uint8_t* /datbuffer/, posistruct_t* dattabindex, int add)//279709
IN: void sub_98709_create_index_dattab_power_add(uint8_t tabbuffer, uint8_t tabbufferend, uint8_t datbuffer, posistruct_t dattabindex, int add)//279709 { for (uint32_t i = 0; i < (tabbufferend - (tabbuffer + add)) / 6; i++) {
allert_error();
std::cout << "FIXME: 64bit @ function " << __FUNCTION__ << ", line " << __LINE__ << std::endl;
dattabindex[i].data = (uint8_t*)(*(uint32_t*)((tabbuffer + add) + 6 * i)) + **(int32_t)datbuffer;**
dattabindex[i].width = (tabbuffer + add)[6 * i + 4] * 2;
dattabindex[i].height = (tabbuffer + add)[6 * i + 5] * 2;
}
}
I used Clang tidy in "fix" mode for removing unused parameters. The purpose is to clarify which variables are used at all in functions so that we can simplify the code later on. Could you please check, if you are fine with that? (No need to look into details, just to see if you agree, because it touches a lot of lines of code) If so, I would like to explore other Clang tidy checks as well.