Merge branch 'master' into jgrpp

Remove 'byte' typedef
This commit is contained in:
Jonathan G Rennison
2024-05-07 17:21:50 +01:00
376 changed files with 2220 additions and 2152 deletions

View File

@@ -422,7 +422,7 @@ struct LanguageFileWriter : LanguageWriter, FileWriter {
void WriteHeader(const LanguagePackHeader *header) override
{
this->Write((const byte *)header, sizeof(*header));
this->Write((const uint8_t *)header, sizeof(*header));
}
void Finalise() override
@@ -433,7 +433,7 @@ struct LanguageFileWriter : LanguageWriter, FileWriter {
this->FileWriter::Finalise();
}
void Write(const byte *buffer, size_t length) override
void Write(const uint8_t *buffer, size_t length) override
{
if (length == 0) return;
if (fwrite(buffer, sizeof(*buffer), length, this->fh) != length) {

View File

@@ -136,7 +136,7 @@ struct LanguageWriter {
* @param buffer The buffer to write.
* @param length The amount of byte to write.
*/
virtual void Write(const byte *buffer, size_t length) = 0;
virtual void Write(const uint8_t *buffer, size_t length) = 0;
/**
* Finalise writing the file.

View File

@@ -170,12 +170,12 @@ static ParsedCommandStruct _cur_pcs;
static int _cur_argidx;
/** The buffer for writing a single string. */
struct Buffer : std::vector<byte> {
struct Buffer : std::vector<uint8_t> {
/**
* Convenience method for adding a byte.
* @param value The value to add.
*/
void AppendByte(byte value)
void AppendByte(uint8_t value)
{
this->push_back(value);
}
@@ -313,7 +313,7 @@ static int TranslateArgumentIdx(int arg, int offset = 0);
static void EmitWordList(Buffer *buffer, const char * const *words, uint nw)
{
buffer->AppendByte(nw);
for (uint i = 0; i < nw; i++) buffer->AppendByte((byte)strlen(words[i]) + 1);
for (uint i = 0; i < nw; i++) buffer->AppendByte((uint8_t)strlen(words[i]) + 1);
for (uint i = 0; i < nw; i++) {
for (uint j = 0; words[i][j] != '\0'; j++) buffer->AppendByte(words[i][j]);
buffer->AppendByte(0);
@@ -943,7 +943,7 @@ void LanguageWriter::WriteLength(uint length)
buffer[offs++] = (length >> 8) | 0xC0;
}
buffer[offs++] = length & 0xFF;
this->Write((byte*)buffer, offs);
this->Write((uint8_t*)buffer, offs);
}
/**
@@ -1020,7 +1020,7 @@ void LanguageWriter::WriteLang(const StringData &data)
* <0x9E> <NUM CASES> <CASE1> <LEN1> <STRING1> <CASE2> <LEN2> <STRING2> <CASE3> <LEN3> <STRING3> <STRINGDEFAULT>
* Each LEN is printed using 2 bytes in big endian order. */
buffer.AppendUtf8(SCC_SWITCH_CASE);
buffer.AppendByte((byte)ls->translated_cases.size());
buffer.AppendByte((uint8_t)ls->translated_cases.size());
/* Write each case */
for (const Case &c : ls->translated_cases) {