summaryrefslogtreecommitdiff
path: root/ext/json/generator
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-10 08:01:04 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-10 08:01:04 +0000
commita2e497d5ede45bd4f4a57f494027020d7bd1733b (patch)
tree9773233b59c71615a1b88fd5807b30d2e0f09345 /ext/json/generator
parenta119b9d146fea877acc1e9ba5df0702163ce917a (diff)
* ext/json: Merge json gem 1.5.4+ (f7f78896607b6f6226cd).
[Bug #4700] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/json/generator')
-rw-r--r--ext/json/generator/generator.c2
-rw-r--r--ext/json/generator/generator.h6
2 files changed, 5 insertions, 3 deletions
diff --git a/ext/json/generator/generator.c b/ext/json/generator/generator.c
index c72ab61b76..4e44178e02 100644
--- a/ext/json/generator/generator.c
+++ b/ext/json/generator/generator.c
@@ -556,6 +556,7 @@ static VALUE mFalseClass_to_json(int argc, VALUE *argv, VALUE self)
/*
* call-seq: to_json(*)
*
+ * Returns a JSON string for nil: 'null'.
*/
static VALUE mNilClass_to_json(int argc, VALUE *argv, VALUE self)
{
@@ -1347,6 +1348,7 @@ void Init_generator()
rb_define_method(cState, "depth", cState_depth, 0);
rb_define_method(cState, "depth=", cState_depth_set, 1);
rb_define_method(cState, "configure", cState_configure, 1);
+ rb_define_alias(cState, "merge", "configure");
rb_define_method(cState, "to_h", cState_to_h, 0);
rb_define_method(cState, "[]", cState_aref, 1);
rb_define_method(cState, "generate", cState_generate, 1);
diff --git a/ext/json/generator/generator.h b/ext/json/generator/generator.h
index b31218ac2e..ee496fe221 100644
--- a/ext/json/generator/generator.h
+++ b/ext/json/generator/generator.h
@@ -78,9 +78,9 @@ static VALUE fbuffer_to_s(FBuffer *fb);
#define UNI_STRICT_CONVERSION 1
-typedef unsigned long UTF32; /* at least 32 bits */
-typedef unsigned short UTF16; /* at least 16 bits */
-typedef unsigned char UTF8; /* typically 8 bits */
+typedef unsigned long UTF32; /* at least 32 bits */
+typedef unsigned short UTF16; /* at least 16 bits */
+typedef unsigned char UTF8; /* typically 8 bits */
#define UNI_REPLACEMENT_CHAR (UTF32)0x0000FFFD
#define UNI_MAX_BMP (UTF32)0x0000FFFF