Codechange: rename byte to uint8_t (#12308)

This commit is contained in:
Patric Stout
2024-03-16 23:59:32 +01:00
committed by GitHub
parent bd7120bae4
commit a3cfd23cf9
355 changed files with 1654 additions and 1656 deletions

View File

@@ -20,7 +20,7 @@ static const char32_t NFO_UTF8_IDENTIFIER = 0x00DE;
/** A GRF text with associated language ID. */
struct GRFText {
byte langid; ///< The language associated with this GRFText.
uint8_t langid; ///< The language associated with this GRFText.
std::string text; ///< The actual (translated) text.
};
@@ -29,21 +29,21 @@ typedef std::vector<GRFText> GRFTextList;
/** Reference counted wrapper around a GRFText pointer. */
typedef std::shared_ptr<GRFTextList> GRFTextWrapper;
StringID AddGRFString(uint32_t grfid, uint16_t stringid, byte langid, bool new_scheme, bool allow_newlines, const char *text_to_add, StringID def_string);
StringID AddGRFString(uint32_t grfid, uint16_t stringid, uint8_t langid, bool new_scheme, bool allow_newlines, const char *text_to_add, StringID def_string);
StringID GetGRFStringID(uint32_t grfid, StringID stringid);
const char *GetGRFStringFromGRFText(const GRFTextList &text_list);
const char *GetGRFStringFromGRFText(const GRFTextWrapper &text);
const char *GetGRFStringPtr(uint32_t stringid);
void CleanUpStrings();
void SetCurrentGrfLangID(byte language_id);
void SetCurrentGrfLangID(uint8_t language_id);
std::string TranslateTTDPatchCodes(uint32_t grfid, uint8_t language_id, bool allow_newlines, const std::string &str, StringControlCode byte80 = SCC_NEWGRF_PRINT_WORD_STRING_ID);
void AddGRFTextToList(GRFTextList &list, byte langid, uint32_t grfid, bool allow_newlines, const char *text_to_add);
void AddGRFTextToList(GRFTextWrapper &list, byte langid, uint32_t grfid, bool allow_newlines, const char *text_to_add);
void AddGRFTextToList(GRFTextList &list, uint8_t langid, uint32_t grfid, bool allow_newlines, const char *text_to_add);
void AddGRFTextToList(GRFTextWrapper &list, uint8_t langid, uint32_t grfid, bool allow_newlines, const char *text_to_add);
void AddGRFTextToList(GRFTextWrapper &list, const std::string &text_to_add);
bool CheckGrfLangID(byte lang_id, byte grf_version);
bool CheckGrfLangID(uint8_t lang_id, uint8_t grf_version);
void StartTextRefStackUsage(const struct GRFFile *grffile, byte numEntries, const uint32_t *values = nullptr);
void StartTextRefStackUsage(const struct GRFFile *grffile, uint8_t numEntries, const uint32_t *values = nullptr);
void StopTextRefStackUsage();
bool UsingNewGRFTextStack();
struct TextRefStack *CreateTextRefStackBackup();
@@ -53,8 +53,8 @@ void RestoreTextRefStackBackup(struct TextRefStack *backup);
struct LanguageMap {
/** Mapping between NewGRF and OpenTTD IDs. */
struct Mapping {
byte newgrf_id; ///< NewGRF's internal ID for a case/gender.
byte openttd_id; ///< OpenTTD's internal ID for a case/gender.
uint8_t newgrf_id; ///< NewGRF's internal ID for a case/gender.
uint8_t openttd_id; ///< OpenTTD's internal ID for a case/gender.
};
/* We need a vector and can't use SmallMap due to the fact that for "setting" a