Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nobu committed Sep 4, 2012
1 parent 4bb125f commit af6c038
Show file tree
Hide file tree
Showing 14 changed files with 57 additions and 57 deletions.
2 changes: 1 addition & 1 deletion ext/curses/curses.c
Expand Up @@ -2789,7 +2789,7 @@ Init_curses(void)
RUBY_EXTERN char *curses_version; RUBY_EXTERN char *curses_version;
version = rb_sprintf("curses (%s)", curses_version); version = rb_sprintf("curses (%s)", curses_version);
#else #else
/* BSD curses, perhaps. NetBSD 5 still use it. */ /* BSD curses, perhaps. NetBSD 5 still use it. */
version = rb_str_new2("curses (unknown)"); version = rb_str_new2("curses (unknown)");
#endif #endif
/* /*
Expand Down
2 changes: 1 addition & 1 deletion ext/dbm/dbm.c
Expand Up @@ -1126,7 +1126,7 @@ Init_dbm(void)
* - "Berkeley DB (unknown)" (4.4BSD, maybe) * - "Berkeley DB (unknown)" (4.4BSD, maybe)
* - "GDBM version 1.8.3. 10/15/2002 (built Jul 1 2011 12:32:45)" * - "GDBM version 1.8.3. 10/15/2002 (built Jul 1 2011 12:32:45)"
* - "QDBM 1.8.78" * - "QDBM 1.8.78"
* *
*/ */
rb_define_const(rb_cDBM, "VERSION", version); rb_define_const(rb_cDBM, "VERSION", version);
} }
Expand Down
4 changes: 2 additions & 2 deletions ext/dbm/extconf.rb
Expand Up @@ -148,7 +148,7 @@ def headers.db_check2(db, hdr)
end end


# Berkeley DB's ndbm.h (since 1.85 at least) defines DBM_SUFFIX. # Berkeley DB's ndbm.h (since 1.85 at least) defines DBM_SUFFIX.
# Note that _DB_H_ is not defined on Mac OS X because # Note that _DB_H_ is not defined on Mac OS X because
# it uses Berkeley DB 1 but ndbm.h doesn't include db.h. # it uses Berkeley DB 1 but ndbm.h doesn't include db.h.
have_db_header = have_macro('DBM_SUFFIX', hdr, hsearch) have_db_header = have_macro('DBM_SUFFIX', hdr, hsearch)


Expand Down Expand Up @@ -200,7 +200,7 @@ def headers.db_check2(db, hdr)
if /\Agdbm/ !~ db && have_gdbm_header if /\Agdbm/ !~ db && have_gdbm_header
return false return false
end end

if have_ndbm_header if have_ndbm_header
return false return false
end end
Expand Down
2 changes: 1 addition & 1 deletion ext/dl/lib/dl/struct.rb
Expand Up @@ -98,7 +98,7 @@ def CStructEntity.size(types)
last_offset = offset last_offset = offset


align = PackInfo::ALIGN_MAP[type] align = PackInfo::ALIGN_MAP[type]
offset = PackInfo.align(last_offset, align) + offset = PackInfo.align(last_offset, align) +
(PackInfo::SIZE_MAP[type] * count) (PackInfo::SIZE_MAP[type] * count)


