Skip to content

Commit 33443e6

Browse files
authored
Merge pull request Tencent#967 from TomaszNo/storage-class-first
Storage class is not first - encodings.h
2 parents 3202b0a + 77d2fad commit 33443e6

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

include/rapidjson/encodings.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -620,28 +620,28 @@ struct AutoUTF {
620620
#define RAPIDJSON_ENCODINGS_FUNC(x) UTF8<Ch>::x, UTF16LE<Ch>::x, UTF16BE<Ch>::x, UTF32LE<Ch>::x, UTF32BE<Ch>::x
621621

622622
template<typename OutputStream>
623-
RAPIDJSON_FORCEINLINE static void Encode(OutputStream& os, unsigned codepoint) {
623+
static RAPIDJSON_FORCEINLINE void Encode(OutputStream& os, unsigned codepoint) {
624624
typedef void (*EncodeFunc)(OutputStream&, unsigned);
625625
static const EncodeFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(Encode) };
626626
(*f[os.GetType()])(os, codepoint);
627627
}
628628

629629
template<typename OutputStream>
630-
RAPIDJSON_FORCEINLINE static void EncodeUnsafe(OutputStream& os, unsigned codepoint) {
630+
static RAPIDJSON_FORCEINLINE void EncodeUnsafe(OutputStream& os, unsigned codepoint) {
631631
typedef void (*EncodeFunc)(OutputStream&, unsigned);
632632
static const EncodeFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(EncodeUnsafe) };
633633
(*f[os.GetType()])(os, codepoint);
634634
}
635635

636636
template <typename InputStream>
637-
RAPIDJSON_FORCEINLINE static bool Decode(InputStream& is, unsigned* codepoint) {
637+
static RAPIDJSON_FORCEINLINE bool Decode(InputStream& is, unsigned* codepoint) {
638638
typedef bool (*DecodeFunc)(InputStream&, unsigned*);
639639
static const DecodeFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(Decode) };
640640
return (*f[is.GetType()])(is, codepoint);
641641
}
642642

643643
template <typename InputStream, typename OutputStream>
644-
RAPIDJSON_FORCEINLINE static bool Validate(InputStream& is, OutputStream& os) {
644+
static RAPIDJSON_FORCEINLINE bool Validate(InputStream& is, OutputStream& os) {
645645
typedef bool (*ValidateFunc)(InputStream&, OutputStream&);
646646
static const ValidateFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(Validate) };
647647
return (*f[is.GetType()])(is, os);
@@ -658,7 +658,7 @@ template<typename SourceEncoding, typename TargetEncoding>
658658
struct Transcoder {
659659
//! Take one Unicode codepoint from source encoding, convert it to target encoding and put it to the output stream.
660660
template<typename InputStream, typename OutputStream>
661-
RAPIDJSON_FORCEINLINE static bool Transcode(InputStream& is, OutputStream& os) {
661+
static RAPIDJSON_FORCEINLINE bool Transcode(InputStream& is, OutputStream& os) {
662662
unsigned codepoint;
663663
if (!SourceEncoding::Decode(is, &codepoint))
664664
return false;
@@ -667,7 +667,7 @@ struct Transcoder {
667667
}
668668

669669
template<typename InputStream, typename OutputStream>
670-
RAPIDJSON_FORCEINLINE static bool TranscodeUnsafe(InputStream& is, OutputStream& os) {
670+
static RAPIDJSON_FORCEINLINE bool TranscodeUnsafe(InputStream& is, OutputStream& os) {
671671
unsigned codepoint;
672672
if (!SourceEncoding::Decode(is, &codepoint))
673673
return false;
@@ -677,7 +677,7 @@ struct Transcoder {
677677

678678
//! Validate one Unicode codepoint from an encoded stream.
679679
template<typename InputStream, typename OutputStream>
680-
RAPIDJSON_FORCEINLINE static bool Validate(InputStream& is, OutputStream& os) {
680+
static RAPIDJSON_FORCEINLINE bool Validate(InputStream& is, OutputStream& os) {
681681
return Transcode(is, os); // Since source/target encoding is different, must transcode.
682682
}
683683
};
@@ -690,19 +690,19 @@ inline void PutUnsafe(Stream& stream, typename Stream::Ch c);
690690
template<typename Encoding>
691691
struct Transcoder<Encoding, Encoding> {
692692
template<typename InputStream, typename OutputStream>
693-
RAPIDJSON_FORCEINLINE static bool Transcode(InputStream& is, OutputStream& os) {
693+
static RAPIDJSON_FORCEINLINE bool Transcode(InputStream& is, OutputStream& os) {
694694
os.Put(is.Take()); // Just copy one code unit. This semantic is different from primary template class.
695695
return true;
696696
}
697697

698698
template<typename InputStream, typename OutputStream>
699-
RAPIDJSON_FORCEINLINE static bool TranscodeUnsafe(InputStream& is, OutputStream& os) {
699+
static RAPIDJSON_FORCEINLINE bool TranscodeUnsafe(InputStream& is, OutputStream& os) {
700700
PutUnsafe(os, is.Take()); // Just copy one code unit. This semantic is different from primary template class.
701701
return true;
702702
}
703703

704704
template<typename InputStream, typename OutputStream>
705-
RAPIDJSON_FORCEINLINE static bool Validate(InputStream& is, OutputStream& os) {
705+
static RAPIDJSON_FORCEINLINE bool Validate(InputStream& is, OutputStream& os) {
706706
return Encoding::Validate(is, os); // source/target encoding are the same
707707
}
708708
};

0 commit comments

Comments
 (0)