Add CharToLower and CharToUpper into util.s (#6126)

This commit adds replacement of `::tolower` and `::toupper`.
Added CharToLower and CharToUpper routines reduce the number of cast operators
that required for correct usage of standard C/C++ `::tolower/toupper` routines.
This commit is contained in:
Vladimir Glavnyy
2020-09-21 23:31:27 +07:00
committed by GitHub
parent 8c67b5b129
commit fb4e1c34f9
7 changed files with 27 additions and 28 deletions

View File

@@ -94,7 +94,7 @@ class PythonGenerator : public BaseGenerator {
// Converts the name of a definition into lower Camel format.
std::string MakeLowerCamel(const Definition &definition) const {
auto name = MakeCamel(NormalizedName(definition), false);
name[0] = char(tolower(name[0]));
name[0] = CharToLower(name[0]);
return name;
}
@@ -1000,7 +1000,7 @@ class PythonGenerator : public BaseGenerator {
auto field_type_name = TypeName(field);
auto one_instance = field_type_name + "_";
one_instance[0] = char(tolower(one_instance[0]));
one_instance[0] = CharToLower(one_instance[0]);
if (parser_.opts.include_dependence_headers) {
auto package_reference = GenPackageReference(field.value.type);