summaryrefslogtreecommitdiff
path: root/lib/cpp/src/thrift/TReflectionLocal.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/cpp/src/thrift/TReflectionLocal.h')
-rw-r--r--lib/cpp/src/thrift/TReflectionLocal.h34
1 files changed, 15 insertions, 19 deletions
diff --git a/lib/cpp/src/thrift/TReflectionLocal.h b/lib/cpp/src/thrift/TReflectionLocal.h
index 2ef7511ba..2fc53c882 100644
--- a/lib/cpp/src/thrift/TReflectionLocal.h
+++ b/lib/cpp/src/thrift/TReflectionLocal.h
@@ -31,7 +31,10 @@
*
*/
-namespace apache { namespace thrift { namespace reflection { namespace local {
+namespace apache {
+namespace thrift {
+namespace reflection {
+namespace local {
using apache::thrift::protocol::TType;
@@ -47,7 +50,7 @@ struct FieldMeta {
struct TypeSpec {
TType ttype;
- uint8_t fp_prefix[FP_PREFIX_LEN];
+ uint8_t fp_prefix[FP_PREFIX_LEN];
// Use an anonymous union here so we can fit two TypeSpecs in one cache line.
union {
@@ -57,8 +60,8 @@ struct TypeSpec {
TypeSpec** specs;
} tstruct;
struct {
- TypeSpec *subtype1;
- TypeSpec *subtype2;
+ TypeSpec* subtype1;
+ TypeSpec* subtype2;
} tcontainer;
};
@@ -66,31 +69,24 @@ struct TypeSpec {
// so take the plunge and use constructors.
// Hopefully they'll be evaluated at compile time.
- TypeSpec(TType ttype) : ttype(ttype) {
- std::memset(fp_prefix, 0, FP_PREFIX_LEN);
- }
+ TypeSpec(TType ttype) : ttype(ttype) { std::memset(fp_prefix, 0, FP_PREFIX_LEN); }
- TypeSpec(TType ttype,
- const uint8_t* fingerprint,
- FieldMeta* metas,
- TypeSpec** specs) :
- ttype(ttype)
- {
+ TypeSpec(TType ttype, const uint8_t* fingerprint, FieldMeta* metas, TypeSpec** specs)
+ : ttype(ttype) {
std::memcpy(fp_prefix, fingerprint, FP_PREFIX_LEN);
tstruct.metas = metas;
tstruct.specs = specs;
}
- TypeSpec(TType ttype, TypeSpec* subtype1, TypeSpec* subtype2) :
- ttype(ttype)
- {
+ TypeSpec(TType ttype, TypeSpec* subtype1, TypeSpec* subtype2) : ttype(ttype) {
std::memset(fp_prefix, 0, FP_PREFIX_LEN);
tcontainer.subtype1 = subtype1;
tcontainer.subtype2 = subtype2;
}
-
};
-
-}}}} // apache::thrift::reflection::local
+}
+}
+}
+} // apache::thrift::reflection::local
#endif // #ifndef _THRIFT_TREFLECTIONLOCAL_H_