diff --git a/Rakefile b/Rakefile index 7e307dcb..0945a67c 100644 --- a/Rakefile +++ b/Rakefile @@ -331,6 +331,8 @@ else end src = File.read("parser.c").gsub(/[ \t]+$/, '') src.gsub!(/^static const int (JSON_.*=.*);$/, 'enum {\1};') + src.gsub!(/0 <= \(\*p\) && \(\*p\) <= 31/, "0 <= (signed char)(*p) && (*p) <= 31") + src[0, 0] = "/* This file is automatically generated from parser.rl by using ragel */" File.open("parser.c", "w") {|f| f.print src} end end diff --git a/ext/json/ext/parser/parser.c b/ext/json/ext/parser/parser.c index bc4ac46e..e4a30566 100644 --- a/ext/json/ext/parser/parser.c +++ b/ext/json/ext/parser/parser.c @@ -1,4 +1,4 @@ - +/* This file is automatically generated from parser.rl by using ragel */ #line 1 "parser.rl" #include "../fbuffer/fbuffer.h" #include "parser.h" @@ -1563,7 +1563,7 @@ case 2: case 34: goto tr2; case 92: goto st3; } - if ( 0 <= (*p) && (*p) <= 31 ) + if ( 0 <= (signed char)(*p) && (*p) <= 31 ) goto st0; goto st2; tr2: @@ -1593,7 +1593,7 @@ case 8: case 3: if ( (*p) == 117 ) goto st4; - if ( 0 <= (*p) && (*p) <= 31 ) + if ( 0 <= (signed char)(*p) && (*p) <= 31 ) goto st0; goto st2; st4: diff --git a/json.gemspec b/json.gemspec index a101aba9..0c72e824 100644 --- a/json.gemspec +++ b/json.gemspec @@ -131,7 +131,6 @@ Gem::Specification.new do |s| s.licenses = ["Ruby"] s.rdoc_options = ["--title", "JSON implemention for Ruby", "--main", "README.md"] s.required_ruby_version = Gem::Requirement.new(">= 2.0") - s.rubygems_version = "3.0.2" s.summary = "JSON Implementation for Ruby" s.test_files = ["tests/test_helper.rb"]