Flatbuffers Version 23.1.20 (#7794)

* Flatbuffers Version 23.1.20

* Fix warnings

* Fix warnings
This commit is contained in:
Michael Le
2023-01-21 12:03:17 -08:00
committed by GitHub
parent 991b39edbe
commit 1703662285
164 changed files with 224 additions and 220 deletions

View File

@@ -278,7 +278,7 @@ static std::string GenerateDocumentation(const BinaryRegion &region,
{
std::stringstream ss;
ss << std::setw(output_config.largest_type_string) << std::left;
ss << std::setw(static_cast<int>(output_config.largest_type_string)) << std::left;
ss << GenerateTypeString(region);
s += ss.str();
}
@@ -293,7 +293,7 @@ static std::string GenerateDocumentation(const BinaryRegion &region,
const std::string value = ToValueString(region, binary, output_config);
std::stringstream ss;
ss << std::setw(output_config.largest_value_string) << std::left;
ss << std::setw(static_cast<int>(output_config.largest_value_string)) << std::left;
ss << value.substr(0, output_config.max_bytes_per_line);
s += ss.str();
@@ -301,7 +301,7 @@ static std::string GenerateDocumentation(const BinaryRegion &region,
value.substr(std::min(output_config.max_bytes_per_line, value.size()));
} else {
std::stringstream ss;
ss << std::setw(output_config.largest_value_string) << std::left;
ss << std::setw(static_cast<int>(output_config.largest_value_string)) << std::left;
ss << ToValueString(region, binary, output_config);
s += ss.str();
}

View File

@@ -52,14 +52,14 @@ enum class BinaryRegionType {
template<typename T>
static inline std::string ToHex(T i, size_t width = sizeof(T)) {
std::stringstream stream;
stream << std::hex << std::uppercase << std::setfill('0') << std::setw(width)
stream << std::hex << std::uppercase << std::setfill('0') << std::setw(static_cast<int>(width))
<< i;
return stream.str();
}
// Specialized version for uint8_t that don't work well with std::hex.
static inline std::string ToHex(uint8_t i) {
return ToHex(static_cast<int>(i), 2);
return ToHex<int>(static_cast<int>(i), 2);
}
enum class BinaryRegionStatus {

View File

@@ -655,7 +655,7 @@ class CSharpGenerator : public BaseGenerator {
// Force compile time error if not using the same version runtime.
code += " public static void ValidateVersion() {";
code += " FlatBufferConstants.";
code += "FLATBUFFERS_23_1_4(); ";
code += "FLATBUFFERS_23_1_20(); ";
code += "}\n";
// Generate a special accessor for the table that when used as the root

View File

@@ -683,7 +683,7 @@ class JavaGenerator : public BaseGenerator {
// Force compile time error if not using the same version runtime.
code += " public static void ValidateVersion() {";
code += " Constants.";
code += "FLATBUFFERS_23_1_4(); ";
code += "FLATBUFFERS_23_1_20(); ";
code += "}\n";
// Generate a special accessor for the table that when used as the root

View File

@@ -524,7 +524,7 @@ class KotlinGenerator : public BaseGenerator {
// runtime.
GenerateFunOneLine(
writer, "validateVersion", "", "",
[&]() { writer += "Constants.FLATBUFFERS_23_1_4()"; },
[&]() { writer += "Constants.FLATBUFFERS_23_1_20()"; },
options.gen_jvmstatic);
GenerateGetRootAsAccessors(namer_.Type(struct_def), writer, options);

View File

@@ -1840,7 +1840,7 @@ class SwiftGenerator : public BaseGenerator {
}
std::string ValidateFunc() {
return "static func validateVersion() { FlatBuffersVersion_23_1_4() }";
return "static func validateVersion() { FlatBuffersVersion_23_1_20() }";
}
std::string GenType(const Type &type,