Codechange: rename byte to uint8_t (#12308)
This commit is contained in:
@@ -129,7 +129,7 @@ void SaveToHighScore()
|
||||
for (int i = 0; i < SP_SAVED_HIGHSCORE_END; i++) {
|
||||
for (HighScore &hs : _highscore_table[i]) {
|
||||
/* This code is weird and old fashioned to keep compatibility with the old high score files. */
|
||||
byte name_length = ClampTo<byte>(hs.name.size());
|
||||
uint8_t name_length = ClampTo<uint8_t>(hs.name.size());
|
||||
if (fwrite(&name_length, sizeof(name_length), 1, fp.get()) != 1 || // Write the string length of the name
|
||||
fwrite(hs.name.data(), name_length, 1, fp.get()) > 1 || // Yes... could be 0 bytes too
|
||||
fwrite(&hs.score, sizeof(hs.score), 1, fp.get()) != 1 ||
|
||||
@@ -153,7 +153,7 @@ void LoadFromHighScore()
|
||||
for (int i = 0; i < SP_SAVED_HIGHSCORE_END; i++) {
|
||||
for (HighScore &hs : _highscore_table[i]) {
|
||||
/* This code is weird and old fashioned to keep compatibility with the old high score files. */
|
||||
byte name_length;
|
||||
uint8_t name_length;
|
||||
char buffer[std::numeric_limits<decltype(name_length)>::max() + 1];
|
||||
|
||||
if (fread(&name_length, sizeof(name_length), 1, fp.get()) != 1 ||
|
||||
|
Reference in New Issue
Block a user