Skip to content

Commit 25cf591

Browse files
committed
Fix some compilation issues
1 parent 5c7dacb commit 25cf591

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

ext/rapidjson/buffer.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class RubyStringBuffer {
4141
capacity = newcap;
4242
}
4343

44-
const size_t INITIAL_SIZE = 2048;
44+
static const size_t INITIAL_SIZE = 2048;
4545

4646
VALUE ruby_string;
4747

ext/rapidjson/cext.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ using namespace rapidjson;
1919
typedef RubyStringBuffer DefaultBuffer;
2020

2121
VALUE encode(VALUE _self, VALUE obj) {
22-
RubyObjectEncoder<DefaultBuffer, Writer<DefaultBuffer>> encoder;
22+
RubyObjectEncoder<DefaultBuffer, Writer<DefaultBuffer> > encoder;
2323
return encoder.encode(obj);
2424
}
2525

2626
VALUE pretty_encode(VALUE _self, VALUE obj) {
27-
RubyObjectEncoder<DefaultBuffer, PrettyWriter<DefaultBuffer>> encoder;
27+
RubyObjectEncoder<DefaultBuffer, PrettyWriter<DefaultBuffer> > encoder;
2828
return encoder.encode(obj);
2929
}
3030

ext/rapidjson/encoder.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
using namespace rapidjson;
77

8-
template <typename B = RubyStringBuffer, typename W=Writer<B>>
8+
template <typename B = RubyStringBuffer, typename W=Writer<B> >
99
class RubyObjectEncoder {
1010
B buf;
1111
W writer;

ext/rapidjson/parser.hh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,16 @@ using namespace rapidjson;
88

99
class NullHandler : public BaseReaderHandler<UTF8<>, NullHandler> {
1010
static const int MAX_DEPTH = 256;
11-
int depth = 0;
11+
int depth;
1212
bool push() {
1313
return depth++ < MAX_DEPTH;
1414
}
1515
bool pop() {
1616
return depth-- > 0;
1717
}
1818
public:
19+
NullHandler(): depth(0) {
20+
}
1921
bool StartObject() { return push(); }
2022
bool EndObject(SizeType s) { return pop(); }
2123
bool StartArray() { return push(); }

0 commit comments

Comments
 (0)