ruby-changes:39130
From: nobu <ko1@a...>
Date: Fri, 10 Jul 2015 21:50:31 +0900 (JST)
Subject: [ruby-changes:39130] nobu:r51211 (trunk): zlib.c: protoize
nobu 2015-07-10 21:49:58 +0900 (Fri, 10 Jul 2015) New Revision: 51211 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=51211 Log: zlib.c: protoize * ext/zlib/zlib.c (do_checksum): protoize the definition. Modified files: trunk/ext/zlib/zlib.c Index: ext/zlib/zlib.c =================================================================== --- ext/zlib/zlib.c (revision 51210) +++ ext/zlib/zlib.c (revision 51211) @@ -387,10 +387,7 @@ checksum_long(uLong (*func)(uLong, const https://github.com/ruby/ruby/blob/trunk/ext/zlib/zlib.c#L387 #endif static VALUE -do_checksum(argc, argv, func) - int argc; - VALUE *argv; - uLong (*func)(uLong, const Bytef*, uInt); +do_checksum(int argc, VALUE *argv, uLong (*func)(uLong, const Bytef*, uInt)) { VALUE str, vsum; unsigned long sum; @@ -1001,7 +998,8 @@ zstream_run_func(void *ptr) https://github.com/ruby/ruby/blob/trunk/ext/zlib/zlib.c#L998 if (args->stream_output) { state = (int)(VALUE)rb_thread_call_with_gvl(zstream_expand_buffer_protect, (void *)z); - } else { + } + else { state = zstream_expand_buffer_without_gvl(z); } @@ -1983,7 +1981,8 @@ do_inflate(struct zstream *z, VALUE src) https://github.com/ruby/ruby/blob/trunk/ext/zlib/zlib.c#L1981 * stream's required dictionary. */ static VALUE -rb_inflate_add_dictionary(VALUE obj, VALUE dictionary) { +rb_inflate_add_dictionary(VALUE obj, VALUE dictionary) +{ VALUE dictionaries = rb_ivar_get(obj, id_dictionaries); VALUE checksum = do_checksum(1, &dictionary, adler32); @@ -4099,7 +4098,8 @@ gzreader_gets(int argc, VALUE *argv, VAL https://github.com/ruby/ruby/blob/trunk/ext/zlib/zlib.c#L4098 rsptr = "\n\n"; rslen = 2; rspara = 1; - } else { + } + else { rsptr = RSTRING_PTR(rs); rslen = RSTRING_LEN(rs); rspara = 0; @@ -4136,7 +4136,8 @@ gzreader_gets(int argc, VALUE *argv, VAL https://github.com/ruby/ruby/blob/trunk/ext/zlib/zlib.c#L4136 n = filled; if (limit > 0 && filled >= limit) break; n++; - } else { + } + else { n += (long)(res - p); p = res; if (rslen == 1 || memcmp(p, rsptr, rslen) == 0) break; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/