Fix conversion warnings/errors
See #411.
http://paste.debian.net/378673/
diff --git a/include/json/reader.h b/include/json/reader.h
index 0a1574f..70d9505 100644
--- a/include/json/reader.h
+++ b/include/json/reader.h
@@ -42,8 +42,8 @@
*
*/
struct StructuredError {
- size_t offset_start;
- size_t offset_limit;
+ ptrdiff_t offset_start;
+ ptrdiff_t offset_limit;
std::string message;
};
diff --git a/include/json/value.h b/include/json/value.h
index 1cfda07..b3f1ceb 100644
--- a/include/json/value.h
+++ b/include/json/value.h
@@ -554,10 +554,10 @@
// Accessors for the [start, limit) range of bytes within the JSON text from
// which this value was parsed, if any.
- void setOffsetStart(size_t start);
- void setOffsetLimit(size_t limit);
- size_t getOffsetStart() const;
- size_t getOffsetLimit() const;
+ void setOffsetStart(ptrdiff_t start);
+ void setOffsetLimit(ptrdiff_t limit);
+ ptrdiff_t getOffsetStart() const;
+ ptrdiff_t getOffsetLimit() const;
private:
void initBasic(ValueType type, bool allocated = false);
@@ -598,8 +598,8 @@
// [start, limit) byte offsets in the source JSON text from which this Value
// was extracted.
- size_t start_;
- size_t limit_;
+ ptrdiff_t start_;
+ ptrdiff_t limit_;
};
/** \brief Experimental and untested: represents an element of the "path" to
diff --git a/include/json/writer.h b/include/json/writer.h
index f94aa1f..180ab68 100644
--- a/include/json/writer.h
+++ b/include/json/writer.h
@@ -238,8 +238,8 @@
ChildValues childValues_;
std::string document_;
std::string indentString_;
- int rightMargin_;
- int indentSize_;
+ unsigned int rightMargin_;
+ unsigned int indentSize_;
bool addChildValues_;
};