summaryrefslogtreecommitdiff
path: root/pack.c
AgeCommit message (Collapse)Author
2013-04-18pack.c: refix unpack base64nobu
* pack.c (pack_unpack): increase buffer size to fix buffer overflow, and fix garbages just after unpacking without missing paddings. [Bug #8286] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40344 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-18Increase capacity for skipping paddingsnaruse
fix for r40342 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40343 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-18* pack.c (pack_unpack): output characters even if the input doesn'tnaruse
have paddings. [Bug #8286] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-12* bignum.c (ones): Use __builtin_popcountl if available.akr
* internal.h (GCC_VERSION_SINCE): Macro moved from pack.c. * pack.c: Include internal.h for GCC_VERSION_SINCE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-06pack.c: fix definition ordernobu
* pack.c (NATINT_LEN): fix definition order, must be after NATINT_PACK. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40145 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-05Add a comment.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-05update comments.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40129 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-05* include/ruby/defines.h (HAVE_TRUE_LONG_LONG): Defined to distinguishakr
availability of long long and availability of 64bit integer type. * pack.c: Use HAVE_TRUE_LONG_LONG to distinguish q! and Q! support. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-05pack.c: use LONG_LONGnobu
* pack.c (NATINT_LEN_Q): do not use long long directly, use LONG_LONG instead. fix compilation error on mswin. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40126 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-02* pack.c: Support Q! and q! for long long.akr
(natstr): Moved to toplevel. Add q and Q if there is long long type. (endstr): Moved to toplevel. (NATINT_PACK): Consider long long. (NATINT_LEN_Q): New macro. (pack_pack): Support Q! and q!. (pack_unpack): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40067 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-19set encoding to ASCII for appropriate String#unpack modifierseregon
* pack.c (pack_unpack): set encoding of the 'H','h','B' and 'B' modifiers to US-ASCII. * test/ruby/test_pack.rb: tests for the above. [ruby-core:47653][Bug #7050] * test/test_securerandom.rb: tests for SecureRandom.hex from tenderlove. [ruby-core:46792][Bug #6799] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-09-14* pack.c: fix typo.eregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-24test_pack.rb: fix assertionnobu
* pack.c (pack_unpack): fix indent. * test/ruby/test_pack.rb (test_pack_unpack_M): fix assertion. ignore invalid quoted-printable and just skip. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36517 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-18pack.c: round down too long uuencode widthnobu
* pack.c (pack_pack): round down too long uuencode width. folding width in uuencode format cannot be longer than 63 bytes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36450 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-18add castsshyouhei
* pack.c: (ditto) bitwise operations are not char. Apply explicit casts on them. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36429 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-23use RB_TYPE_P() instead of comparison of TYPE()nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-14* variable.c (trace_ev): Removed "not reached" comment as this line isdrbrain
reached. * variable.c (rb_obj_remove_instance_variable): Replaced "not reached" comment with the UNREACHABLE macro. * variable.c (rb_mod_const_missing): ditto. * variable.c (rb_mod_remove_cvar): ditto. * enum.c (first_i): ditto. * string.c (rb_str_aref): ditto. * string.c (str_byte_aref): ditto. * string.c (rb_to_id): ditto. * io.c (rb_io_fmode_modestr): ditto. * io.c (rb_io_oflags_modestr): ditto. * pack.c (num2i32): ditto. * vm_eval.c (rb_method_missing): ditto. * vm_eval.c (rb_f_throw): ditto. * dir.c (dir_read): ditto. * win32/win32.c (child_result): ditto. * struct.c (rb_struct_getmember): ditto. * struct.c (rb_struct_set): ditto. * struct.c (rb_struct_aref_id): ditto. * eval.c (rb_f_raise): ditto. * process.c (rb_f_exit_bang): ditto. * process.c (rb_f_exit): ditto. * process.c (rb_f_abort): ditto. * ext/-test-/iter/break.c (iter_break_value): ditto. * ext/pty/pty.c (pty_check): ditto. * ext/openssl/ossl_pkey.c (ossl_pkey_new): ditto. * ext/readline/readline.c (rb_remove_history): ditto. * ext/stringio/stringio.c (strio_unimpl): ditto. * numeric.c (num_sadded): ditto. * numeric.c (num_init_copy): ditto. * numeric.c (rb_num2ll): ditto. * numeric.c (rb_num2ull): ditto. * vm_insnhelper.c (call_cfunc): ditto. * ruby.c (opt_W_getter): ditto. * bignum.c (rb_big_coerce): ditto. * file.c (rb_f_test): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-13* encoding.c (rb_enc_codepoint_len): Use UNREACHABLE to avoid "controldrbrain
reaches end of non-void function" warnings. [ruby-trunk - Bug #6066] * re.c (name_to_backref_number): ditto. * object.c (rb_Float): ditto. * io.c (io_readpartial): ditto. * io.c (io_read_nonblock): ditto. * pack.c (rb_uv_to_utf8): ditto. * proc.c (rb_method_entry_arity): ditto. * vm_method.c (rb_f_notimplement): ditto. * struct.c (rb_struct_aset_id): ditto. * class.c (rb_scan_args): ditto. * process.c (rlimit_resource_type): ditto. * process.c (rlimit_resource_value): ditto. * process.c (p_uid_switch): ditto. * process.c (p_gid_switch): ditto. * ext/digest/digest.c (rb_digest_instance_update): ditto. * ext/digest/digest.c (rb_digest_instance_finish): ditto. * ext/digest/digest.c (rb_digest_instance_reset): ditto. * ext/digest/digest.c (rb_digest_instance_block_length): ditto. * ext/bigdecimal/bigdecimal.c (BigDecimalCmp): ditto. * ext/dl/handle.c (rb_dlhandle_close): ditto. * ext/tk/tcltklib.c (pending_exception_check0): ditto. * ext/tk/tcltklib.c (pending_exception_check1): ditto. * ext/tk/tcltklib.c (ip_cancel_eval_core): ditto. * ext/tk/tcltklib.c (lib_get_reltype_name): ditto. * ext/tk/tcltklib.c (create_dummy_encoding_for_tk_core): ditto. * ext/tk/tkutil/tkutil.c (tk_hash_kv): ditto. * ext/openssl/ossl_ssl.c (ossl_ssl_session_reused): ditto. * ext/openssl/ossl_pkey_ec.c (ossl_ec_key_dsa_verify_asn1): ditto. * ext/openssl/ossl_pkey_ec.c (ossl_ec_point_is_at_infinit): ditto. * ext/openssl/ossl_pkey_ec.c (ossl_ec_point_is_on_curve): ditto. * ext/fiddle/conversions.c (generic_to_value): ditto. * ext/socket/raddrinfo.c (rsock_io_socket_addrinfo): ditto. * ext/socket/socket.c (sock_s_getnameinfo): ditto. * ext/ripper/eventids2.c (ripper_token2eventid): ditto. * cont.c (return_fiber): ditto. * dmydln.c (dln_load): ditto. * vm_insnhelper.c (vm_search_normal_superclass): ditto. * bignum.c (big_fdiv): ditto. * marshal.c (r_symlink): ditto. * marshal.c (r_symbol): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-10* pack.c (pack_pack): Warn when an invalid character is found in thedrbrain
format string when $VERBOSE is true. [ruby-trunk - Feature #5219] * pack.c (pack_unpack): ditto * test/ruby/test_pack.rb (class TestPack): Test for warnings on invalid format characters. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35292 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-11* pack.c (pack_unpack): when unpack('M') occurs an illegal bytenaruse
sequence, output the "=" character and the following character in the decoded data without any transformation. [ruby-dev:44875] [Bug #5635] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-05* class.c (rb_obj_methods), compile.c (iseq_compile_each),nobu
iseq.c(iseq_load, rb_iseq_parameters), pack.c (pack_pack), regcomp.c (is_not_included, update_string_node_case_fold), transcode.c (rb_econv_open0, make_replacement), vm_eval.c (raise_method_missing): remove unused variable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33950 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-29* use RB_TYPE_P which is optimized for constant types, instead ofnobu
comparison with TYPE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-15* remove trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-06update doc.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31456 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-14* pack.c (pack_unpack): the resulted string of unpack('M') must havenaruse
ASCII-8BIT encoding (and ENC_CODERANGE_VALID). [ruby-core:34482] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30542 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-08* pack.c (swapf): compilation condition simplified.akr
(swapd): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-08* pack.c (swapd): remove duplicated code.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-20* pack.c: parenthesize macro arguments.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30285 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-15* pack.c (PACK_ITEM_ADJUST): return nil not result array and yieldnobu
values if block is given. [ruby-core:33193] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29804 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-18Revert r29527. [ruby-dev:42419]naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29529 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-18* pack.c (pack_pack): Add native size option ! to q and Q.naruse
[ruby-dev:42375] * pack.c (pack_unpack): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29527 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-18* pack.c (pack_pack): refine the document. [ruby-dev:42397]akr
(pack_unpack): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-15* pack.c (pack_pack): simplify comparison of explicit_endiannaruse
as pointed by nobu. * pack.c (pack_unpack): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29503 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-15* pack.c (pack_pack): fix more than one modifiers appear in thenaruse
format string. [ruby-core:32793] * pack.c (pack_unpack): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-15Add missing i, I description.naruse
And desribe each combination of a directive and modifiers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-14* pack.c (pack_pack): support endian modifiers: < and >.naruse
[ruby-dev:42376] Feature #3491 * pack.c (pack_unpack): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29496 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-09update doc.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28940 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-22* include/ruby/{intern,io}.h: add missing prototypes.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-28update doc.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-29* removed trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-17* array.c: Documentation: change => in call-seq to ->.marcandre
Harmonize "#=>" in examples. [ruby-core:30206] * bignum.c: ditto * class.c: ditto * compar.c: ditto * cont.c: ditto * dir.c: ditto * encoding.c: ditto * enum.c: ditto * enumerator.c: ditto * error.c: ditto * eval.c: ditto * file.c: ditto * gc.c: ditto * io.c: ditto * load.c: ditto * marshal.c: ditto * math.c: ditto * numeric.c: ditto * object.c: ditto * pack.c: ditto * proc.c: ditto * process.c: ditto * random.c: ditto * range.c: ditto * re.c: ditto * ruby.c: ditto * signal.c: ditto * sprintf.c: ditto * string.c: ditto * struct.c: ditto * thread.c: ditto * time.c: ditto * transcode.c: ditto * variable.c: ditto * vm_eval.c: ditto * vm_method.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-11update doc.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-10* pack.c (pack_unpack): add a missing break.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-11add comment.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26874 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-06useless lines removed.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26829 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-06* pack.c: fix the prototype of rb_big2ulong_pack.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26828 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-28* pack.c (pack_pack): use union to avoid pointer cast.akr
(pack_unpack): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-28* pack.c (pack_pack): generalized integer packer implemented.akr
(pack_unpack): generalized integer unpacker implemented. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26778 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-27* pack.c (swap32): use __builtin_bswap32 on gcc 4.3.0 or later.akr
(swap64): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-27* pack.c: use integer types with explicit size.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26774 b2dd03c8-39d4-4d8f-98ff-823fe69b080e