mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-29 20:02:01 +00:00
Fix typos in comments (#5590)
Found by the https://github.com/OSGeo/gdal/blob/master/gdal/scripts/fix_typos.sh script on the internal copy of flatbuffers inside GDAL
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
480815447a
commit
1b85292fd3
@@ -99,7 +99,7 @@
|
|||||||
#if !defined(__clang__) && \
|
#if !defined(__clang__) && \
|
||||||
defined(__GNUC__) && \
|
defined(__GNUC__) && \
|
||||||
(__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__ < 40600)
|
(__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__ < 40600)
|
||||||
// Backwards compatability for g++ 4.4, and 4.5 which don't have the nullptr
|
// Backwards compatibility for g++ 4.4, and 4.5 which don't have the nullptr
|
||||||
// and constexpr keywords. Note the __clang__ check is needed, because clang
|
// and constexpr keywords. Note the __clang__ check is needed, because clang
|
||||||
// presents itself as an older GNUC compiler.
|
// presents itself as an older GNUC compiler.
|
||||||
#ifndef nullptr_t
|
#ifndef nullptr_t
|
||||||
|
|||||||
@@ -2235,7 +2235,7 @@ class Verifier FLATBUFFERS_FINAL_CLASS {
|
|||||||
// Check the vtable offset.
|
// Check the vtable offset.
|
||||||
auto tableo = static_cast<size_t>(table - buf_);
|
auto tableo = static_cast<size_t>(table - buf_);
|
||||||
if (!Verify<soffset_t>(tableo)) return false;
|
if (!Verify<soffset_t>(tableo)) return false;
|
||||||
// This offset may be signed, but doing the substraction unsigned always
|
// This offset may be signed, but doing the subtraction unsigned always
|
||||||
// gives the result we want.
|
// gives the result we want.
|
||||||
auto vtableo = tableo - static_cast<size_t>(ReadScalar<soffset_t>(table));
|
auto vtableo = tableo - static_cast<size_t>(ReadScalar<soffset_t>(table));
|
||||||
// Check the vtable size field, then check vtable fits in its entirety.
|
// Check the vtable size field, then check vtable fits in its entirety.
|
||||||
|
|||||||
@@ -1054,7 +1054,7 @@ class Builder FLATBUFFERS_FINAL_CLASS {
|
|||||||
for (auto key = start; key < stack_.size(); key += 2) {
|
for (auto key = start; key < stack_.size(); key += 2) {
|
||||||
FLATBUFFERS_ASSERT(stack_[key].type_ == FBT_KEY);
|
FLATBUFFERS_ASSERT(stack_[key].type_ == FBT_KEY);
|
||||||
}
|
}
|
||||||
// Now sort values, so later we can do a binary seach lookup.
|
// Now sort values, so later we can do a binary search lookup.
|
||||||
// We want to sort 2 array elements at a time.
|
// We want to sort 2 array elements at a time.
|
||||||
struct TwoValue {
|
struct TwoValue {
|
||||||
Value key;
|
Value key;
|
||||||
|
|||||||
@@ -274,7 +274,7 @@ template<class T> class SerializationTraits<flatbuffers::grpc::Message<T>> {
|
|||||||
grpc_byte_buffer **buffer, bool *own_buffer) {
|
grpc_byte_buffer **buffer, bool *own_buffer) {
|
||||||
// We are passed in a `Message<T>`, which is a wrapper around a
|
// We are passed in a `Message<T>`, which is a wrapper around a
|
||||||
// `grpc_slice`. We extract it here using `BorrowSlice()`. The const cast
|
// `grpc_slice`. We extract it here using `BorrowSlice()`. The const cast
|
||||||
// is necesary because the `grpc_raw_byte_buffer_create` func expects
|
// is necessary because the `grpc_raw_byte_buffer_create` func expects
|
||||||
// non-const slices in order to increment their refcounts.
|
// non-const slices in order to increment their refcounts.
|
||||||
grpc_slice *slice = const_cast<grpc_slice *>(&msg.BorrowSlice());
|
grpc_slice *slice = const_cast<grpc_slice *>(&msg.BorrowSlice());
|
||||||
// Now use `grpc_raw_byte_buffer_create` to package the single slice into a
|
// Now use `grpc_raw_byte_buffer_create` to package the single slice into a
|
||||||
@@ -306,7 +306,7 @@ template<class T> class SerializationTraits<flatbuffers::grpc::Message<T>> {
|
|||||||
grpc_byte_buffer_reader_init(&reader, buffer);
|
grpc_byte_buffer_reader_init(&reader, buffer);
|
||||||
grpc_slice slice = grpc_byte_buffer_reader_readall(&reader);
|
grpc_slice slice = grpc_byte_buffer_reader_readall(&reader);
|
||||||
grpc_byte_buffer_reader_destroy(&reader);
|
grpc_byte_buffer_reader_destroy(&reader);
|
||||||
// We wrap a `Message<T>` around the slice, but dont increment refcount
|
// We wrap a `Message<T>` around the slice, but don't increment refcount
|
||||||
*msg = flatbuffers::grpc::Message<T>(slice, false);
|
*msg = flatbuffers::grpc::Message<T>(slice, false);
|
||||||
}
|
}
|
||||||
grpc_byte_buffer_destroy(buffer);
|
grpc_byte_buffer_destroy(buffer);
|
||||||
|
|||||||
Reference in New Issue
Block a user