diff --git a/include/rapidjson/schema.h b/include/rapidjson/schema.h index 226fea4..5f25b9b 100644 --- a/include/rapidjson/schema.h +++ b/include/rapidjson/schema.h @@ -1831,7 +1831,7 @@ private: const PointerType relPointer(s, len, allocator_); if (relPointer.IsValid()) { // Get the subschema - if (const ValueType *v = relPointer.Get(*base)) { + if (const ValueType *pv = relPointer.Get(*base)) { // Now get the absolute JSON pointer by adding relative to base PointerType pointer(basePointer); for (SizeType i = 0; i < relPointer.GetTokenCount(); i++) @@ -1842,7 +1842,7 @@ private: // Call CreateSchema recursively, but first compute the in-scope id for the $ref target as we have jumped there // TODO: cache pointer <-> id mapping scopeId = pointer.GetUri(document, docId_); - CreateSchema(schema, pointer, *v, document, scopeId); + CreateSchema(schema, pointer, *pv, document, scopeId); return true; } } @@ -1852,14 +1852,14 @@ private: // See if the fragment matches an id in this document. // Search from the base we just established. Returns the subschema in the document and its absolute JSON pointer. PointerType pointer = PointerType(); - if (const ValueType *v = FindId(*base, ref, pointer, UriType(ref.GetBase()), true, basePointer)) { - if (v && !IsCyclicRef(pointer)) { + if (const ValueType *pv = FindId(*base, ref, pointer, UriType(ref.GetBase()), true, basePointer)) { + if (!IsCyclicRef(pointer)) { //GenericStringBuffer sb; //pointer.StringifyUriFragment(sb); // Call CreateSchema recursively, but first compute the in-scope id for the $ref target as we have jumped there // TODO: cache pointer <-> id mapping scopeId = pointer.GetUri(document, docId_); - CreateSchema(schema, pointer, *v, document, scopeId); + CreateSchema(schema, pointer, *pv, document, scopeId); return true; } } diff --git a/include/rapidjson/uri.h b/include/rapidjson/uri.h index 1e5b46f..e72976d 100644 --- a/include/rapidjson/uri.h +++ b/include/rapidjson/uri.h @@ -34,18 +34,18 @@ public: typedef std::basic_string String; // Constructors - GenericUri() {} + GenericUri() : uri_(), base_(), scheme_(), auth_(), path_(), query_(), frag_() {} - GenericUri(const String& uri) { + GenericUri(const String& uri) : uri_(), base_(), scheme_(), auth_(), path_(), query_(), frag_() { Parse(uri); } - GenericUri(const Ch* uri, SizeType len) { + GenericUri(const Ch* uri, SizeType len) : uri_(), base_(), scheme_(), auth_(), path_(), query_(), frag_() { Parse(String(uri, len)); } // Use with specializations of GenericValue - template GenericUri(const T& uri) { + template GenericUri(const T& uri) : uri_(), base_(), scheme_(), auth_(), path_(), query_(), frag_() { Parse(uri.template Get()); } @@ -236,13 +236,13 @@ private: //std::cout << "Final Temp: '" << temp.c_str() << "' Final Path: '" << path.c_str() << "'" << std::endl; } - String uri_ = String(); // Full uri - String base_ = String(); // Everything except fragment - String scheme_ = String(); // Includes the : - String auth_ = String(); // Includes the // - String path_ = String(); // Absolute if starts with / - String query_ = String(); // Includes the ? - String frag_ = String(); // Includes the # + String uri_; // Full uri + String base_; // Everything except fragment + String scheme_; // Includes the : + String auth_; // Includes the // + String path_; // Absolute if starts with / + String query_; // Includes the ? + String frag_; // Includes the # }; //! GenericUri for Value (UTF-8, default allocator).