ruby-changes:47928
From: nobu <ko1@a...>
Date: Wed, 27 Sep 2017 14:08:58 +0900 (JST)
Subject: [ruby-changes:47928] nobu:r60042 (trunk): ext: adjust indent [ci skip]
nobu 2017-09-27 14:08:53 +0900 (Wed, 27 Sep 2017) New Revision: 60042 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60042 Log: ext: adjust indent [ci skip] Modified files: trunk/ext/dbm/dbm.c trunk/ext/etc/etc.c trunk/ext/sdbm/_sdbm.c trunk/ext/stringio/stringio.c trunk/ext/syslog/syslog.c trunk/ext/zlib/zlib.c Index: ext/etc/etc.c =================================================================== --- ext/etc/etc.c (revision 60041) +++ ext/etc/etc.c (revision 60042) @@ -1012,7 +1012,7 @@ etc_nprocessors(VALUE obj) https://github.com/ruby/ruby/blob/trunk/ext/etc/etc.c#L1012 ncpus = etc_nprocessors_affin(); if (ncpus != -1) { - return INT2NUM(ncpus); + return INT2NUM(ncpus); } /* fallback to _SC_NPROCESSORS_ONLN */ #endif Index: ext/stringio/stringio.c =================================================================== --- ext/stringio/stringio.c (revision 60041) +++ ext/stringio/stringio.c (revision 60042) @@ -1558,7 +1558,7 @@ strio_external_encoding(VALUE self) https://github.com/ruby/ruby/blob/trunk/ext/stringio/stringio.c#L1558 static VALUE strio_internal_encoding(VALUE self) { - return Qnil; + return Qnil; } /* Index: ext/syslog/syslog.c =================================================================== --- ext/syslog/syslog.c (revision 60041) +++ ext/syslog/syslog.c (revision 60042) @@ -504,7 +504,7 @@ void Init_syslog(void) https://github.com/ruby/ruby/blob/trunk/ext/syslog/syslog.c#L504 rb_define_syslog_facility(LOG_NEWS); #endif #ifdef LOG_NTP - rb_define_syslog_facility(LOG_NTP); + rb_define_syslog_facility(LOG_NTP); #endif #ifdef LOG_SECURITY rb_define_syslog_facility(LOG_SECURITY); Index: ext/sdbm/_sdbm.c =================================================================== --- ext/sdbm/_sdbm.c (revision 60041) +++ ext/sdbm/_sdbm.c (revision 60042) @@ -176,24 +176,24 @@ sdbm_open(register char *file, register https://github.com/ruby/ruby/blob/trunk/ext/sdbm/_sdbm.c#L176 static int fd_set_cloexec(int fd) { - /* MinGW don't have F_GETFD and FD_CLOEXEC. [ruby-core:40281] */ + /* MinGW don't have F_GETFD and FD_CLOEXEC. [ruby-core:40281] */ #ifdef F_GETFD - int flags, ret; - flags = fcntl(fd, F_GETFD); /* should not fail except EBADF. */ - if (flags == -1) { - return -1; - } - if (2 < fd) { - if (!(flags & FD_CLOEXEC)) { - flags |= FD_CLOEXEC; - ret = fcntl(fd, F_SETFD, flags); - if (ret == -1) { - return -1; - } - } - } + int flags, ret; + flags = fcntl(fd, F_GETFD); /* should not fail except EBADF. */ + if (flags == -1) { + return -1; + } + if (2 < fd) { + if (!(flags & FD_CLOEXEC)) { + flags |= FD_CLOEXEC; + ret = fcntl(fd, F_SETFD, flags); + if (ret == -1) { + return -1; + } + } + } #endif - return 0; + return 0; } DBM * @@ -400,20 +400,20 @@ makroom(register DBM *db, long int hash, https://github.com/ruby/ruby/blob/trunk/ext/sdbm/_sdbm.c#L400 */ #if defined _WIN32 - /* - * Fill hole with 0 if made it. - * (hole is NOT read as 0) - */ - oldtail = lseek(db->pagf, 0L, SEEK_END); - memset(zer, 0, PBLKSIZ); - while (OFF_PAG(newp) > oldtail) { - if (lseek(db->pagf, 0L, SEEK_END) < 0 || - write(db->pagf, zer, PBLKSIZ) < 0) { - - return 0; + /* + * Fill hole with 0 if made it. + * (hole is NOT read as 0) + */ + oldtail = lseek(db->pagf, 0L, SEEK_END); + memset(zer, 0, PBLKSIZ); + while (OFF_PAG(newp) > oldtail) { + if (lseek(db->pagf, 0L, SEEK_END) < 0 || + write(db->pagf, zer, PBLKSIZ) < 0) { + + return 0; + } + oldtail += PBLKSIZ; } - oldtail += PBLKSIZ; - } #endif if (hash & (db->hmask + 1)) { Index: ext/zlib/zlib.c =================================================================== --- ext/zlib/zlib.c (revision 60041) +++ ext/zlib/zlib.c (revision 60042) @@ -451,7 +451,7 @@ rb_zlib_adler32(int argc, VALUE *argv, V https://github.com/ruby/ruby/blob/trunk/ext/zlib/zlib.c#L451 static VALUE rb_zlib_adler32_combine(VALUE klass, VALUE adler1, VALUE adler2, VALUE len2) { - return ULONG2NUM( + return ULONG2NUM( adler32_combine(NUM2ULONG(adler1), NUM2ULONG(adler2), NUM2LONG(len2))); } #else @@ -489,7 +489,7 @@ rb_zlib_crc32(int argc, VALUE *argv, VAL https://github.com/ruby/ruby/blob/trunk/ext/zlib/zlib.c#L489 static VALUE rb_zlib_crc32_combine(VALUE klass, VALUE crc1, VALUE crc2, VALUE len2) { - return ULONG2NUM( + return ULONG2NUM( crc32_combine(NUM2ULONG(crc1), NUM2ULONG(crc2), NUM2LONG(len2))); } #else @@ -644,7 +644,7 @@ zstream_expand_buffer(struct zstream *z) https://github.com/ruby/ruby/blob/trunk/ext/zlib/zlib.c#L644 } else { zstream_expand_buffer_into(z, - ZSTREAM_AVAIL_OUT_STEP_MAX - buf_filled); + ZSTREAM_AVAIL_OUT_STEP_MAX - buf_filled); } } else { @@ -1381,7 +1381,7 @@ rb_zstream_data_type(VALUE obj) https://github.com/ruby/ruby/blob/trunk/ext/zlib/zlib.c#L1381 static VALUE rb_zstream_adler(VALUE obj) { - return rb_uint2inum(get_zstream(obj)->stream.adler); + return rb_uint2inum(get_zstream(obj)->stream.adler); } /* @@ -2673,7 +2673,7 @@ gzfile_calc_crc(struct gzfile *gz, VALUE https://github.com/ruby/ruby/blob/trunk/ext/zlib/zlib.c#L2673 } else { gz->crc = checksum_long(crc32, gz->crc, (Bytef*)RSTRING_PTR(str) + gz->ungetc, - RSTRING_LEN(str) - gz->ungetc); + RSTRING_LEN(str) - gz->ungetc); gz->ungetc = 0; } } @@ -4370,9 +4370,9 @@ zlib_gunzip(VALUE klass, VALUE src) https://github.com/ruby/ruby/blob/trunk/ext/zlib/zlib.c#L4370 gzfile_read_header(gz); dst = zstream_detach_buffer(&gz->z); gzfile_calc_crc(gz, dst); - if (!ZSTREAM_IS_FINISHED(&gz->z)) { - rb_raise(cGzError, "unexpected end of file"); - } + if (!ZSTREAM_IS_FINISHED(&gz->z)) { + rb_raise(cGzError, "unexpected end of file"); + } if (NIL_P(gz->z.input)) rb_raise(cNoFooter, "footer is not found"); gzfile_check_footer(gz); Index: ext/dbm/dbm.c =================================================================== --- ext/dbm/dbm.c (revision 60041) +++ ext/dbm/dbm.c (revision 60042) @@ -191,24 +191,24 @@ fdbm_initialize(int argc, VALUE *argv, V https://github.com/ruby/ruby/blob/trunk/ext/dbm/dbm.c#L191 } if (dbm) { - /* - * History of dbm_pagfno() and dbm_dirfno() in ndbm and its compatibles. - * (dbm_pagfno() and dbm_dirfno() is not standardized.) - * - * 1986: 4.3BSD provides ndbm. - * It provides dbm_pagfno() and dbm_dirfno() as macros. - * 1991: gdbm-1.5 provides them as functions. - * They returns a same descriptor. - * (Earlier releases may have the functions too.) - * 1991: Net/2 provides Berkeley DB. - * It doesn't provide dbm_pagfno() and dbm_dirfno(). - * 1992: 4.4BSD Alpha provides Berkeley DB with dbm_dirfno() as a function. - * dbm_pagfno() is a macro as DBM_PAGFNO_NOT_AVAILABLE. - * 1997: Berkeley DB 2.0 is released by Sleepycat Software, Inc. - * It defines dbm_pagfno() and dbm_dirfno() as macros. - * 2011: gdbm-1.9 creates a separate dir file. - * dbm_pagfno() and dbm_dirfno() returns different descriptors. - */ + /* + * History of dbm_pagfno() and dbm_dirfno() in ndbm and its compatibles. + * (dbm_pagfno() and dbm_dirfno() is not standardized.) + * + * 1986: 4.3BSD provides ndbm. + * It provides dbm_pagfno() and dbm_dirfno() as macros. + * 1991: gdbm-1.5 provides them as functions. + * They returns a same descriptor. + * (Earlier releases may have the functions too.) + * 1991: Net/2 provides Berkeley DB. + * It doesn't provide dbm_pagfno() and dbm_dirfno(). + * 1992: 4.4BSD Alpha provides Berkeley DB with dbm_dirfno() as a function. + * dbm_pagfno() is a macro as DBM_PAGFNO_NOT_AVAILABLE. + * 1997: Berkeley DB 2.0 is released by Sleepycat Software, Inc. + * It defines dbm_pagfno() and dbm_dirfno() as macros. + * 2011: gdbm-1.9 creates a separate dir file. + * dbm_pagfno() and dbm_dirfno() returns different descriptors. + */ #if defined(HAVE_DBM_PAGFNO) rb_fd_fix_cloexec(dbm_pagfno(dbm)); #endif @@ -217,8 +217,8 @@ fdbm_initialize(int argc, VALUE *argv, V https://github.com/ruby/ruby/blob/trunk/ext/dbm/dbm.c#L217 #endif #if defined(RUBYDBM_DB_HEADER) && defined(HAVE_TYPE_DBC) - /* Disable Berkeley DB error messages such as: - * DB->put: attempt to modify a read-only database */ + /* Disable Berkeley DB error messages such as: + * DB->put: attempt to modify a read-only database */ ((DBC*)dbm)->dbp->set_errfile(((DBC*)dbm)->dbp, NULL); #endif } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/