From 49e9f42703e4d67ab3a2e9657efe83b297e87b01 Mon Sep 17 00:00:00 2001 From: akr Date: Thu, 4 Sep 2008 10:22:11 +0000 Subject: * include/ruby/io.h (rb_io_enc_t): rename flags to ecflags. (rb_io_t): rename writeconv_pre_flags to writeconv_pre_ecflags. (MakeOpenFile): follow the renaming. * io.c: follow the renaming. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19124 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 8 ++++++++ include/ruby/io.h | 8 ++++---- io.c | 26 +++++++++++++------------- 3 files changed, 25 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index 116aff0bb2..dd29299a4c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Thu Sep 4 19:20:24 2008 Tanaka Akira + + * include/ruby/io.h (rb_io_enc_t): rename flags to ecflags. + (rb_io_t): rename writeconv_pre_flags to writeconv_pre_ecflags. + (MakeOpenFile): follow the renaming. + + * io.c: follow the renaming. + Thu Sep 4 19:10:27 2008 Tanaka Akira * include/ruby/encoding.h (ECONV_INVALID_IGNORE): removed because diff --git a/include/ruby/io.h b/include/ruby/io.h index 676fd05ae3..8d82338e0b 100644 --- a/include/ruby/io.h +++ b/include/ruby/io.h @@ -57,7 +57,7 @@ typedef struct rb_io_t { struct rb_io_enc_t { rb_encoding *enc; rb_encoding *enc2; - int flags; + int ecflags; VALUE ecopts; } encs; @@ -69,7 +69,7 @@ typedef struct rb_io_t { rb_econv_t *writeconv; VALUE writeconv_stateless; - int writeconv_pre_flags; + int writeconv_pre_ecflags; VALUE writeconv_pre_ecopts; int writeconv_initialized; @@ -125,13 +125,13 @@ typedef struct rb_io_t { fp->cbuf_capa = 0;\ fp->writeconv = NULL;\ fp->writeconv_stateless = Qnil;\ - fp->writeconv_pre_flags = 0;\ + fp->writeconv_pre_ecflags = 0;\ fp->writeconv_pre_ecopts = Qnil;\ fp->writeconv_initialized = 0;\ fp->tied_io_for_writing = 0;\ fp->encs.enc = NULL;\ fp->encs.enc2 = NULL;\ - fp->encs.flags = 0;\ + fp->encs.ecflags = 0;\ fp->encs.ecopts = Qnil;\ } while (0) diff --git a/io.c b/io.c index 67414fb319..aef0fcf926 100644 --- a/io.c +++ b/io.c @@ -697,9 +697,9 @@ make_writeconv(rb_io_t *fptr) /* ECONV_INVALID_XXX and ECONV_UNDEF_XXX should be set both. * But ECONV_CRLF_NEWLINE_ENCODER should be set only for the first. */ - fptr->writeconv_pre_flags = fptr->encs.flags; + fptr->writeconv_pre_ecflags = fptr->encs.ecflags; fptr->writeconv_pre_ecopts = fptr->encs.ecopts; - ecflags = fptr->encs.flags; + ecflags = fptr->encs.ecflags; ecopts = fptr->encs.ecopts; #ifdef TEXTMODE_NEWLINE_ENCODER @@ -714,7 +714,7 @@ make_writeconv(rb_io_t *fptr) } if (NEED_NEWLINE_ENCODER(fptr)) - fptr->writeconv_pre_flags |= TEXTMODE_NEWLINE_ENCODER; + fptr->writeconv_pre_ecflags |= TEXTMODE_NEWLINE_ENCODER; #endif enc = fptr->encs.enc2 ? fptr->encs.enc2 : fptr->encs.enc; @@ -757,7 +757,7 @@ io_fwrite(VALUE str, rb_io_t *fptr) if (!NIL_P(common_encoding)) { str = rb_str_transcode(str, common_encoding, - fptr->writeconv_pre_flags, fptr->writeconv_pre_ecopts); + fptr->writeconv_pre_ecflags, fptr->writeconv_pre_ecopts); } if (fptr->writeconv) { @@ -1444,7 +1444,7 @@ make_readconv(rb_io_t *fptr) int ecflags; VALUE ecopts; const char *sname, *dname; - ecflags = fptr->encs.flags; + ecflags = fptr->encs.ecflags; ecopts = fptr->encs.ecopts; if (NEED_NEWLINE_DECODER(fptr)) ecflags |= ECONV_UNIVERSAL_NEWLINE_DECODER; @@ -3906,7 +3906,7 @@ rb_io_extract_modeenc(VALUE *mode_p, VALUE opthash, *flags_p = flags; convconfig_p->enc = enc; convconfig_p->enc2 = enc2; - convconfig_p->flags = ecflags; + convconfig_p->ecflags = ecflags; convconfig_p->ecopts = ecopts; } @@ -4015,7 +4015,7 @@ rb_file_open_generic(VALUE io, VALUE filename, int modenum, int flags, convconfi else { fptr->encs.enc = NULL; fptr->encs.enc2 = NULL; - fptr->encs.flags = 0; + fptr->encs.ecflags = 0; fptr->encs.ecopts = Qnil; } fptr->pathv = rb_str_new_frozen(filename); @@ -4038,7 +4038,7 @@ rb_file_open_internal(VALUE io, VALUE filename, const char *mode) else { convconfig.enc = NULL; convconfig.enc2 = NULL; - convconfig.flags = 0; + convconfig.ecflags = 0; convconfig.ecopts = Qnil; } @@ -5024,7 +5024,7 @@ rb_io_reopen(int argc, VALUE *argv, VALUE file) } fptr->mode = flags; rb_io_mode_enc(fptr, StringValueCStr(nmode)); - fptr->encs.flags = 0; + fptr->encs.ecflags = 0; fptr->encs.ecopts = Qnil; } @@ -6595,14 +6595,14 @@ io_encoding_set(rb_io_t *fptr, int argc, VALUE v1, VALUE v2, VALUE opt) if (argc == 2) { fptr->encs.enc2 = rb_to_encoding(v1); fptr->encs.enc = rb_to_encoding(v2); - fptr->encs.flags = rb_econv_prepare_opts(opt, &fptr->encs.ecopts); + fptr->encs.ecflags = rb_econv_prepare_opts(opt, &fptr->encs.ecopts); clear_codeconv(fptr); } else if (argc == 1) { if (NIL_P(v1)) { fptr->encs.enc = NULL; fptr->encs.enc2 = NULL; - fptr->encs.flags = 0; + fptr->encs.ecflags = 0; fptr->encs.ecopts = Qnil; clear_codeconv(fptr); } @@ -6610,12 +6610,12 @@ io_encoding_set(rb_io_t *fptr, int argc, VALUE v1, VALUE v2, VALUE opt) VALUE tmp = rb_check_string_type(v1); if (!NIL_P(tmp)) { mode_enc(fptr, StringValueCStr(tmp)); - fptr->encs.flags = rb_econv_prepare_opts(opt, &fptr->encs.ecopts); + fptr->encs.ecflags = rb_econv_prepare_opts(opt, &fptr->encs.ecopts); } else { fptr->encs.enc = rb_to_encoding(v1); fptr->encs.enc2 = NULL; - fptr->encs.flags = 0; + fptr->encs.ecflags = 0; fptr->encs.ecopts = Qnil; clear_codeconv(fptr); } -- cgit v1.2.3