Skip to content
Open
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
2 changes: 1 addition & 1 deletion include/flatbuffers/code_generator.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class CodeGenerator {

enum Status {
OK = 0,
ERROR = 1,
ERROR_ = 1,
FAILED_VERIFICATION = 2,
NOT_IMPLEMENTED = 3
};
Expand Down
2 changes: 1 addition & 1 deletion include/flatbuffers/idl.h
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ struct IDLOptions {

// field case style options for C++
enum CaseStyle { CaseStyle_Unchanged = 0, CaseStyle_Upper, CaseStyle_Lower };
enum class ProtoIdGapAction { NO_OP, WARNING, ERROR };
enum class ProtoIdGapAction { NO_OP, WARNING, ERROR_ };
bool gen_jvmstatic;
// Use flexbuffers instead for binary and text generation
bool use_flexbuffers;
Expand Down
4 changes: 2 additions & 2 deletions src/bfbs_gen_lua.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ class LuaBfbsGenerator : public BaseBfbsGenerator {
FLATBUFFERS_OVERRIDE {
options_ = options;
if (!GenerateEnums(schema->enums())) {
return ERROR;
return ERROR_;
}
if (!GenerateObjects(schema->objects(), schema->root_table())) {
return ERROR;
return ERROR_;
}
return OK;
}
Expand Down
4 changes: 2 additions & 2 deletions src/flatc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ FlatCOptions FlatCompiler::ParseFromCommandLineArguments(int argc,
else if (!strcmp(argv[argi], "warn"))
opts.proto_id_gap_action = IDLOptions::ProtoIdGapAction::WARNING;
else if (!strcmp(argv[argi], "error"))
opts.proto_id_gap_action = IDLOptions::ProtoIdGapAction::ERROR;
opts.proto_id_gap_action = IDLOptions::ProtoIdGapAction::ERROR_;
else
Error("unknown case style: " + std::string(argv[argi]), true);
} else if (arg == "--schema") {
Expand Down Expand Up @@ -998,7 +998,7 @@ std::unique_ptr<Parser> FlatCompiler::GenerateCode(const FlatCOptions& options,
if (status == CodeGenerator::Status::NOT_IMPLEMENTED) {
Warn("GRPC interface generator not implemented for " +
code_generator->LanguageName());
} else if (status == CodeGenerator::Status::ERROR) {
} else if (status == CodeGenerator::Status::ERROR_) {
Error("Unable to generate GRPC interface for " +
code_generator->LanguageName());
}
Expand Down
2 changes: 1 addition & 1 deletion src/idl_gen_binary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class BinaryCodeGenerator : public CodeGenerator {
Status GenerateCode(const Parser& parser, const std::string& path,
const std::string& filename) override {
if (!GenerateBinary(parser, path, filename)) {
return Status::ERROR;
return Status::ERROR_;
}
return Status::OK;
}
Expand Down
4 changes: 2 additions & 2 deletions src/idl_gen_cpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4560,7 +4560,7 @@ class CppCodeGenerator : public CodeGenerator {
Status GenerateCode(const Parser& parser, const std::string& path,
const std::string& filename) override {
if (!GenerateCPP(parser, path, filename)) {
return Status::ERROR;
return Status::ERROR_;
}
return Status::OK;
}
Expand All @@ -4581,7 +4581,7 @@ class CppCodeGenerator : public CodeGenerator {
Status GenerateGrpcCode(const Parser& parser, const std::string& path,
const std::string& filename) override {
if (!GenerateCppGRPC(parser, path, filename)) {
return Status::ERROR;
return Status::ERROR_;
}
return Status::OK;
}
Expand Down
2 changes: 1 addition & 1 deletion src/idl_gen_csharp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2680,7 +2680,7 @@ class CSharpCodeGenerator : public CodeGenerator {
Status GenerateCode(const Parser& parser, const std::string& path,
const std::string& filename) override {
if (!GenerateCSharp(parser, path, filename)) {
return Status::ERROR;
return Status::ERROR_;
}
return Status::OK;
}
Expand Down
2 changes: 1 addition & 1 deletion src/idl_gen_dart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1187,7 +1187,7 @@ class DartCodeGenerator : public CodeGenerator {
Status GenerateCode(const Parser& parser, const std::string& path,
const std::string& filename) override {
if (!GenerateDart(parser, path, filename)) {
return Status::ERROR;
return Status::ERROR_;
}
return Status::OK;
}
Expand Down
4 changes: 2 additions & 2 deletions src/idl_gen_fbs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ static bool ProtobufIdSanityCheck(const StructDef& struct_def,
fprintf(stderr, "Fields in struct %s have gap between ids\n",
struct_def.name.c_str());
}
if (gap_action == IDLOptions::ProtoIdGapAction::ERROR) {
if (gap_action == IDLOptions::ProtoIdGapAction::ERROR_) {
return false;
}
}
Expand Down Expand Up @@ -430,7 +430,7 @@ class FBSCodeGenerator : public CodeGenerator {
Status GenerateCode(const Parser& parser, const std::string& path,
const std::string& filename) override {
if (!GenerateFBS(parser, path, filename, no_log_)) {
return Status::ERROR;
return Status::ERROR_;
}
return Status::OK;
}
Expand Down
4 changes: 2 additions & 2 deletions src/idl_gen_go.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1683,7 +1683,7 @@ class GoCodeGenerator : public CodeGenerator {
Status GenerateCode(const Parser& parser, const std::string& path,
const std::string& filename) override {
if (!GenerateGo(parser, path, filename)) {
return Status::ERROR;
return Status::ERROR_;
}
return Status::OK;
}
Expand All @@ -1705,7 +1705,7 @@ class GoCodeGenerator : public CodeGenerator {
Status GenerateGrpcCode(const Parser& parser, const std::string& path,
const std::string& filename) override {
if (!GenerateGoGRPC(parser, path, filename)) {
return Status::ERROR;
return Status::ERROR_;
}
return Status::OK;
}
Expand Down
4 changes: 2 additions & 2 deletions src/idl_gen_java.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2258,7 +2258,7 @@ class JavaCodeGenerator : public CodeGenerator {
Status GenerateCode(const Parser& parser, const std::string& path,
const std::string& filename) override {
if (!GenerateJava(parser, path, filename)) {
return Status::ERROR;
return Status::ERROR_;
}
return Status::OK;
}
Expand All @@ -2277,7 +2277,7 @@ class JavaCodeGenerator : public CodeGenerator {
Status GenerateGrpcCode(const Parser& parser, const std::string& path,
const std::string& filename) override {
if (!GenerateJavaGRPC(parser, path, filename)) {
return Status::ERROR;
return Status::ERROR_;
}
return Status::OK;
}
Expand Down
2 changes: 1 addition & 1 deletion src/idl_gen_json_schema.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ class JsonSchemaCodeGenerator : public CodeGenerator {
Status GenerateCode(const Parser& parser, const std::string& path,
const std::string& filename) override {
if (!GenerateJsonSchema(parser, path, filename)) {
return Status::ERROR;
return Status::ERROR_;
}
return Status::OK;
}
Expand Down
2 changes: 1 addition & 1 deletion src/idl_gen_kotlin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1672,7 +1672,7 @@ class KotlinCodeGenerator : public CodeGenerator {
Status GenerateCode(const Parser& parser, const std::string& path,
const std::string& filename) override {
if (!GenerateKotlin(parser, path, filename)) {
return Status::ERROR;
return Status::ERROR_;
}
return Status::OK;
}
Expand Down
2 changes: 1 addition & 1 deletion src/idl_gen_kotlin_kmp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1652,7 +1652,7 @@ class KotlinKMPCodeGenerator : public CodeGenerator {
Status GenerateCode(const Parser& parser, const std::string& path,
const std::string& filename) override {
if (!GenerateKotlinKMP(parser, path, filename)) {
return Status::ERROR;
return Status::ERROR_;
}
return Status::OK;
}
Expand Down
2 changes: 1 addition & 1 deletion src/idl_gen_lobster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ class LobsterCodeGenerator : public CodeGenerator {
Status GenerateCode(const Parser& parser, const std::string& path,
const std::string& filename) override {
if (!GenerateLobster(parser, path, filename)) {
return Status::ERROR;
return Status::ERROR_;
}
return Status::OK;
}
Expand Down
2 changes: 1 addition & 1 deletion src/idl_gen_php.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,7 @@ class PhpCodeGenerator : public CodeGenerator {
Status GenerateCode(const Parser& parser, const std::string& path,
const std::string& filename) override {
if (!GeneratePhp(parser, path, filename)) {
return Status::ERROR;
return Status::ERROR_;
}
return Status::OK;
}
Expand Down
4 changes: 2 additions & 2 deletions src/idl_gen_python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2996,7 +2996,7 @@ class PythonCodeGenerator : public CodeGenerator {
auto err = GeneratePython(parser, path, filename);
if (err) {
status_detail = " " + std::string(err);
return Status::ERROR;
return Status::ERROR_;
}
return Status::OK;
}
Expand All @@ -3019,7 +3019,7 @@ class PythonCodeGenerator : public CodeGenerator {
const std::string& filename) override {
if (!GeneratePythonGRPC(parser, path,
filename)) { // TODO add status GeneratePythonGRPC
return Status::ERROR;
return Status::ERROR_;
}
return Status::OK;
}
Expand Down
4 changes: 2 additions & 2 deletions src/idl_gen_rust.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3229,7 +3229,7 @@ class RustCodeGenerator : public CodeGenerator {
Status GenerateCode(const Parser& parser, const std::string& path,
const std::string& filename) override {
if (!GenerateRust(parser, path, filename)) {
return Status::ERROR;
return Status::ERROR_;
}
return Status::OK;
}
Expand All @@ -3256,7 +3256,7 @@ class RustCodeGenerator : public CodeGenerator {
Status GenerateRootFile(const Parser& parser,
const std::string& path) override {
if (!GenerateRustModuleRootFile(parser, path)) {
return Status::ERROR;
return Status::ERROR_;
}
return Status::OK;
}
Expand Down
4 changes: 2 additions & 2 deletions src/idl_gen_swift.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2065,7 +2065,7 @@ class SwiftCodeGenerator : public CodeGenerator {
Status GenerateCode(const Parser& parser, const std::string& path,
const std::string& filename) override {
if (!GenerateSwift(parser, path, filename)) {
return Status::ERROR;
return Status::ERROR_;
}
return Status::OK;
}
Expand All @@ -2077,7 +2077,7 @@ class SwiftCodeGenerator : public CodeGenerator {
Status GenerateGrpcCode(const Parser& parser, const std::string& path,
const std::string& filename) override {
if (!GenerateSwiftGRPC(parser, path, filename)) {
return Status::ERROR;
return Status::ERROR_;
}
return Status::OK;
}
Expand Down
2 changes: 1 addition & 1 deletion src/idl_gen_text.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ class TextCodeGenerator : public CodeGenerator {
auto err = GenTextFile(parser, path, filename);
if (err) {
status_detail = " (" + std::string(err) + ")";
return Status::ERROR;
return Status::ERROR_;
}
return Status::OK;
}
Expand Down
4 changes: 2 additions & 2 deletions src/idl_gen_ts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2421,7 +2421,7 @@ class TsCodeGenerator : public CodeGenerator {
Status GenerateCode(const Parser& parser, const std::string& path,
const std::string& filename) override {
if (!GenerateTS(parser, path, filename)) {
return Status::ERROR;
return Status::ERROR_;
}
return Status::OK;
}
Expand All @@ -2440,7 +2440,7 @@ class TsCodeGenerator : public CodeGenerator {
Status GenerateGrpcCode(const Parser& parser, const std::string& path,
const std::string& filename) override {
if (!GenerateTSGRPC(parser, path, filename)) {
return Status::ERROR;
return Status::ERROR_;
}
return Status::OK;
}
Expand Down