mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-05 04:58:57 +00:00
Ran clang-format-all.sh. Removed default --style=file parameter (#6639)
* Ran clang-format-all.sh. Removed default --style=file parameter * Moved scripts to scripts/ location
This commit is contained in:
@@ -1397,12 +1397,10 @@ class Builder FLATBUFFERS_FINAL_CLASS {
|
||||
|
||||
template<typename T> static Type GetScalarType() {
|
||||
static_assert(flatbuffers::is_scalar<T>::value, "Unrelated types");
|
||||
return flatbuffers::is_floating_point<T>::value
|
||||
? FBT_FLOAT
|
||||
: flatbuffers::is_same<T, bool>::value
|
||||
? FBT_BOOL
|
||||
: (flatbuffers::is_unsigned<T>::value ? FBT_UINT
|
||||
: FBT_INT);
|
||||
return flatbuffers::is_floating_point<T>::value ? FBT_FLOAT
|
||||
: flatbuffers::is_same<T, bool>::value
|
||||
? FBT_BOOL
|
||||
: (flatbuffers::is_unsigned<T>::value ? FBT_UINT : FBT_INT);
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
@@ -307,15 +307,9 @@ struct FieldDef : public Definition {
|
||||
bool IsScalarOptional() const {
|
||||
return IsScalar(value.type.base_type) && IsOptional();
|
||||
}
|
||||
bool IsOptional() const {
|
||||
return presence == kOptional;
|
||||
}
|
||||
bool IsRequired() const {
|
||||
return presence == kRequired;
|
||||
}
|
||||
bool IsDefault() const {
|
||||
return presence == kDefault;
|
||||
}
|
||||
bool IsOptional() const { return presence == kOptional; }
|
||||
bool IsRequired() const { return presence == kRequired; }
|
||||
bool IsDefault() const { return presence == kDefault; }
|
||||
|
||||
Value value;
|
||||
bool deprecated; // Field is allowed to be present in old data, but can't be.
|
||||
|
||||
Reference in New Issue
Block a user