akr
ecabbf1bf6
* internal.h (INTEGER_PACK_2COMP): Defined.
...
(rb_integer_pack_2comp): Removed.
* bignum.c (bary_pack): Support INTEGER_PACK_2COMP.
(rb_integer_pack): Invoke bary_pack directly.
(rb_integer_pack_2comp): Removed.
(rb_integer_pack_internal): Ditto.
(absint_numwords_generic): Follow the above change.
* pack.c (pack_pack): Ditto.
* sprintf.c (rb_str_format): Ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-16 09:53:45 +00:00
akr
aaa1461d7b
* bignum.c (rb_integer_unpack_2comp): New function.
...
(rb_integer_unpack_internal): Extracted from rb_integer_unpack and
nlp_bits_ret argument added.
(integer_unpack_num_bdigits_small): nlp_bits_ret argument added to
return number of leading padding bits.
(integer_unpack_num_bdigits_generic): Ditto.
* internal.h (rb_integer_unpack_2comp): Declared.
* pack.c (pack_unpack): Use rb_integer_unpack_2comp and
rb_integer_unpack.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-12 15:18:00 +00:00
akr
ff6104ba62
* pack.c (pack_pack): Use rb_integer_pack_2comp.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41249 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-12 03:35:54 +00:00
akr
0c9a719d77
* internal.h (INTEGER_PACK_NEGATIVE): Defined.
...
(rb_integer_unpack): sign argument removed.
* bignum.c (rb_integer_unpack): sign argument removed.
Non-negative integers generated by default.
INTEGER_PACK_NEGATIVE flag is used to generate non-positive integers.
* pack.c (pack_unpack): Follow the above change.
* random.c (int_pair_to_real_inclusive): Ditto.
(make_seed_value): Ditto.
(mt_state): Ditto.
(limited_big_rand): Ditto.
* marshal.c (r_object0): Ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-11 21:39:55 +00:00
akr
0e8caa7d0f
* bignum.c (rb_integer_pack): Returns sign instead of words.
...
(absint_numwords_generic): Follow the above change.
(big2str_base_powerof2): Follow the above change.
* internal.h: Ditto.
* hash.c (rb_hash): Ditto.
* pack.c (pack_pack): Ditto.
* random.c (int_pair_to_real_inclusive): Ditto.
(rand_init): Ditto.
(random_load): Ditto.
(limited_big_rand): Ditto.
* time.c (v2w_bignum): Ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-10 10:37:39 +00:00
akr
f5ad120b97
* bignum.c (rb_absint_numwords): Renamed from rb_absint_size_in_word.
...
* internal.h (rb_absint_numwords): Follow the above change.
* pack.c (pack_pack): Ditto.
* random.c (rand_init): Ditto.
(limited_big_rand): Ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-09 07:53:20 +00:00
akr
837392b452
* bignum.c (rb_integer_pack): numwords_allocated argument removed.
...
* internal.h (rb_integer_pack): Follow the above change.
* hash.c (rb_hash): Ditto.
* time.c (v2w_bignum): Ditto.
* pack.c (pack_pack): Ditto.
* random.c (int_pair_to_real_inclusive): Ditto.
(rand_init): Ditto.
(random_load): Ditto.
(limited_big_rand): Ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-09 05:53:00 +00:00
akr
f31aed6255
* bignum.c (rb_integer_pack): Arguments changed. Use flags to
...
specify word order and byte order.
(rb_integer_unpack): Ditto.
(validate_integer_format): Follow the above change.
(integer_format_loop_setup): Ditto.
* pack.c: Ditto.
* internal.h: Ditto.
(INTEGER_PACK_MSWORD_FIRST): Defined.
(INTEGER_PACK_LSWORD_FIRST): Ditto.
(INTEGER_PACK_MSBYTE_FIRST): Ditto.
(INTEGER_PACK_LSBYTE_FIRST): Ditto.
(INTEGER_PACK_NATIVE_BYTE_ORDER): Ditto.
(INTEGER_PACK_LITTLE_ENDIAN): Ditto.
(INTEGER_PACK_BIG_ENDIAN): Ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-07 15:02:39 +00:00
akr
a08b001100
* bignum.c (rb_integer_pack): Renamed from rb_int_export.
...
(rb_integer_unpack): Renamed from rb_int_import.
* internal.h, pack.c: Follow the above change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-07 12:41:02 +00:00
akr
d1f3d41f11
* internal.h (rb_int_export): countp argument is split into
...
wordcount_allocated and wordcount.
* bignum.c (rb_int_export): Follow the above change.
* pack.c (pack_pack): Ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-06 22:31:23 +00:00
akr
c9c67d2fe0
* bignum.c (rb_int_import): New function.
...
(int_import_push_bits): Ditto.
* internal.h (rb_int_import): Declared.
* pack.c (pack_unpack): Use rb_int_import for BER compressed integer.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-06 21:20:04 +00:00
akr
9fea8758e9
* configure.in: Invoke RUBY_REPLACE_TYPE for size_t.
...
Don't invoke RUBY_CHECK_PRINTF_PREFIX for size_t to avoid conflict
with RUBY_REPLACE_TYPE.
* internal.h (rb_absint_size): Declared.
(rb_absint_size_in_word): Ditto.
(rb_int_export): Ditto.
* bignum.c (rb_absint_size): New function.
(rb_absint_size_in_word): Ditto.
(int_export_fill_dd): Ditto.
(int_export_take_lowbits): Ditto.
(rb_int_export): Ditto.
* pack.c (pack_pack): Use rb_int_export for BER compressed integer.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-06 11:57:35 +00:00
ko1
aacd771046
* *.c, parse.y, insns.def: use RARRAY_AREF/ASET macro
...
instead of using RARRAY_PTR().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13 09:56:22 +00:00
akr
570015a18b
* pack.c (swap32): Don't redefine it if it is already defined.
...
Bionic defines it.
(swap64): Ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-07 03:09:15 +00:00
nobu
c3db44dc35
pack.c: refix unpack base64
...
* 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-18 07:20:25 +00:00
naruse
ca7431965b
Increase capacity for skipping paddings
...
fix for r40342
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40343 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-18 06:11:31 +00:00
naruse
3e2fdaf1dd
* pack.c (pack_unpack): output characters even if the input doesn't
...
have paddings. [Bug #8286 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-18 05:03:00 +00:00
akr
16a2acca20
* bignum.c (ones): Use __builtin_popcountl if available.
...
* 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-12 12:01:51 +00:00
nobu
c3fcd1b871
pack.c: fix definition order
...
* 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-06 00:54:23 +00:00
akr
0667aac914
Add a comment.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-05 23:00:59 +00:00
akr
5ec185c86b
update comments.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40129 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-05 12:06:34 +00:00
akr
755e09ebf1
* include/ruby/defines.h (HAVE_TRUE_LONG_LONG): Defined to distinguish
...
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-05 11:44:56 +00:00
nobu
d966f1b2f3
pack.c: use LONG_LONG
...
* 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-05 11:31:50 +00:00
akr
583c8e8915
* pack.c: Support Q! and q! for long long.
...
(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
2013-04-02 11:28:57 +00:00
eregon
b0e40509c3
set encoding to ASCII for appropriate String#unpack modifiers
...
* 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-10-19 13:13:32 +00:00
eregon
bcd7b81ea6
* pack.c: fix typo.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-09-14 17:29:59 +00:00
nobu
7b8e78f747
test_pack.rb: fix assertion
...
* 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-24 04:24:20 +00:00
nobu
c0087df044
pack.c: round down too long uuencode width
...
* 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-18 14:57:40 +00:00
shyouhei
18c04b880a
add casts
...
* 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-07-18 05:29:24 +00:00
nobu
b0dd250dc9
use RB_TYPE_P() instead of comparison of TYPE()
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-23 07:13:21 +00:00
drbrain
e95f7ea80d
* variable.c (trace_ev): Removed "not reached" comment as this line is
...
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-14 00:36:26 +00:00
drbrain
da39d32f60
* encoding.c (rb_enc_codepoint_len): Use UNREACHABLE to avoid "control
...
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-13 23:45:37 +00:00
drbrain
6ba4bd5858
* pack.c (pack_pack): Warn when an invalid character is found in the
...
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-04-10 22:33:58 +00:00
naruse
b7df3e9f4e
* pack.c (pack_unpack): when unpack('M') occurs an illegal byte
...
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
2012-03-11 14:59:42 +00:00
nobu
8baffe6ef6
* class.c (rb_obj_methods), compile.c (iseq_compile_each),
...
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-12-05 09:50:12 +00:00
nobu
8e6e8e6288
* use RB_TYPE_P which is optimized for constant types, instead of
...
comparison with TYPE.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-29 11:07:45 +00:00
nobu
3a47cf3395
* remove trailing spaces.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-15 11:55:52 +00:00
akr
2d7a5f6553
update doc.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31456 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-06 18:14:25 +00:00
naruse
2dbf7d11f2
* pack.c (pack_unpack): the resulted string of unpack('M') must have
...
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-14 05:03:22 +00:00
akr
8eec9c9413
* pack.c (swapf): compilation condition simplified.
...
(swapd): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-08 12:25:03 +00:00
akr
13c4c551d1
* pack.c (swapd): remove duplicated code.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-08 11:52:11 +00:00
akr
379f68fe4f
* pack.c: parenthesize macro arguments.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30285 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-20 22:39:55 +00:00
nobu
8b09bf2a72
* pack.c (PACK_ITEM_ADJUST): return nil not result array and yield
...
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-11-15 21:39:39 +00:00
naruse
799f4754c9
Revert r29527. [ruby-dev:42419]
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29529 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-18 06:33:50 +00:00
naruse
0a8d8b8a68
* pack.c (pack_pack): Add native size option ! to q and Q.
...
[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 04:12:35 +00:00
akr
b2556b5481
* pack.c (pack_pack): refine the document. [ruby-dev:42397]
...
(pack_unpack): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-18 03:59:53 +00:00
naruse
6a443e2eb2
* pack.c (pack_pack): simplify comparison of explicit_endian
...
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 08:28:18 +00:00
naruse
ccaf61d5af
* pack.c (pack_pack): fix more than one modifiers appear in the
...
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-15 07:42:21 +00:00
naruse
0751cca16d
Add missing i, I description.
...
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-15 07:35:50 +00:00
naruse
5825359dd8
* pack.c (pack_pack): support endian modifiers: < and >.
...
[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-10-14 13:12:56 +00:00
akr
55584cb206
update doc.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28940 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-09 13:13:31 +00:00
nobu
062b4d6752
* include/ruby/{intern,io}.h: add missing prototypes.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-22 03:02:40 +00:00
akr
82f7a98236
update doc.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-28 13:05:07 +00:00
nobu
45f6fbf339
* removed trailing spaces.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-29 18:51:39 +00:00
marcandre
7729de4d91
* array.c: Documentation: change => in call-seq to ->.
...
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-17 21:07:33 +00:00
akr
709bff4f2b
update doc.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-11 14:03:53 +00:00
akr
9d3b304b0b
* pack.c (pack_unpack): add a missing break.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-10 14:52:16 +00:00
akr
fb1d5520fa
add comment.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26874 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-11 13:39:29 +00:00
akr
c3c8c1e37c
useless lines removed.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26829 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-06 13:52:03 +00:00
akr
9ff10a20b5
* pack.c: fix the prototype of rb_big2ulong_pack.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26828 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-06 13:12:24 +00:00
akr
58e8688f69
* pack.c (pack_pack): use union to avoid pointer cast.
...
(pack_unpack): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-28 06:08:50 +00:00
akr
334244eb5d
* pack.c (pack_pack): generalized integer packer implemented.
...
(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-28 02:32:09 +00:00
akr
95fd5f33c0
* pack.c (swap32): use __builtin_bswap32 on gcc 4.3.0 or later.
...
(swap64): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-27 22:00:15 +00:00
akr
68691ab2dd
* pack.c: use integer types with explicit size.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26774 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-27 15:39:20 +00:00
akr
a971778b39
* pack.c: check assuption on QUAD_SIZE and SIZEOF_LONG.
...
* bignum.c: check assuption on SIZEOF_LONG and SIZEOF_BDIGITS.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-27 06:56:46 +00:00
akr
8c9024763f
* pack.c: fix q and Q for big endian environments which have no
...
8 bytes integer type.
(pack_pack): use rb_big_pack.
(pack_unpack): use rb_big_unpack.
* include/ruby/intern.h (rb_big_pack): declared.
(rb_big_unpack): ditto.
* bignum.c (rb_big_pack): new function.
(rb_big_unpack): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-26 18:51:02 +00:00
akr
07298aba22
* pack.c (QUAD_SIZE): it should be always 8.
...
* bignum.c (rb_quad_pack): use LONG_LONG version only if
SIZEOF_LONG_LONG == QUAD_SIZE.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26767 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-26 11:09:29 +00:00
nobu
d191b742bd
* pack.c (swap64): fix for VC6.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-26 07:49:21 +00:00
nobu
aec58680ec
* pack.c (pack_pack, pack_unpack): suppressed warnings.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26765 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-26 05:17:13 +00:00
akr
b1196bb3d8
rdoc update.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-25 17:27:56 +00:00
akr
e599c936d8
* pack.c: consider DYNAMIC_ENDIAN. refactored.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-25 14:00:48 +00:00
akr
ee43611393
remove a empty line.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-24 16:52:57 +00:00
akr
10226f6505
remove a empty line.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-24 16:29:53 +00:00
akr
d3d57663a3
* pack.c (swap64): don't redefine.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26755 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-24 16:01:00 +00:00
akr
e53e5edab2
* pack.c (pack_unpack): don't use OFF32 for gcc 4.5.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26753 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-24 15:32:06 +00:00
akr
e8665a6bc2
* pack.c (pack_unpack): call PACK_ITEM_ADJUST for 'Q'.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26705 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-18 12:53:31 +00:00
akr
b9e0294eda
fix typos.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-03 17:46:28 +00:00
nobu
f517fb54c7
* pack.c (NATINT_LEN, pack_pack): suppressed warnings.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25229 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-04 06:00:33 +00:00
nobu
d1abc53721
* array.c, bignum.c, dln.c, error.c, gc.c, io.c, marshal.c,
...
numeric.c, pack.c, strftime.c, string.c, thread.c, transcode.c,
transcode_data.h, util.c, variable.c, vm_dump.c,
include/ruby/encoding.h, missing/crypt.c, missing/vsnprintf.c:
suppress VC type warnings. [ruby-core:22726]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-12 09:16:15 +00:00
matz
d5c7938eb4
* pack.c (pack_pack): replace all rb_Float() to rb_to_float().
...
[ruby-dev:37663]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21206 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-30 16:10:23 +00:00
matz
ad00464489
* pack.c (pack_pack): template f should not accept non float
...
values. [ruby-dev:37656]
* object.c (rb_to_float): new function to type check floats.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21179 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-29 13:40:33 +00:00
matz
9f8c309d6e
* pack.c (pack_pack): encoding of packed string only from 'm',
...
'M', and 'u' should be US-ASCII. [ruby-dev:37284]
* pack.c (pack_pack): encoding of packed string only from 'U'
should be UTF-8. also upgrade US-ASCII strings to UTF-8.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20956 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-23 15:30:05 +00:00
yugui
e41fb7d4ae
* pack.c (pack_pck): fixed [ruby-dev:37295].
...
Array#pack always has returned an US-ASCII string when
the given format ended with 'u', 'M' or 'm'.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20588 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-09 02:51:10 +00:00
yugui
0945f41a5f
* pack.c (pack_pack): fixed odd act of 'm*', 'M*', and 'P*'.
...
just ignores '*' in these cases.
[ruby-dev:37289]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20581 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-08 14:41:44 +00:00
nobu
92e0f99d37
* pack.c (pack_pack): fixed length for odd length string.
...
[ruby-dev:37283]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20580 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-08 09:31:44 +00:00
yugui
4b983b90c4
* pack.c (pack_pack): 'u0' is not special differently from 'm0'.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-06 08:55:57 +00:00
naruse
343deb4c39
* pack.c (pack_pack): set US-ASCII and CODERANGE_7BIT
...
when quoted-printable ('M') and base64 ('m').
[ruby-dev:37284]
* pack.c (pack_unpack): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-06 05:37:20 +00:00
matz
408ca7cbb1
* pack.c (pack_pack): propagate taint status from format string to
...
result string.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-04 16:20:02 +00:00
matz
93fa4cbf3d
* pack.c (pack_pack): templates a, A, Z should propagate encoding
...
of original strings. templates b, B, h, H brings ASCII-8BIT to
the result.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-30 09:19:13 +00:00
nobu
34c5cea9b5
* pack.c (pack_pack): set encoding from packing string and UTF-8 for
...
"U". [ruby-core:19590]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-29 07:41:21 +00:00
mame
2c1c462747
* pack.c (pack_pack, pack_unpack): 'm0' format (base64) complies with
...
RFC 4648. It adds no line feed when encoding, and raise ArgumentError
if the encoded string contains non-alphabet (including CR and LF).
* lib/base64.rb: added. This provides encoding/decoding method for
Base64 in standard RFC 2045, Base64 in standard RFC 4648 and ``Base 64
Encoding with URL and Filename SafeAlphabet'' in RFC 4648.
* test_pack.c, test/base64/test_base64.rb: add tests for above.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-25 12:24:54 +00:00
matz
31b6ea65bb
* include/ruby/ruby.h (DBL2NUM): renamed from DOUBLE2NUM.
...
a patch from Tadashi Saito <shiba at mail2.accsnet.ne.jp>
in [ruby-dev:36102].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-05 18:24:21 +00:00
akr
40c771fd45
* pack.c (encodes): make buff fixed length to avoid SEGV by
...
ruby -e '["a"*10000000].pack("m1000000000")'
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-04 15:06:34 +00:00
nobu
1c30bc4cca
* pack.c (pack_unpack): upper half of hexdigits has never been used.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-31 03:23:55 +00:00
nobu
e7207d0404
* pack.c (pack_unpack): reduced static variables.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18273 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-30 15:58:36 +00:00
mame
df5604ce5d
* pack.c (pack_unpack): fix v and V with big endian.
...
[1].pack("V").unpack("V") was [4294967296].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-17 11:42:17 +00:00
mame
871c83dddf
* pack.c (pack_pack): fix i! with big endian. [1].pack("i!") was
...
"\0\0\0\0".
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18105 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-17 11:36:54 +00:00
ko1
72ba13aa8e
* array.c, bignum.c, cont.c, dir.c, dln.c, encoding.c, enumerator.c,
...
enumerator.c (enumerator_allocate), eval_jump.c, file.c, hash.c,
io.c, load.c, pack.c, proc.c, random.c, re.c, ruby.c, st.c,
string.c, thread.c, thread_pthread.c, time.c, util.c, variable.c,
vm.c, gc.c:
allocated memory objects by xmalloc (ruby_xmalloc) should be
freed by xfree (ruby_xfree).
* ext/curses/curses.c, ext/dbm/dbm.c, ext/digest/digest.c,
ext/gdbm/gdbm.c, ext/json/ext/parser/parser.c,
ext/json/ext/parser/unicode.c, ext/openssl/ossl_cipher.c,
ext/openssl/ossl_hmac.c, ext/openssl/ossl_pkey_ec.c,
ext/sdbm/init.c, ext/strscan/strscan.c, ext/zlib/zlib.c:
ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-08 10:01:40 +00:00
nobu
075530a685
* suppress warnings with -Wwrite-string.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-31 09:28:20 +00:00
mame
a0e236f606
* pack.c (pack_pack): check errno to detect error of ruby_strtoul.
...
* pack.c (pack_unpack): ditto.
* test/ruby/test_pack.rb: add a test for above.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16452 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-17 17:56:41 +00:00