Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion grpc/src/compiler/ts_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,6 @@ grpc::string GenerateInterface(grpc_generator::File* file,
const grpc::string& filename) {
grpc::string output;

std::set<grpc::string> generated_functions;
std::map<grpc::string, grpc::string> vars;

vars["PATH"] = file->package();
Expand Down
2 changes: 0 additions & 2 deletions src/binary_annotator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -722,8 +722,6 @@ void BinaryAnnotator::BuildTable(const uint64_t table_offset,
BinaryRegionComment offset_field_comment;
offset_field_comment.type = BinaryRegionCommentType::TableOffsetField;
offset_field_comment.name = field->name()->c_str();
const std::string offset_prefix =
"offset to field `" + std::string(field->name()->c_str()) + "`";

// Validate any field that isn't inline (i.e., non-structs).
if (!IsInlineField(field)) {
Expand Down
2 changes: 0 additions & 2 deletions src/idl_gen_cpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2737,7 +2737,6 @@ class CppGenerator : public BaseGenerator {
if (!field.IsScalarOptional()) {
const bool is_scalar = IsScalar(type.base_type);
std::string accessor;
std::string offset_size = "";
if (is_scalar) {
accessor = "GetField<";
} else if (IsStruct(type)) {
Expand Down Expand Up @@ -2815,7 +2814,6 @@ class CppGenerator : public BaseGenerator {

void GenTableFieldType(const FieldDef& field) {
const auto& type = field.value.type;
const auto offset_str = GenFieldOffsetName(field);
if (!field.IsScalarOptional()) {
std::string afterptr = " *" + NullableExtension();
code_.SetValue("FIELD_TYPE",
Expand Down
2 changes: 0 additions & 2 deletions src/idl_gen_dart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1149,8 +1149,6 @@ static bool GenerateDart(const Parser& parser, const std::string& path,

static std::string DartMakeRule(const Parser& parser, const std::string& path,
const std::string& file_name) {
auto filebase =
flatbuffers::StripPath(flatbuffers::StripExtension(file_name));
dart::DartGenerator generator(parser, path, file_name);
auto make_rule = generator.Filename("") + ": ";

Expand Down
1 change: 0 additions & 1 deletion src/idl_gen_java.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2176,7 +2176,6 @@ 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);

code += " this." + namer_.Field(field) + " = ";
const auto type_name =
Expand Down
2 changes: 0 additions & 2 deletions src/idl_gen_kotlin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -966,8 +966,6 @@ class KotlinGenerator : public BaseGenerator {
auto bbgetter = ByteBufferGetter(field.value.type, "bb");
auto ucast = CastToUsigned(field);
auto offset_val = NumToString(field.value.offset);
auto offset_prefix =
"val o = __offset(" + offset_val + "); return o != 0 ? ";
auto value_base_type = field.value.type.base_type;
// Most field accessors need to retrieve and test the field offset
// first, this is the offset value for that:
Expand Down
5 changes: 0 additions & 5 deletions src/idl_gen_kotlin_kmp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ class KotlinKMPGenerator : public BaseGenerator {

std::string code =
"// " + std::string(FlatBuffersGeneratedWarning()) + "\n\n";
auto qualified = ns.GetFullyQualifiedName("");
std::string namespace_name = namer_.Namespace(ns);
if (!namespace_name.empty()) {
code += "package " + namespace_name;
Expand Down Expand Up @@ -341,7 +340,6 @@ class KotlinKMPGenerator : public BaseGenerator {
std::string GenDefaultBufferValue(const FieldDef& field) const {
auto& value = field.value;
auto base_type = value.type.base_type;
auto field_name = field.name;
std::string suffix = IsScalar(base_type) ? LiteralSuffix(value.type) : "";
if (field.IsScalarOptional()) {
return "null";
Expand Down Expand Up @@ -373,7 +371,6 @@ class KotlinKMPGenerator : public BaseGenerator {
std::string GenDefaultValue(const FieldDef& field) const {
auto& value = field.value;
auto base_type = value.type.base_type;
auto field_name = field.name;
std::string suffix = LiteralSuffix(value.type);
if (field.IsScalarOptional()) {
return "null";
Expand Down Expand Up @@ -1082,8 +1079,6 @@ class KotlinKMPGenerator : public BaseGenerator {
auto return_type = GetterReturnType(field);
auto bbgetter = ByteBufferGetter(field.value.type, "bb");
auto offset_val = NumToString(field.value.offset);
auto offset_prefix =
"val o = offset(" + offset_val + "); return o != 0 ? ";
auto value_base_type = field.value.type.base_type;
// Most field accessors need to retrieve and test the field offset
// first, this is the offset value for that:
Expand Down
2 changes: 0 additions & 2 deletions src/idl_gen_python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2010,8 +2010,6 @@ class PythonGenerator : public BaseGenerator {
void InitializeFromPackedBuf(const StructDef& struct_def,
std::string* code_ptr) const {
auto& code = *code_ptr;
const auto struct_var = namer_.Variable(struct_def);
const auto struct_type = namer_.Type(struct_def);

code += GenIndents(1) + "@classmethod";
code += GenIndents(1) + "def InitFromPackedBuf(cls, buf, pos=0):";
Expand Down
3 changes: 0 additions & 3 deletions src/idl_gen_swift.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,6 @@ class SwiftGenerator : public BaseGenerator {
}

void GenTableReaderFields(const FieldDef& field) {
const auto offset = NumToString(field.value.offset);
const auto field_field = namer_.Field(field);
const auto type = GenType(field.value.type);
code_.SetValue("FIELDVAR", namer_.Variable(field));
Expand Down Expand Up @@ -1142,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));
Expand Down Expand Up @@ -1382,7 +1380,6 @@ class SwiftGenerator : public BaseGenerator {
const auto& field = **it;
if (field.deprecated) continue;

const auto type = GenType(field.value.type);
code_.SetValue("FIELDVAR", namer_.Variable(field));
if (IsArray(field.value.type)) {
code_.SetValue(
Expand Down
5 changes: 0 additions & 5 deletions src/idl_gen_ts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ class TsGenerator : public BaseGenerator {
SkipDir::OutputPathAndTrailingPathSeparator);
symbolic_name = definition.defined_namespace->components.back();
} else {
auto def_mod_name = namer_.File(definition, SkipFile::SuffixAndExtension);
symbolic_name = file_name_;
filepath = path_ + symbolic_name + ".ts";
}
Expand Down Expand Up @@ -286,12 +285,10 @@ class TsGenerator : public BaseGenerator {
auto base_name =
namer_.Directories(it.second.ns->components, SkipDir::OutputPath) +
base_file_name;
auto ts_file_path = base_name + ".ts";
auto base_name_rel = std::string("./");
base_name_rel +=
namer_.Directories(rel_components, SkipDir::OutputPath);
base_name_rel += base_file_name;
auto ts_file_path_rel = base_name_rel + ".ts";
auto type_name = def.first;
auto fully_qualified_type_name =
it.second.ns->GetFullyQualifiedName(type_name);
Expand All @@ -311,7 +308,6 @@ class TsGenerator : public BaseGenerator {
const auto child_ns_level = it.second.ns->components.size() + 1;
for (const auto& it2 : ns_defs_) {
if (it2.second.ns->components.size() != child_ns_level) continue;
auto ts_file_path = it2.second.path + ".ts";
code += "export * as " + it2.second.symbolic_name + " from './";
int count = it2.second.ns->components.size() > 1 ? 2 : 1;
std::vector<std::string> rel_path;
Expand Down Expand Up @@ -1176,7 +1172,6 @@ class TsGenerator : public BaseGenerator {
if (union_type.enum_def) {
const auto& enum_def = *union_type.enum_def;
const auto enum_type = AddImport(imports, dependent, enum_def).name;
const std::string union_accessor = "this." + field_name;

const auto union_has_string = UnionHasStringType(enum_def);
const auto field_binded_method = "this." + field_name + ".bind(this)";
Expand Down
Loading