Skip to content

Commit 32722fa

Browse files
author
Steve Hanson
committed
satisfy all compilers
1 parent 8768b5b commit 32722fa

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

include/rapidjson/schema.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1831,7 +1831,7 @@ class GenericSchemaDocument {
18311831
const PointerType relPointer(s, len, allocator_);
18321832
if (relPointer.IsValid()) {
18331833
// Get the subschema
1834-
if (const ValueType *v = relPointer.Get(*base)) {
1834+
if (const ValueType *pv = relPointer.Get(*base)) {
18351835
// Now get the absolute JSON pointer by adding relative to base
18361836
PointerType pointer(basePointer);
18371837
for (SizeType i = 0; i < relPointer.GetTokenCount(); i++)
@@ -1842,7 +1842,7 @@ class GenericSchemaDocument {
18421842
// Call CreateSchema recursively, but first compute the in-scope id for the $ref target as we have jumped there
18431843
// TODO: cache pointer <-> id mapping
18441844
scopeId = pointer.GetUri(document, docId_);
1845-
CreateSchema(schema, pointer, *v, document, scopeId);
1845+
CreateSchema(schema, pointer, *pv, document, scopeId);
18461846
return true;
18471847
}
18481848
}
@@ -1852,14 +1852,14 @@ class GenericSchemaDocument {
18521852
// See if the fragment matches an id in this document.
18531853
// Search from the base we just established. Returns the subschema in the document and its absolute JSON pointer.
18541854
PointerType pointer = PointerType();
1855-
if (const ValueType *v = FindId(*base, ref, pointer, UriType(ref.GetBase()), true, basePointer)) {
1856-
if (v && !IsCyclicRef(pointer)) {
1855+
if (const ValueType *pv = FindId(*base, ref, pointer, UriType(ref.GetBase()), true, basePointer)) {
1856+
if (!IsCyclicRef(pointer)) {
18571857
//GenericStringBuffer<EncodingType> sb;
18581858
//pointer.StringifyUriFragment(sb);
18591859
// Call CreateSchema recursively, but first compute the in-scope id for the $ref target as we have jumped there
18601860
// TODO: cache pointer <-> id mapping
18611861
scopeId = pointer.GetUri(document, docId_);
1862-
CreateSchema(schema, pointer, *v, document, scopeId);
1862+
CreateSchema(schema, pointer, *pv, document, scopeId);
18631863
return true;
18641864
}
18651865
}

include/rapidjson/uri.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,18 @@ class GenericUri {
3434
typedef std::basic_string<Ch> String;
3535

3636
// Constructors
37-
GenericUri() {}
37+
GenericUri() : uri_(), base_(), scheme_(), auth_(), path_(), query_(), frag_() {}
3838

39-
GenericUri(const String& uri) {
39+
GenericUri(const String& uri) : uri_(), base_(), scheme_(), auth_(), path_(), query_(), frag_() {
4040
Parse(uri);
4141
}
4242

43-
GenericUri(const Ch* uri, SizeType len) {
43+
GenericUri(const Ch* uri, SizeType len) : uri_(), base_(), scheme_(), auth_(), path_(), query_(), frag_() {
4444
Parse(String(uri, len));
4545
}
4646

4747
// Use with specializations of GenericValue
48-
template<typename T> GenericUri(const T& uri) {
48+
template<typename T> GenericUri(const T& uri) : uri_(), base_(), scheme_(), auth_(), path_(), query_(), frag_() {
4949
Parse(uri.template Get<String>());
5050
}
5151

@@ -236,13 +236,13 @@ class GenericUri {
236236
//std::cout << "Final Temp: '" << temp.c_str() << "' Final Path: '" << path.c_str() << "'" << std::endl;
237237
}
238238

239-
String uri_ = String(); // Full uri
240-
String base_ = String(); // Everything except fragment
241-
String scheme_ = String(); // Includes the :
242-
String auth_ = String(); // Includes the //
243-
String path_ = String(); // Absolute if starts with /
244-
String query_ = String(); // Includes the ?
245-
String frag_ = String(); // Includes the #
239+
String uri_; // Full uri
240+
String base_; // Everything except fragment
241+
String scheme_; // Includes the :
242+
String auth_; // Includes the //
243+
String path_; // Absolute if starts with /
244+
String query_; // Includes the ?
245+
String frag_; // Includes the #
246246
};
247247

248248
//! GenericUri for Value (UTF-8, default allocator).

0 commit comments

Comments
 (0)