diff options
Diffstat (limited to 'ext/json/ext/generator')
-rw-r--r-- | ext/json/ext/generator/extconf.rb | 5 | ||||
-rw-r--r-- | ext/json/ext/generator/generator.c | 13 | ||||
-rw-r--r-- | ext/json/ext/generator/unicode.c | 2 |
3 files changed, 5 insertions, 15 deletions
diff --git a/ext/json/ext/generator/extconf.rb b/ext/json/ext/generator/extconf.rb index 86ed7e6367..88aaf40d70 100644 --- a/ext/json/ext/generator/extconf.rb +++ b/ext/json/ext/generator/extconf.rb @@ -2,9 +2,8 @@ require 'mkmf' require 'rbconfig' if CONFIG['CC'] =~ /gcc/ - #$CFLAGS += ' -Wall -ggdb' $CFLAGS += ' -Wall' + #$CFLAGS += ' -O0 -ggdb' end -have_header 'st.h' -create_makefile 'json/ext/generator' +create_makefile 'generator' diff --git a/ext/json/ext/generator/generator.c b/ext/json/ext/generator/generator.c index b8a1ea16d1..1f48d3c780 100644 --- a/ext/json/ext/generator/generator.c +++ b/ext/json/ext/generator/generator.c @@ -1,15 +1,8 @@ -/* vim: set cin et sw=4 ts=4: */ - +#include <string.h> #include "ruby.h" -#include "ruby/st.h" #include "unicode.h" -#include <string.h> #include <math.h> -#ifdef HAVE_IEEEFP_H -#include <ieeefp.h> -#endif - #define check_max_nesting(state, depth) do { \ long current_nesting = 1 + depth; \ if (state->max_nesting != 0 && current_nesting > state->max_nesting) \ @@ -297,14 +290,14 @@ static VALUE mFloat_to_json(int argc, VALUE *argv, VALUE self) return rb_funcall(self, i_to_s, 0); } else { tmp = rb_funcall(self, i_to_s, 0); - rb_raise(eGeneratorError, "%s not allowed in JSON", StringValueCStr(tmp)); + rb_raise(eGeneratorError, "%u: %s not allowed in JSON", __LINE__, StringValueCStr(tmp)); } } else if (isnan(value)) { if (!state || state->allow_nan) { return rb_funcall(self, i_to_s, 0); } else { tmp = rb_funcall(self, i_to_s, 0); - rb_raise(eGeneratorError, "%s not allowed in JSON", StringValueCStr(tmp)); + rb_raise(eGeneratorError, "%u: %s not allowed in JSON", __LINE__, StringValueCStr(tmp)); } } else { return rb_funcall(self, i_to_s, 0); diff --git a/ext/json/ext/generator/unicode.c b/ext/json/ext/generator/unicode.c index 44e1f41f98..76834eadc5 100644 --- a/ext/json/ext/generator/unicode.c +++ b/ext/json/ext/generator/unicode.c @@ -1,5 +1,3 @@ -/* vim: set cin et sw=4 ts=4: */ - #include "unicode.h" #define unicode_escape(buffer, character) \ |