mirror of
https://github.com/google/flatbuffers.git
synced 2026-11-13 15:36:21 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9698e11376 |
@@ -75,17 +75,6 @@ extension Array where Element == Package.Dependency {
|
||||
.package(
|
||||
url: "https://github.com/grpc/grpc-swift-nio-transport.git",
|
||||
from: "2.0.0"),
|
||||
// swift-crypto arrives through grpc-swift-nio-transport -> swift-nio-ssl
|
||||
// and is otherwise resolved afresh on every build, because this package
|
||||
// ships no Package.resolved. 5.x asks for swift-tools-version 6.2, so only
|
||||
// the 6.2 CI job selects it - and then fails to compile it, because 5.x
|
||||
// uses `@nonexhaustive`, which the 6.2.x toolchains do not accept yet.
|
||||
// Stay on the last 4.x release that still builds with every toolchain in
|
||||
// the Swift CI matrix (4.3.0 declares swift-tools-version 6.0; 4.4+ asks
|
||||
// for 6.1 and would drop the 6.0 job).
|
||||
.package(
|
||||
url: "https://github.com/apple/swift-crypto.git",
|
||||
"4.0.0" ..< "4.4.0"),
|
||||
]
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -2814,6 +2814,7 @@ class CppGenerator : public BaseGenerator {
|
||||
|
||||
void GenTableFieldType(const FieldDef& field) {
|
||||
const auto& type = field.value.type;
|
||||
[[maybe_unused]] const auto offset_str = GenFieldOffsetName(field);
|
||||
if (!field.IsScalarOptional()) {
|
||||
std::string afterptr = " *" + NullableExtension();
|
||||
code_.SetValue("FIELD_TYPE",
|
||||
|
||||
@@ -2176,7 +2176,7 @@ class JavaGenerator : public BaseGenerator {
|
||||
if (field.deprecated) continue;
|
||||
if (field.value.type.base_type == BASE_TYPE_UTYPE) continue;
|
||||
if (field.value.type.element == BASE_TYPE_UTYPE) continue;
|
||||
const auto get_field = namer_.Method("get", field);
|
||||
[[maybe_unused]] const auto get_field = namer_.Method("get", field);
|
||||
|
||||
code += " this." + namer_.Field(field) + " = ";
|
||||
const auto type_name =
|
||||
|
||||
@@ -146,6 +146,7 @@ class KotlinKMPGenerator : public BaseGenerator {
|
||||
|
||||
std::string code =
|
||||
"// " + std::string(FlatBuffersGeneratedWarning()) + "\n\n";
|
||||
[[maybe_unused]] auto qualified = ns.GetFullyQualifiedName("");
|
||||
std::string namespace_name = namer_.Namespace(ns);
|
||||
if (!namespace_name.empty()) {
|
||||
code += "package " + namespace_name;
|
||||
|
||||
@@ -2010,6 +2010,8 @@ class PythonGenerator : public BaseGenerator {
|
||||
void InitializeFromPackedBuf(const StructDef& struct_def,
|
||||
std::string* code_ptr) const {
|
||||
auto& code = *code_ptr;
|
||||
[[maybe_unused]] const auto struct_var = namer_.Variable(struct_def);
|
||||
[[maybe_unused]] const auto struct_type = namer_.Type(struct_def);
|
||||
|
||||
code += GenIndents(1) + "@classmethod";
|
||||
code += GenIndents(1) + "def InitFromPackedBuf(cls, buf, pos=0):";
|
||||
|
||||
@@ -1141,7 +1141,6 @@ class SwiftGenerator : public BaseGenerator {
|
||||
it != struct_def.fields.vec.end(); ++it) {
|
||||
const auto& field = **it;
|
||||
if (field.deprecated) continue;
|
||||
const auto offset = NumToString(field.value.offset);
|
||||
|
||||
code_.SetValue("FIELDVAR", namer_.Variable(field));
|
||||
code_.SetValue("VALUETYPE", GenerateVerifierType(field));
|
||||
@@ -1381,6 +1380,7 @@ class SwiftGenerator : public BaseGenerator {
|
||||
const auto& field = **it;
|
||||
if (field.deprecated) continue;
|
||||
|
||||
[[maybe_unused]] const auto type = GenType(field.value.type);
|
||||
code_.SetValue("FIELDVAR", namer_.Variable(field));
|
||||
if (IsArray(field.value.type)) {
|
||||
code_.SetValue(
|
||||
|
||||
@@ -196,6 +196,8 @@ class TsGenerator : public BaseGenerator {
|
||||
SkipDir::OutputPathAndTrailingPathSeparator);
|
||||
symbolic_name = definition.defined_namespace->components.back();
|
||||
} else {
|
||||
[[maybe_unused]] auto def_mod_name =
|
||||
namer_.File(definition, SkipFile::SuffixAndExtension);
|
||||
symbolic_name = file_name_;
|
||||
filepath = path_ + symbolic_name + ".ts";
|
||||
}
|
||||
@@ -285,6 +287,7 @@ class TsGenerator : public BaseGenerator {
|
||||
auto base_name =
|
||||
namer_.Directories(it.second.ns->components, SkipDir::OutputPath) +
|
||||
base_file_name;
|
||||
[[maybe_unused]] auto ts_file_path = base_name + ".ts";
|
||||
auto base_name_rel = std::string("./");
|
||||
base_name_rel +=
|
||||
namer_.Directories(rel_components, SkipDir::OutputPath);
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Example {
|
||||
struct MonsterBinarySchema {
|
||||
static const uint8_t *data() {
|
||||
// Buffer containing the binary schema.
|
||||
alignas(uint64_t) static const uint8_t bfbsData[14520] = {
|
||||
static const uint8_t bfbsData[14520] = {
|
||||
0x20,0x00,0x00,0x00,0x42,0x46,0x42,0x53,0x00,0x00,0x00,0x00,0x14,0x00,0x20,0x00,0x04,0x00,0x08,0x00,
|
||||
0x0C,0x00,0x10,0x00,0x14,0x00,0x18,0x00,0x00,0x00,0x1C,0x00,0x14,0x00,0x00,0x00,0x58,0x00,0x00,0x00,
|
||||
0x34,0x00,0x00,0x00,0x24,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x70,0x0D,0x00,0x00,0x08,0x00,0x00,0x00,
|
||||
|
||||
Reference in New Issue
Block a user