Skip to content

Commit 3693e94

Browse files
committed
Fix output character type in writers
1 parent 942bb46 commit 3693e94

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

include/rapidjson/prettywriter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ class PrettyWriter : public Writer<OutputStream, SourceEncoding, TargetEncoding,
249249

250250
void WriteIndent() {
251251
size_t count = (Base::level_stack_.GetSize() / sizeof(typename Base::Level)) * indentCharCount_;
252-
PutN(*Base::os_, static_cast<typename TargetEncoding::Ch>(indentChar_), count);
252+
PutN(*Base::os_, static_cast<typename OutputStream::Ch>(indentChar_), count);
253253
}
254254

255255
Ch indentChar_;

include/rapidjson/writer.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ class Writer {
297297
const char* end = internal::i32toa(i, buffer);
298298
PutReserve(*os_, static_cast<size_t>(end - buffer));
299299
for (const char* p = buffer; p != end; ++p)
300-
PutUnsafe(*os_, static_cast<typename TargetEncoding::Ch>(*p));
300+
PutUnsafe(*os_, static_cast<typename OutputStream::Ch>(*p));
301301
return true;
302302
}
303303

@@ -306,7 +306,7 @@ class Writer {
306306
const char* end = internal::u32toa(u, buffer);
307307
PutReserve(*os_, static_cast<size_t>(end - buffer));
308308
for (const char* p = buffer; p != end; ++p)
309-
PutUnsafe(*os_, static_cast<typename TargetEncoding::Ch>(*p));
309+
PutUnsafe(*os_, static_cast<typename OutputStream::Ch>(*p));
310310
return true;
311311
}
312312

@@ -315,7 +315,7 @@ class Writer {
315315
const char* end = internal::i64toa(i64, buffer);
316316
PutReserve(*os_, static_cast<size_t>(end - buffer));
317317
for (const char* p = buffer; p != end; ++p)
318-
PutUnsafe(*os_, static_cast<typename TargetEncoding::Ch>(*p));
318+
PutUnsafe(*os_, static_cast<typename OutputStream::Ch>(*p));
319319
return true;
320320
}
321321

@@ -324,7 +324,7 @@ class Writer {
324324
char* end = internal::u64toa(u64, buffer);
325325
PutReserve(*os_, static_cast<size_t>(end - buffer));
326326
for (char* p = buffer; p != end; ++p)
327-
PutUnsafe(*os_, static_cast<typename TargetEncoding::Ch>(*p));
327+
PutUnsafe(*os_, static_cast<typename OutputStream::Ch>(*p));
328328
return true;
329329
}
330330

@@ -357,7 +357,7 @@ class Writer {
357357
}
358358

359359
bool WriteString(const Ch* str, SizeType length) {
360-
static const typename TargetEncoding::Ch hexDigits[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
360+
static const typename OutputStream::Ch hexDigits[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
361361
static const char escape[256] = {
362362
#define Z16 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
363363
//0 1 2 3 4 5 6 7 8 9 A B C D E F
@@ -413,7 +413,7 @@ class Writer {
413413
else if ((sizeof(Ch) == 1 || static_cast<unsigned>(c) < 256) && RAPIDJSON_UNLIKELY(escape[static_cast<unsigned char>(c)])) {
414414
is.Take();
415415
PutUnsafe(*os_, '\\');
416-
PutUnsafe(*os_, static_cast<typename TargetEncoding::Ch>(escape[static_cast<unsigned char>(c)]));
416+
PutUnsafe(*os_, static_cast<typename OutputStream::Ch>(escape[static_cast<unsigned char>(c)]));
417417
if (escape[static_cast<unsigned char>(c)] == 'u') {
418418
PutUnsafe(*os_, '0');
419419
PutUnsafe(*os_, '0');

0 commit comments

Comments
 (0)