align align
Expand Down
6 changes: 3 additions & 3 deletions ext/openssl/lib/openssl/bn.rb
Expand Up @@ -3,16 +3,16 @@
# $RCSfile$ # $RCSfile$
# #
# = Ruby-space definitions that completes C-space funcs for BN # = Ruby-space definitions that completes C-space funcs for BN
# #
# = Info # = Info
# 'OpenSSL for Ruby 2' project # 'OpenSSL for Ruby 2' project
# Copyright (C) 2002 Michal Rokos <m.rokos@sh.cvut.cz> # Copyright (C) 2002 Michal Rokos <m.rokos@sh.cvut.cz>
# All rights reserved. # All rights reserved.
# #
# = Licence # = Licence
# This program is licenced under the same licence as Ruby. # This program is licenced under the same licence as Ruby.
# (See the file 'LICENCE'.) # (See the file 'LICENCE'.)
# #
# = Version # = Version
# $Id$ # $Id$
# #
Expand Down
6 changes: 3 additions & 3 deletions ext/openssl/lib/openssl/cipher.rb
Expand Up @@ -3,16 +3,16 @@
# $RCSfile$ # $RCSfile$
# #
# = Ruby-space predefined Cipher subclasses # = Ruby-space predefined Cipher subclasses
# #
# = Info # = Info
# 'OpenSSL for Ruby 2' project # 'OpenSSL for Ruby 2' project
# Copyright (C) 2002 Michal Rokos <m.rokos@sh.cvut.cz> # Copyright (C) 2002 Michal Rokos <m.rokos@sh.cvut.cz>
# All rights reserved. # All rights reserved.
# #
# = Licence # = Licence
# This program is licenced under the same licence as Ruby. # This program is licenced under the same licence as Ruby.
# (See the file 'LICENCE'.) # (See the file 'LICENCE'.)
# #
# = Version # = Version
# $Id$ # $Id$
# #
Expand Down
6 changes: 3 additions & 3 deletions ext/openssl/lib/openssl/digest.rb
Expand Up @@ -3,16 +3,16 @@
# $RCSfile$ # $RCSfile$
# #
# = Ruby-space predefined Digest subclasses # = Ruby-space predefined Digest subclasses
# #
# = Info # = Info
# 'OpenSSL for Ruby 2' project # 'OpenSSL for Ruby 2' project
# Copyright (C) 2002 Michal Rokos <m.rokos@sh.cvut.cz> # Copyright (C) 2002 Michal Rokos <m.rokos@sh.cvut.cz>
# All rights reserved. # All rights reserved.
# #
# = Licence # = Licence
# This program is licenced under the same licence as Ruby. # This program is licenced under the same licence as Ruby.
# (See the file 'LICENCE'.) # (See the file 'LICENCE'.)
# #
# = Version # = Version
# $Id$ # $Id$
# #
Expand Down
6 changes: 3 additions & 3 deletions ext/openssl/lib/openssl/x509.rb
Expand Up @@ -3,16 +3,16 @@
# $RCSfile$ # $RCSfile$
# #
# = Ruby-space definitions that completes C-space funcs for X509 and subclasses # = Ruby-space definitions that completes C-space funcs for X509 and subclasses
# #
# = Info # = Info
# 'OpenSSL for Ruby 2' project # 'OpenSSL for Ruby 2' project
# Copyright (C) 2002 Michal Rokos <m.rokos@sh.cvut.cz> # Copyright (C) 2002 Michal Rokos <m.rokos@sh.cvut.cz>
# All rights reserved. # All rights reserved.
# #
# = Licence # = Licence
# This program is licenced under the same licence as Ruby. # This program is licenced under the same licence as Ruby.
# (See the file 'LICENCE'.) # (See the file 'LICENCE'.)
# #
# = Version # = Version
# $Id$ # $Id$
# #
Expand Down
14 changes: 7 additions & 7 deletions ext/openssl/ossl.c
Expand Up @@ -497,9 +497,9 @@ ossl_debug_set(VALUE self, VALUE val)
* *
* Asymmetric public/private key encryption is slow and victim to attack in * Asymmetric public/private key encryption is slow and victim to attack in
* cases where it is used without padding or directly to encrypt larger chunks * cases where it is used without padding or directly to encrypt larger chunks
* of data. Typical use cases for RSA encryption involve "wrapping" a symmetric * of data. Typical use cases for RSA encryption involve "wrapping" a symmetric
* key with the public key of the recipient who would "unwrap" that symmetric * key with the public key of the recipient who would "unwrap" that symmetric
* key again using their private key. * key again using their private key.
* The following illustrates a simplified example of such a key transport * The following illustrates a simplified example of such a key transport
* scheme. It shouldn't be used in practice, though, standardized protocols * scheme. It shouldn't be used in practice, though, standardized protocols
* should always be preferred. * should always be preferred.
Expand All @@ -519,7 +519,7 @@ ossl_debug_set(VALUE self, VALUE val)
* Using "private_encrypt" to encrypt some data with the private key is * Using "private_encrypt" to encrypt some data with the private key is
* equivalent to applying a digital signature to the data. A verifying * equivalent to applying a digital signature to the data. A verifying
* party may validate the signature by comparing the result of decrypting * party may validate the signature by comparing the result of decrypting
* the signature with "public_decrypt" to the original data. However, * the signature with "public_decrypt" to the original data. However,
* OpenSSL::PKey already has methods "sign" and "verify" that handle * OpenSSL::PKey already has methods "sign" and "verify" that handle
* digital signatures in a standardized way - "private_encrypt" and * digital signatures in a standardized way - "private_encrypt" and
* "public_decrypt" shouldn't be used in practice. * "public_decrypt" shouldn't be used in practice.
Expand All @@ -543,20 +543,20 @@ ossl_debug_set(VALUE self, VALUE val)
* end * end
* *
* == PBKDF2 Password-based Encryption * == PBKDF2 Password-based Encryption
* *
* If supported by the underlying OpenSSL version used, Password-based * If supported by the underlying OpenSSL version used, Password-based
* Encryption should use the features of PKCS5. If not supported or if * Encryption should use the features of PKCS5. If not supported or if
* required by legacy applications, the older, less secure methods specified * required by legacy applications, the older, less secure methods specified
* in RFC 2898 are also supported (see below). * in RFC 2898 are also supported (see below).
* *
* PKCS5 supports PBKDF2 as it was specified in PKCS#5 * PKCS5 supports PBKDF2 as it was specified in PKCS#5
* v2.0[http://www.rsa.com/rsalabs/node.asp?id=2127]. It still uses a * v2.0[http://www.rsa.com/rsalabs/node.asp?id=2127]. It still uses a
* password, a salt, and additionally a number of iterations that will * password, a salt, and additionally a number of iterations that will
* slow the key derivation process down. The slower this is, the more work * slow the key derivation process down. The slower this is, the more work
* it requires being able to brute-force the resulting key. * it requires being able to brute-force the resulting key.
* *
* === Encryption * === Encryption
* *
* The strategy is to first instantiate a Cipher for encryption, and * The strategy is to first instantiate a Cipher for encryption, and
* then to generate a random IV plus a key derived from the password * then to generate a random IV plus a key derived from the password
* using PBKDF2. PKCS #5 v2.0 recommends at least 8 bytes for the salt, * using PBKDF2. PKCS #5 v2.0 recommends at least 8 bytes for the salt,
Expand Down
4 changes: 2 additions & 2 deletions ext/openssl/ossl_asn1.c
Expand Up @@ -150,8 +150,8 @@ ASN1_INTEGER *
num_to_asn1integer(VALUE obj, ASN1_INTEGER *ai) num_to_asn1integer(VALUE obj, ASN1_INTEGER *ai)
{ {
BIGNUM *bn; BIGNUM *bn;

if (NIL_P(obj)) if (NIL_P(obj))
ossl_raise(rb_eTypeError, "Can't convert nil into Integer"); ossl_raise(rb_eTypeError, "Can't convert nil into Integer");


bn = GetBNPtr(obj); bn = GetBNPtr(obj);
Expand Down
18 changes: 9 additions & 9 deletions ext/openssl/ossl_ssl.c
Expand Up @@ -586,7 +586,7 @@ ssl_npn_encode_protocols(VALUE sslctx, VALUE protocols)
} }


static int static int
ssl_npn_advertise_cb(SSL *ssl, const unsigned char **out, unsigned int *outlen, void *arg) ssl_npn_advertise_cb(SSL *ssl, const unsigned char **out, unsigned int *outlen, void *arg)
{ {
VALUE sslctx_obj = (VALUE) arg; VALUE sslctx_obj = (VALUE) arg;
VALUE protocols = rb_iv_get(sslctx_obj, "@_protocols"); VALUE protocols = rb_iv_get(sslctx_obj, "@_protocols");
Expand All @@ -602,7 +602,7 @@ ssl_npn_select_cb(SSL *s, unsigned char **out, unsigned char *outlen, const unsi
{ {
int i = 0; int i = 0;
VALUE sslctx_obj, cb, protocols, selected; VALUE sslctx_obj, cb, protocols, selected;

sslctx_obj = (VALUE) arg; sslctx_obj = (VALUE) arg;
cb = rb_iv_get(sslctx_obj, "@npn_select_cb"); cb = rb_iv_get(sslctx_obj, "@npn_select_cb");
protocols = rb_ary_new(); protocols = rb_ary_new();
Expand All @@ -623,14 +623,14 @@ ssl_npn_select_cb(SSL *s, unsigned char **out, unsigned char *outlen, const unsi
} }
#endif #endif


/* This function may serve as the entry point to support further /* This function may serve as the entry point to support further
* callbacks. */ * callbacks. */
static void static void
ssl_info_cb(const SSL *ssl, int where, int val) ssl_info_cb(const SSL *ssl, int where, int val)
{ {
int state = SSL_state(ssl); int state = SSL_state(ssl);


if ((where & SSL_CB_HANDSHAKE_START) && if ((where & SSL_CB_HANDSHAKE_START) &&
(state & SSL_ST_ACCEPT)) { (state & SSL_ST_ACCEPT)) {
ssl_renegotiation_cb(ssl); ssl_renegotiation_cb(ssl);
} }
Expand Down Expand Up @@ -1801,7 +1801,7 @@ ossl_ssl_npn_protocol(VALUE self)
unsigned int outlen; unsigned int outlen;


ossl_ssl_data_get_struct(self, ssl); ossl_ssl_data_get_struct(self, ssl);

SSL_get0_next_proto_negotiated(ssl, &out, &outlen); SSL_get0_next_proto_negotiated(ssl, &out, &outlen);
if (!outlen) if (!outlen)
return Qnil; return Qnil;
Expand Down Expand Up @@ -1836,7 +1836,7 @@ Init_ossl_ssl()
* connection. Both client and server TLS connections are supported, * connection. Both client and server TLS connections are supported,
* SSLSocket and SSLServer may be used in conjunction with an instance * SSLSocket and SSLServer may be used in conjunction with an instance
* of SSLContext to set up connections. * of SSLContext to set up connections.
*/ */
mSSL = rb_define_module_under(mOSSL, "SSL"); mSSL = rb_define_module_under(mOSSL, "SSL");
/* Document-class: OpenSSL::SSL::SSLError /* Document-class: OpenSSL::SSL::SSLError
* *
Expand Down Expand Up @@ -2010,7 +2010,7 @@ Init_ossl_ssl()
* and to cancel the process, an Error may be raised within the callback. * and to cancel the process, an Error may be raised within the callback.
* *
* === Disable client renegotiation * === Disable client renegotiation
* *
* When running a server, it is often desirable to disable client * When running a server, it is often desirable to disable client
* renegotiation entirely. You may use a callback as follows to implement * renegotiation entirely. You may use a callback as follows to implement
* this feature: * this feature:
Expand All @@ -2019,7 +2019,7 @@ Init_ossl_ssl()
* ctx.renegotiation_cb = lambda do |ssl| * ctx.renegotiation_cb = lambda do |ssl|
* num_handshakes += 1 * num_handshakes += 1
* raise RuntimeError.new("Client renegotiation disabled") if num_handshakes > 1 * raise RuntimeError.new("Client renegotiation disabled") if num_handshakes > 1
* end * end
*/ */
rb_attr(cSSLContext, rb_intern("renegotiation_cb"), 1, 1, Qfalse); rb_attr(cSSLContext, rb_intern("renegotiation_cb"), 1, 1, Qfalse);
#ifdef HAVE_OPENSSL_NPN_NEGOTIATED #ifdef HAVE_OPENSSL_NPN_NEGOTIATED
Expand All @@ -2042,7 +2042,7 @@ Init_ossl_ssl()
* the server. If none is acceptable, raising an error in the callback * the server. If none is acceptable, raising an error in the callback
* will cause the handshake to fail. Not setting this callback explicitly * will cause the handshake to fail. Not setting this callback explicitly
* means not supporting the NPN extension on the client - any protocols * means not supporting the NPN extension on the client - any protocols
* advertised by the server will be ignored. * advertised by the server will be ignored.
* *
* === Example * === Example
* *
Expand Down
2 changes: 1 addition & 1 deletion ext/readline/readline.c
Expand Up @@ -495,7 +495,7 @@ readline_s_set_output(VALUE self, VALUE output)
* characters. * characters.
* *
* See GNU Readline's rl_pre_input_hook variable. * See GNU Readline's rl_pre_input_hook variable.
* *
* Raises ArgumentError if +proc+ does not respond to the call method. * Raises ArgumentError if +proc+ does not respond to the call method.
* *
* Raises SecurityError if $SAFE is 4. * Raises SecurityError if $SAFE is 4.
Expand Down
40 changes: 20 additions & 20 deletions ext/tk/lib/tk/image.rb
Expand Up @@ -130,7 +130,7 @@ def initialize(*args)
# A photo is an image whose pixels can display any color or be transparent. # A photo is an image whose pixels can display any color or be transparent.
# At present, only GIF and PPM/PGM formats are supported, but an interface # At present, only GIF and PPM/PGM formats are supported, but an interface
# exists to allow additional image file formats to be added easily. # exists to allow additional image file formats to be added easily.
# #
# This class documentation is a copy from the original Tcl/Tk at # This class documentation is a copy from the original Tcl/Tk at
# http://www.tcl.tk/man/tcl8.5/TkCmd/photo.htm with some rewrited parts. # http://www.tcl.tk/man/tcl8.5/TkCmd/photo.htm with some rewrited parts.
class TkPhotoImage<TkImage class TkPhotoImage<TkImage
Expand Down Expand Up @@ -162,13 +162,13 @@ def _photo_hash_kv(keys)
# image = TkPhotoImage.new(:file: => 'my_image.gif') # image = TkPhotoImage.new(:file: => 'my_image.gif')
# #
# == Options # == Options
# Photos support the following options: # Photos support the following options:
# * :data # * :data
# Specifies the contents of the image as a string. # Specifies the contents of the image as a string.
# * :format # * :format
# Specifies the name of the file format for the data. # Specifies the name of the file format for the data.
# * :file # * :file
# Gives the name of a file that is to be read to supply data for the image. # Gives the name of a file that is to be read to supply data for the image.
# * :gamma # * :gamma
# Specifies that the colors allocated for displaying this image in a window # Specifies that the colors allocated for displaying this image in a window
# should be corrected for a non-linear display with the specified gamma # should be corrected for a non-linear display with the specified gamma
Expand All @@ -185,15 +185,15 @@ def _photo_hash_kv(keys)
# Specifies the width of the image, in pixels. This option is useful # Specifies the width of the image, in pixels. This option is useful
# primarily in situations where the user wishes to build up the contents of # primarily in situations where the user wishes to build up the contents of
# the image piece by piece. A value of zero (the default) allows the image # the image piece by piece. A value of zero (the default) allows the image
# to expand or shrink horizontally to fit the data stored in it. # to expand or shrink horizontally to fit the data stored in it.
def initialize(*args) def initialize(*args)
@type = 'photo' @type = 'photo'
super(*args) super(*args)
end end


# Blank the image; that is, set the entire image to have no data, so it will # Blank the image; that is, set the entire image to have no data, so it will
# be displayed as transparent, and the background of whatever window it is # be displayed as transparent, and the background of whatever window it is
# displayed in will show through. # displayed in will show through.
def blank def blank
tk_send_without_enc('blank') tk_send_without_enc('blank')
self self
Expand Down Expand Up @@ -233,7 +233,7 @@ def cget(option)
# destination, possibly with pixel zooming and/or subsampling. If no options # destination, possibly with pixel zooming and/or subsampling. If no options
# are specified, this method copies the whole of source into destination, # are specified, this method copies the whole of source into destination,
# starting at coordinates (0,0) in destination. The following options may be # starting at coordinates (0,0) in destination. The following options may be
# specified: # specified:
# #
# * :from [x1, y1, x2, y2] # * :from [x1, y1, x2, y2]
# Specifies a rectangular sub-region of the source image to be copied. # Specifies a rectangular sub-region of the source image to be copied.
Expand All @@ -250,30 +250,30 @@ def cget(option)
# specified). If x2 and y2 are specified, the source region will be # specified). If x2 and y2 are specified, the source region will be
# replicated if necessary to fill the destination region in a tiled fashion. # replicated if necessary to fill the destination region in a tiled fashion.
# * :shrink # * :shrink
# Specifies that the size of the destination image should be reduced, if # Specifies that the size of the destination image should be reduced, if
# necessary, so that the region being copied into is at the bottom-right # necessary, so that the region being copied into is at the bottom-right
# corner of the image. This option will not affect the width or height of # corner of the image. This option will not affect the width or height of
# the image if the user has specified a non-zero value for the :width or # the image if the user has specified a non-zero value for the :width or
# :height configuration option, respectively. # :height configuration option, respectively.
# * :zoom [x, y] # * :zoom [x, y]
# Specifies that the source region should be magnified by a factor of x # Specifies that the source region should be magnified by a factor of x
# in the X direction and y in the Y direction. If y is not given, the # in the X direction and y in the Y direction. If y is not given, the
# default value is the same as x. With this option, each pixel in the # default value is the same as x. With this option, each pixel in the
# source image will be expanded into a block of x x y pixels in the # source image will be expanded into a block of x x y pixels in the
# destination image, all the same color. x and y must be greater than 0. # destination image, all the same color. x and y must be greater than 0.
# * :subsample [x, y] # * :subsample [x, y]
# Specifies that the source image should be reduced in size by using only # Specifies that the source image should be reduced in size by using only
# every xth pixel in the X direction and yth pixel in the Y direction. # every xth pixel in the X direction and yth pixel in the Y direction.
# Negative values will cause the image to be flipped about the Y or X axes, # Negative values will cause the image to be flipped about the Y or X axes,
# respectively. If y is not given, the default value is the same as x. # respectively. If y is not given, the default value is the same as x.
# * :compositingrule rule # * :compositingrule rule
# Specifies how transparent pixels in the source image are combined with # Specifies how transparent pixels in the source image are combined with
# the destination image. When a compositing rule of <tt>overlay</tt> is set, # the destination image. When a compositing rule of <tt>overlay</tt> is set,
# the old contents of the destination image are visible, as if the source # the old contents of the destination image are visible, as if the source
# image were printed on a piece of transparent film and placed over the # image were printed on a piece of transparent film and placed over the
# top of the destination. When a compositing rule of <tt>set</tt> is set, # top of the destination. When a compositing rule of <tt>set</tt> is set,
# the old contents of the destination image are discarded and the source # the old contents of the destination image are discarded and the source
# image is used as-is. The default compositing rule is <tt>overlay</tt>. # image is used as-is. The default compositing rule is <tt>overlay</tt>.
def copy(src, *opts) def copy(src, *opts)
if opts.size == 0 if opts.size == 0
tk_send('copy', src) tk_send('copy', src)
Expand Down Expand Up @@ -314,14 +314,14 @@ def copy(src, *opts)
# whole image. # whole image.
# * :grayscale # * :grayscale
# If this options is specified, the data will not contain color information. # If this options is specified, the data will not contain color information.
# All pixel data will be transformed into grayscale. # All pixel data will be transformed into grayscale.
def data(keys={}) def data(keys={})
tk_split_list(tk_send('data', *_photo_hash_kv(keys))) tk_split_list(tk_send('data', *_photo_hash_kv(keys)))
end end


# Returns the color of the pixel at coordinates (x,y) in the image as a list # Returns the color of the pixel at coordinates (x,y) in the image as a list
# of three integers between 0 and 255, representing the red, green and blue # of three integers between 0 and 255, representing the red, green and blue
# components respectively. # components respectively.
def get(x, y) def get(x, y)
tk_send('get', x, y).split.collect{|n| n.to_i} tk_send('get', x, y).split.collect{|n| n.to_i}
end end
Expand Down Expand Up @@ -362,13 +362,13 @@ def redither
self self
end end


# Returns a boolean indicating if the pixel at (x,y) is transparent. # Returns a boolean indicating if the pixel at (x,y) is transparent.
def get_transparency(x, y) def get_transparency(x, y)
bool(tk_send('transparency', 'get', x, y)) bool(tk_send('transparency', 'get', x, y))
end end

# Makes the pixel at (x,y) transparent if <tt>state</tt> is true, and makes # Makes the pixel at (x,y) transparent if <tt>state</tt> is true, and makes
# that pixel opaque otherwise. # that pixel opaque otherwise.
def set_transparency(x, y, state) def set_transparency(x, y, state)
tk_send('transparency', 'set', x, y, state) tk_send('transparency', 'set', x, y, state)
self self
Expand Down

0 comments on commit af6c038

Please sign in to comment.