From 4c4aae87d5a799553931c63fd53eeed36397532c Mon Sep 17 00:00:00 2001 From: Hamdi Sahloul Date: Fri, 9 Oct 2015 00:21:26 +0900 Subject: VS2010 compatibility of address initalization VS2010 cannot compile json_util_test.cc since it assumes NULL as a zero (int), and therefore cannot convert into to char* --- src/google/protobuf/util/json_util_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/google/protobuf/util/json_util_test.cc b/src/google/protobuf/util/json_util_test.cc index f4dc3562..2da06a7c 100644 --- a/src/google/protobuf/util/json_util_test.cc +++ b/src/google/protobuf/util/json_util_test.cc @@ -163,7 +163,7 @@ typedef pair Segment; class SegmentedZeroCopyOutputStream : public io::ZeroCopyOutputStream { public: explicit SegmentedZeroCopyOutputStream(list segments) - : segments_(segments), last_segment_(NULL, 0), byte_count_(0) {} + : segments_(segments), last_segment_((char*)NULL, 0), byte_count_(0) {} virtual bool Next(void** buffer, int* length) { if (segments_.empty()) { -- cgit v1.2.3 From 4ead55c3704d3304999efc3cd99e9e77ba8a6e1c Mon Sep 17 00:00:00 2001 From: Hamdi Sahloul Date: Fri, 9 Oct 2015 05:10:30 +0900 Subject: Use static cast Used static cast to improve initalization compatibility with MSVC2010 --- src/google/protobuf/util/json_util_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/google/protobuf/util/json_util_test.cc b/src/google/protobuf/util/json_util_test.cc index 2da06a7c..da68495f 100644 --- a/src/google/protobuf/util/json_util_test.cc +++ b/src/google/protobuf/util/json_util_test.cc @@ -163,7 +163,7 @@ typedef pair Segment; class SegmentedZeroCopyOutputStream : public io::ZeroCopyOutputStream { public: explicit SegmentedZeroCopyOutputStream(list segments) - : segments_(segments), last_segment_((char*)NULL, 0), byte_count_(0) {} + : segments_(segments), last_segment_(static_cast(NULL), 0), byte_count_(0) {} virtual bool Next(void** buffer, int* length) { if (segments_.empty()) { -- cgit v1.2.3