joncmu / rapidjson

Automatically exported from code.google.com/p/rapidjson
MIT License
0 stars 0 forks source link

rapidjson::GenericDocument<rapidjson::UTF16<>> compile error #14

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.rapidjson::GenericDocument<rapidjson::UTF16<>>  document;
2.
3.

What is the expected output? What do you see instead?
I've expected work with Unicode String buffer but I had compile error instead 

Error was at this place 
data_.s.str = (char*)allocator.Malloc(length + 1);

function:

void SetStringRaw(const Ch* s, SizeType length, Allocator& allocator) {
  RAPIDJSON_ASSERT(s != NULL);
  flags_ = kCopyStringFlag;
  data_.s.str = (char*)allocator.Malloc(length + 1);
  data_.s.length = length;
  memcpy((void*)data_.s.str, s, length);
  ((char*)data_.s.str)[length] = '\0';
}

I changed to 

void SetStringRaw(const Ch* s, SizeType length, Allocator& allocator) {
  RAPIDJSON_ASSERT(s != NULL);
  flags_ = kCopyStringFlag;
  data_.s.str = (Ch*)allocator.Malloc(length + 1);
  data_.s.length = length;
  memcpy((void*)data_.s.str, s, length);
  ((char*)data_.s.str)[length] = '\0';
}

value data_s.str has  the  Ch* type  

What version of the product are you using? On what operating system?
I use the last version from code.google.com. VS2010Prof sp1 compiler WinXP Sp3 
system

Please provide any additional information below.

Original issue reported on code.google.com by vitaly....@gmail.com on 14 Feb 2012 at 7:59

GoogleCodeExporter commented 9 years ago

Original comment by milo...@gmail.com on 14 Feb 2012 at 10:02

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r56.

Original comment by milo...@gmail.com on 19 Feb 2012 at 2:59