Граф коммитов

183 Коммитов

Автор SHA1 Сообщение Дата
nobu eb1eee03ca * ext/syck/lib/syck/rubytypes.rb (Exception.yaml_new): fix bug
that causes YAML serialization problem for Exception.
  Exception#initialize doesn't use visible instance variable for
  the exception message, so call the method with the message.
  patched by Jingwen Owen Ou <jingweno AT gmail.com>.
  http://github.com/ruby/ruby/pull/41

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34908 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-05 08:11:48 +00:00
nobu b854733d51 * ext/syck/rubyext.c (mktime_do): use ISDIGIT().
[ruby-core:43060] [Bug #6108]
* ext/syck/token.c (sycklex_yaml_utf8): cast as unsigned char.
  [ruby-core:43060] [Bug #6108]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34881 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-02 23:03:32 +00:00
nobu ef84b7c678 * ext/dl/cptr.c (rb_dlptr_new2): remove unused variable.
* ext/iconv/iconv.c (get_iconv_opt_i): ditto.

	* ext/syck/token.c (Plain): fix types on LP64.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-30 21:47:35 +00:00
naruse 7dc427f7ed * ext/syck/lib/syck/types.rb: use toplevel Syck.
for the case someone define Syck::Syck (or YAML::Syck).

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33220 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-07 22:37:34 +00:00
naruse 1afe9dbdfd Fix: r32043 may raise NameError.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32048 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-13 07:41:20 +00:00
naruse 8318a14cc4 * ext/syck/lib/syck/rubytypes.rb: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32043 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-13 03:54:57 +00:00
nobu 54aa0b1232 * ext/syck/rubyext.c (mktime_do): extra digits are not used.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-06 13:36:02 +00:00
naruse 957ec6fcc8 * ext/syck/rubyext.c (mktime_do): remove unused variable offset.
* ext/syck/syck.h: use #ifdef instead of #if DEBUG.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-06 08:44:07 +00:00
shyouhei e3a69233e6 * ext/syck/rubyext.c (mktime_do): avoid buffer overrun, by
silently ignoring lesser significant digits.  Required buffer
  length can be computable so you might at first think of
  allocating enough memory space on the fly using alloca().  That
  is a wrong idea because when using alloca there is always risk
  of integer overflow.  A function that accepts outer-process
  resources like this should not blindly trust its inputs.  In
  this particular case we just want to generate miliseconds
  resolution by strtod() so the string in question needs no more
  length than what we originally have.  Ignoring lesser
  significant digits should suffice I believe.




git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31443 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-06 06:19:17 +00:00
shyouhei dbbfac20fc YAML.load time correctly parse usecs smaller than 1 fixes #4571
Signed-off-by: URABE, Shyouhei <shyouhei@ruby-lang.org>



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-06 06:19:12 +00:00
naruse 6b1cf264a8 * ext/sdbm/_sdbm.c (sdbm_open): use size_t.
* ext/syck/bytecode.c: ditto.

* ext/sdbm/_sdbm.c (delpair): use ptrdiff_t.

* ext/sdbm/init.c: use RSTRING_LENINT.

* ext/dl/handle.c: suppress warning: shorten-64-to-32.

* ext/strscan/strscan.c: ditto.

* ext/syck/emitter.c: ditto.

* ext/syck/implicit.c: ditto.

* ext/syck/syck.c: ditto.

* ext/syck/token.c: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31176 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-25 06:46:57 +00:00
nobu d8ebf3829f * ext/syck/rubyext.c (syck_node_init_copy): SyckNode is not
copiable.  [ruby-core:35094]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30794 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-05 03:05:35 +00:00
tenderlove b93c74c6e8 * ext/psych/lib/psych/visitors/to_ruby.rb: use Regexp::NOENCODING
rather than magic number.
* ext/syck/lib/syck/rubytypes.rb: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-02 22:22:26 +00:00
tenderlove cc6b1b3c8d * ext/psych/lib/psych/visitors/to_ruby.rb: ARG_ENCODING_NONE regular
expressions can round trip. [ruby-core:34969]
* test/psych/test_yaml.rb: test for ARG_ENCODING_NONE regex
* ext/sych/lib/syck/rubytypes.rb: ARG_ENCODING_NONE regular
  expressions can round trip.
* test/syck/test_yaml.rb: test for ARG_ENCODING_NONE regex

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-02 22:05:15 +00:00
nobu 8a7aad9952 * fix type warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29745 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-11 12:30:39 +00:00
nobu 2d4e8b4e22 * ext/syck/rubyext.c (struct mktime_arg): constified.
* ext/syck/rubyext.c (mktime_do, mktime_r, rb_syck_mktime): fix
  function signatures.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29471 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-12 15:21:20 +00:00
naruse d074ef4d60 * string.c (tr_setup_table): fix bug in r29146.
Initialize table even if cflag is 0; tr_find see whether
  del is empty or not.

* string.c (tr_find): nodel can't be NULL; if NULL, it means
  it is not specified.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-30 19:45:30 +00:00
nobu c53664c84d .cvsignore: have not been used already. [Bug #3468]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28898 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-07 05:43:21 +00:00
tenderlove 8ef7bb8c21 * ext/syck/lib/syck.rb: fixing unused variable warnings
* ext/syck/lib/syck/basenode.rb: ditto
* ext/syck/lib/syck/rubytypes.rb: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28681 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-19 04:54:06 +00:00
nobu ca3f208b3b * ext/syck/implicit.c (YYFILL): suppress warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27946 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-21 09:21:58 +00:00
nobu 87af442f94 * suppress warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27944 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-21 09:10:23 +00:00
mame e181ae5391 * process.c: suppress warning for signed and unsigned type
inconsistency.

* ext/psych/parser.c: ditto.

* ext/sdbm/_sdbm.c: ditto.

* ext/syck/rubyext.c: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27864 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-17 13:21:17 +00:00
nobu 902bd2b106 * ext/syck/emitter.c (syck_scan_scalar): set SCAN_WHITEEDGE flag
when scalar begins with newline.  patches from Dave B <daz AT
  d10.karoo.co.uk> at [ruby-core:23019] and caleb clausen at
  [ruby-core:25851].  [ruby-core:23006][ruby-core:29925]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27591 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-02 23:15:08 +00:00
nobu 7668e5aa9d * ext/syck/yaml2byte.c (bytestring_append, bytestring_extend):
removed wrong extra assignments.  a patch from Marcus Rueckert
  <darix AT opensu.se> at [ruby-core:29759].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-24 00:44:42 +00:00
nobu 977267c2e0 * ext/**/*.[ch]: removed trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-22 08:04:13 +00:00
tenderlove 5b5bbdbb35 * ext/psych/lib/psych/core_ext.rb (yaml_as): supporting deprecated
"yaml_as" method
* ext/syck/lib/syck/tag.rb: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-16 20:31:59 +00:00
nobu ddafeb2f2a * ext/syck/lib/syck/basenode.rb (Syck::BaseNode#match_path): fixed
library name.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-14 02:39:28 +00:00
nobu eedb41a85b * ext/syck/lib/yaml/syck.rb: split from ext/syck/lib/syck.rb for
backward compatibility.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27334 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-14 02:37:54 +00:00
tenderlove 48a68756f5 * ext/syck/lib/syck/dbm.rb: moved to lib/yaml/dbm.rb since it is not
YAML engine specific
* ext/syck/lib/syck/store.rb: moved to lib/yaml/store.rb since it is not
  YAML engine specific.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27294 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-11 01:21:29 +00:00
naruse 10c9ed2493 * ext/psych/lib/psych/core_ext.rb: remove before alias.
* ext/syck/lib/syck.rb: don't warn called by itself.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27221 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-05 04:12:14 +00:00
naruse b847ca06bf Don't warn when YAML.quick_emit is called by Object#to_yaml.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27219 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-05 02:42:37 +00:00
naruse 0cd2058bb3 Remove circular dependency of syck.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-04 04:41:25 +00:00
tenderlove eb71e5cd67 * lib/yaml: Moved to ext/syck/lib, Syck only uses Syck constant.
* lib/yaml.rb: Added an engine manager for choosing YAML engine.
* ext/syck/lib/syck/rubytypes.rb: squashed warnings when using Psych

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-03 21:50:47 +00:00
naruse 438b8706a7 * ext/bigdecimal/bigdecimal.c (VpMidRound): remove warnings.
patch from Charlie Savage. [ruby-core:22869]

* ext/digest/bubblebabble/bubblebabble.c (bubblebabble_str_new): ditto.

* ext/digest/digest.c (hexencode_str_new): ditto.

* ext/iconv/iconv.c (iconv_convert): ditto.

* ext/socket/socket.c (inspect_sockaddr): ditto.

* ext/socket/raddrinfo.c (sockaddr_obj): ditto.

* ext/syck/emitter.c (syck_emitter_write): ditto.

* ext/syck/emitter.c (syck_emitter_flush): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-16 04:36:31 +00:00
akr 97ed18f1da YAML parser don't need identity hash.
revert the part of previous commit.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24626 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-22 06:23:48 +00:00
akr dfc3fccef3 * ext/syck/rubyext.c (id_hash_new): new function to create a hash
which key is compared by object id.
  (syck_parser_load): use id_hash_new for bonus->data.
  (syck_parser_load_documents): ditto.
  (syck_emitter_reset): ditto.

* lib/yaml.rb (YAML.quick_emit): give the object itself to eimitter.
  don't use object_id and hash.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-22 04:52:09 +00:00
akr 3bc16f62c1 * time.c: remove time_t restriction from Time class.
* timev.h: new file to define struct vtm.

* strftime.c: format struct vtm instead of struct tm.

* ext/syck/rubyext.c (mktime_do): don't use time_t;

[ruby-dev:38191]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-04-21 14:56:59 +00:00
matz d37f45cef9 * ext/syck/rubyext.c (rb_syck_mktime): return DateTime for a value
out of range of Time.   [ruby-core:19919]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20286 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-19 08:49:51 +00:00
mame 525b4535ca * ext/syck/syck.c (syck_lookup_sym): remove reading uninitialized
variable.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-09 12:18:42 +00:00
mame 3f1a95ce65 * ext/syck/node.c (syck_replace_str2): fix wrong check to free ptr.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19297 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-11 16:37:41 +00:00
mame e4416992d8 * ext/syck/syck.c (syck_free_parser): fix memory leak by
YAML::Syck.compile.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18297 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-31 15:44:51 +00:00
nobu 42a483d392 * ext/syck/syck.h (ASSERT): fix typo at r18176.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18285 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-31 02:31:33 +00:00
nobu 18caf715c9 * ext/syck/rubyext.c (rb_syck_compile): expression in ASSERT() has no
effect unless debug mode.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18284 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-31 02:30:46 +00:00
nobu 8a6c699282 * iseq.c (ruby_iseq_disasm_insn): suppress warnings on platforms which
int size differs from pointer size.

* ext/openssl/ossl_asn1.c (ossl_asn1_get_asn1type): ditto

* ext/syck/rubyext.c (rb_syck_err_handler),
  (syck_default_error_handler): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18283 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-31 01:51:44 +00:00
mame 368d944621 * ext/syck/rubyext.c (rb_syck_compile): remove meaningless branch
that misleads into thinking that the variable sav may be
  uninitialized.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18282 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-30 17:22:16 +00:00
nobu 20796c9000 * ext/nkf/nkf-utf8/nkf.c (struct input_code.name, input_codename):
constified.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-25 05:48:32 +00:00
nobu d5d402ebf5 * ext/syck: suppress warnings more.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-22 21:25:49 +00:00
nobu 9049de7875 * ext/syck: suppress warnings more.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18176 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-22 21:12:00 +00:00
nobu 5c0dcf52fd * ext/syck: suppress warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18170 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-22 18:02:12 +00:00
mame d56885b43d * ext/syck/rubyext.c, ext/syck/yaml2byte.c, ext/syck/emitter.c,
ext/syck/syck.c, ext/syck/handler.c, ext/syck/syck.h: suppress GCC
  warning.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18167 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-22 14:04:10 +00:00