Update to 12.0-beta1

This commit is contained in:
dP
2021-08-15 14:57:29 +03:00
parent ac7d3eba75
commit 9df4f2c4fc
666 changed files with 61302 additions and 20466 deletions
+12 -4
View File
@@ -46,7 +46,11 @@ void CDECL strgen_warning(const char *s, ...)
va_start(va, s);
vseprintf(buf, lastof(buf), s, va);
va_end(va);
fprintf(stderr, LINE_NUM_FMT("warning"), _file, _cur_line, buf);
if (_show_todo > 0) {
fprintf(stderr, LINE_NUM_FMT("warning"), _file, _cur_line, buf);
} else {
fprintf(stderr, LINE_NUM_FMT("info"), _file, _cur_line, buf);
}
_warnings++;
}
@@ -273,13 +277,14 @@ struct HeaderFileWriter : HeaderWriter, FileWriter {
const char *real_filename;
/** The previous string ID that was printed. */
int prev;
uint total_strings;
/**
* Open a file to write to.
* @param filename The file to open.
*/
HeaderFileWriter(const char *filename) : FileWriter("tmp.xxx"),
real_filename(stredup(filename)), prev(0)
real_filename(stredup(filename)), prev(0), total_strings(0)
{
fprintf(this->fh, "/* This file is automatically generated. Do not modify */\n\n");
fprintf(this->fh, "#ifndef TABLE_STRINGS_H\n");
@@ -297,6 +302,7 @@ struct HeaderFileWriter : HeaderWriter, FileWriter {
if (prev + 1 != stringid) fprintf(this->fh, "\n");
fprintf(this->fh, "static const StringID %s = 0x%X;\n", name, stringid);
prev = stringid;
total_strings++;
}
void Finalise(const StringData &data)
@@ -311,8 +317,10 @@ struct HeaderFileWriter : HeaderWriter, FileWriter {
"\n"
"static const uint LANGUAGE_PACK_VERSION = 0x%X;\n"
"static const uint LANGUAGE_MAX_PLURAL = %u;\n"
"static const uint LANGUAGE_MAX_PLURAL_FORMS = %d;\n\n",
(uint)data.Version(), (uint)lengthof(_plural_forms), max_plural_forms
"static const uint LANGUAGE_MAX_PLURAL_FORMS = %d;\n"
"static const uint LANGUAGE_TOTAL_STRINGS = %u;\n"
"\n",
(uint)data.Version(), (uint)lengthof(_plural_forms), max_plural_forms, total_strings
);
fprintf(this->fh, "#endif /* TABLE_STRINGS_H */\n");