Commit 42c08cbc authored by Derek Bailey's avatar Derek Bailey Committed by Wouter van Oortmerssen

Ran src/clang-format-all.sh (#5617)

parent 33d5dd9b
......@@ -34,11 +34,11 @@
#ifndef GRPC_INTERNAL_COMPILER_SCHEMA_INTERFACE_H
#define GRPC_INTERNAL_COMPILER_SCHEMA_INTERFACE_H
#include "src/compiler/config.h"
#include <memory>
#include <vector>
#include "src/compiler/config.h"
#ifndef GRPC_CUSTOM_STRING
# include <string>
# define GRPC_CUSTOM_STRING std::string
......
......@@ -14,17 +14,17 @@
* limitations under the License.
*/
#include <thread>
#include <grpc++/grpc++.h>
#include <thread>
#include "monster_test.grpc.fb.h"
#include "monster_test_generated.h"
#include "test_assert.h"
using namespace MyGame::Example;
using flatbuffers::grpc::MessageBuilder;
using flatbuffers::FlatBufferBuilder;
using flatbuffers::grpc::MessageBuilder;
void message_builder_tests();
......@@ -97,8 +97,7 @@ void RunServer() {
server_instance->Wait();
}
template <class Builder>
void StoreRPC(MonsterStorage::Stub *stub) {
template<class Builder> void StoreRPC(MonsterStorage::Stub *stub) {
Builder fbb;
grpc::ClientContext context;
// Build a request with the name set.
......@@ -119,8 +118,7 @@ void StoreRPC(MonsterStorage::Stub *stub) {
}
}
template <class Builder>
void RetrieveRPC(MonsterStorage::Stub *stub) {
template<class Builder> void RetrieveRPC(MonsterStorage::Stub *stub) {
Builder fbb;
grpc::ClientContext context;
fbb.Clear();
......@@ -155,7 +153,6 @@ int grpc_server_test() {
RetrieveRPC<MessageBuilder>(stub.get());
RetrieveRPC<FlatBufferBuilder>(stub.get());
#if !FLATBUFFERS_GRPC_DISABLE_AUTO_VERIFICATION
{
// Test that an invalid request errors out correctly
......@@ -181,7 +178,7 @@ int grpc_server_test() {
return 0;
}
int main(int /*argc*/, const char * /*argv*/ []) {
int main(int /*argc*/, const char * /*argv*/[]) {
message_builder_tests();
grpc_server_test();
......@@ -193,4 +190,3 @@ int main(int /*argc*/, const char * /*argv*/ []) {
return 1;
}
}
This diff is collapsed.
......@@ -228,7 +228,7 @@ inline std::string GetAnyVectorElemS(const VectorOfAny *vec,
template<typename T>
T *GetAnyVectorElemPointer(const VectorOfAny *vec, size_t i) {
auto elem_ptr = vec->Data() + sizeof(uoffset_t) * i;
return reinterpret_cast<T*>(elem_ptr + ReadScalar<uoffset_t>(elem_ptr));
return reinterpret_cast<T *>(elem_ptr + ReadScalar<uoffset_t>(elem_ptr));
}
// Get the inline-address of a vector element. Useful for Structs (pass Struct
......
......@@ -16,7 +16,6 @@
#include "flatbuffers/idl.h"
#include "flatbuffers/util.h"
#include "monster_generated.h" // Already includes "flatbuffers/flatbuffers.h".
using namespace MyGame::Sample;
......@@ -30,7 +29,8 @@ int main(int /*argc*/, const char * /*argv*/[]) {
std::string bfbs_file;
bool ok =
flatbuffers::LoadFile("tests/monster_test.fbs", false, &schema_file) &&
flatbuffers::LoadFile("tests/monsterdata_test.golden", false, &json_file) &&
flatbuffers::LoadFile("tests/monsterdata_test.golden", false,
&json_file) &&
flatbuffers::LoadFile("tests/monster_test.bfbs", true, &bfbs_file);
if (!ok) {
printf("couldn't load files!\n");
......
......@@ -20,7 +20,7 @@ using namespace MyGame::Sample;
// Example how to use FlatBuffers to create and read binary buffers.
int main(int /*argc*/, const char * /*argv*/ []) {
int main(int /*argc*/, const char * /*argv*/[]) {
// Build up a serialized buffer algorithmically:
flatbuffers::FlatBufferBuilder builder;
......
......@@ -16,14 +16,13 @@
#include "flatbuffers/idl.h"
#include "flatbuffers/util.h"
#include "monster_generated.h" // Already includes "flatbuffers/flatbuffers.h".
using namespace MyGame::Sample;
// This is an example of parsing text straight into a buffer and then
// generating flatbuffer (JSON) text from the buffer.
int main(int /*argc*/, const char * /*argv*/ []) {
int main(int /*argc*/, const char * /*argv*/[]) {
// load FlatBuffer schema (.fbs) and JSON from disk
std::string schemafile;
std::string jsonfile;
......
......@@ -1014,7 +1014,8 @@ class JsTsGenerator : public BaseGenerator {
}
// Adds the mutable scalar value to the output
if (IsScalar(field.value.type.base_type) && parser.opts.mutable_buffer && !IsUnion(field.value.type)) {
if (IsScalar(field.value.type.base_type) && parser.opts.mutable_buffer &&
!IsUnion(field.value.type)) {
std::string annotations = GenTypeAnnotation(
kParam, GenTypeName(field.value.type, true), "value");
GenDocComment(
......
......@@ -2308,7 +2308,6 @@ void InvalidNestedFlatbufferTest() {
TEST_EQ(parser1.Parse("{ name: \"Bender\", testnestedflatbuffer: { name: "
"\"Leela\", color: \"nonexistent\"}}"),
false);
// Check that Parser is destroyed correctly after parsing invalid json
}
void UnionVectorTest() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment