Permalink
Browse files

Merge from ruby_1_8.

git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8_7@16719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
1 parent 92b5d09 commit 5376e8a9b4f5ce47dbdd76f724a9e996ab7e530b @knu knu committed May 31, 2008
Showing with 218 additions and 180 deletions.
  1. +18 −0 ChangeLog
  2. +1 −0 Makefile.in
  3. +1 −1 NEWS
  4. +5 −1 configure.in
  5. +1 −1 dir.c
  6. +3 −0 enum.c
  7. +4 −4 error.c
  8. +29 −29 eval.c
  9. +6 −4 ext/tk/sample/demos-en/toolbar.rb
  10. +3 −3 ext/tk/sample/demos-en/ttkprogress.rb
  11. +36 −32 ext/tk/sample/demos-en/widget
  12. +35 −32 ext/tk/sample/demos-jp/widget
  13. +1 −1 file.c
  14. +1 −1 intern.h
  15. +15 −14 io.c
  16. +1 −1 keywords
  17. +1 −1 lex.c
  18. +3 −3 marshal.c
  19. +1 −1 numeric.c
  20. +4 −5 object.c
  21. +10 −10 pack.c
  22. +5 −5 parse.y
  23. +5 −4 re.c
  24. +1 −1 ruby.c
  25. +3 −3 ruby.h
  26. +4 −4 signal.c
  27. +6 −4 string.c
  28. +4 −4 struct.c
  29. +2 −2 time.c
  30. +1 −1 util.c
  31. +5 −5 variable.c
  32. +3 −3 version.h
View
@@ -1,3 +1,16 @@
+Sat May 31 18:28:17 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * suppress warnings with -Wwrite-string.
+
+Sat May 31 15:58:08 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * Makefile.in, configure.in (warnflags): defaulted to -Wall
+ -Wno-parentheses with gcc. [ruby-dev:34810]
+
+Fri May 30 05:28:18 2008 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * enum.c (count_i, count_iter_i, count_all_i): add prototypes for VC.
+
Fri May 30 04:32:07 2008 Akinori MUSHA <knu@iDaemons.org>
* enum.c (count_i, count_iter_i): Sync with trunk.
@@ -28,6 +41,11 @@ Thu May 29 20:07:45 2008 Akinori MUSHA <knu@iDaemons.org>
ruby.c, lib/mkmf.rb, README.EXT, README.EXT.ja: Backport the
vendor_ruby directory support.
+Thu May 29 17:52:31 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/zlib/extconf.rb: search zlib1, and regard mswin32 later than VC6
+ as WIN32. [ruby-core:16984]
+
Wed May 28 17:54:29 2008 Akinori MUSHA <knu@iDaemons.org>
* string.c (rb_str_start_with): Remove an unused variable.
View
@@ -42,6 +42,7 @@ CPPFLAGS = -I. -I$(srcdir) @CPPFLAGS@
LDFLAGS = @STATIC@ $(CFLAGS) @LDFLAGS@
EXTLDFLAGS =
XLDFLAGS = @XLDFLAGS@ $(EXTLDFLAGS)
+warnflags = @warnflags@
EXTLIBS =
LIBS = @LIBS@ $(EXTLIBS)
MISSING = @LIBOBJS@ @ALLOCA@
View
@@ -260,7 +260,7 @@ with all sufficient information, see the ChangeLog file.
* String#each_byte
* String#each
- * String#each_lines
+ * String#each_line
* String#gsub(pattern)
Return an enumerator if no block is given.
View
@@ -156,13 +156,16 @@ AC_ARG_PROGRAM
dnl Checks for programs.
+: ${CFLAGS=} ${CXXFLAGS=}
if test x"${build}" != x"${host}"; then
AC_CHECK_TOOL(CC, gcc)
fi
AC_PROG_CC
AC_PROG_GCC_TRADITIONAL
+test $ac_cv_prog_cc_g = yes && : ${debugflags=-g}
if test "$GCC" = yes; then
linker_flag=-Wl,
+ : ${optflags=-O2} ${warnflags="-Wall -Wno-parentheses"}
else
linker_flag=
fi
@@ -1638,9 +1641,10 @@ CPPFLAGS="$CPPFLAGS "'$(DEFS)'
test -z "$CFLAGS" || CFLAGS="$CFLAGS "; CFLAGS="$CFLAGS"'${cflags}'
test -z "$CPPFLAGS" || CPPFLAGS="$CPPFLAGS "; CPPFLAGS="$CPPFLAGS"'${cppflags}'
AC_SUBST(cppflags, [])dnl
-AC_SUBST(cflags, ['${optflags} ${debugflags}'])dnl
+AC_SUBST(cflags, ['${optflags} ${debugflags} ${warnflags}'])dnl
AC_SUBST(optflags)dnl
AC_SUBST(debugflags)dnl
+AC_SUBST(warnflags)dnl
AC_SUBST(XCFLAGS)dnl
AC_SUBST(XLDFLAGS)dnl
AC_SUBST(LIBRUBY_LDSHARED)
View
@@ -475,7 +475,7 @@ dir_inspect(dir)
Data_Get_Struct(dir, struct dir_data, dirp);
if (dirp->path) {
- char *c = rb_obj_classname(dir);
+ const char *c = rb_obj_classname(dir);
int len = strlen(c) + strlen(dirp->path) + 4;
VALUE s = rb_str_new(0, len);
snprintf(RSTRING_PTR(s), len+1, "#<%s:%s>", c, dirp->path);
View
@@ -113,6 +113,7 @@ enum_grep(obj, pat)
return ary;
}
+static VALUE count_i _((VALUE, VALUE));
static VALUE
count_i(i, memop)
VALUE i, memop;
@@ -125,6 +126,7 @@ count_i(i, memop)
return Qnil;
}
+static VALUE count_iter_i _((VALUE, VALUE));
static VALUE
count_iter_i(i, memop)
VALUE i, memop;
@@ -137,6 +139,7 @@ count_iter_i(i, memop)
return Qnil;
}
+static VALUE count_all_i _((VALUE, VALUE));
static VALUE
count_all_i(i, memop)
VALUE i, memop;
View
@@ -259,7 +259,7 @@ rb_check_type(x, t)
if (TYPE(x) != t) {
while (type->type >= 0) {
if (type->type == t) {
- char *etype;
+ const char *etype;
if (NIL_P(x)) {
etype = "nil";
@@ -500,7 +500,7 @@ rb_check_backtrace(bt)
VALUE bt;
{
long i;
- static char *err = "backtrace must be Array of String";
+ static const char err[] = "backtrace must be Array of String";
if (!NIL_P(bt)) {
int t = TYPE(bt);
@@ -729,7 +729,7 @@ name_err_mesg_to_str(obj)
mesg = ptr[0];
if (NIL_P(mesg)) return Qnil;
else {
- char *desc = 0;
+ const char *desc = 0;
VALUE d = 0, args[3];
obj = ptr[1];
@@ -883,7 +883,7 @@ syserr_initialize(argc, argv, self)
#if !defined(_WIN32) && !defined(__VMS)
char *strerror();
#endif
- char *err;
+ const char *err;
VALUE mesg, error;
VALUE klass = rb_obj_class(self);
View
@@ -1103,8 +1103,8 @@ static void scope_dup _((struct SCOPE *));
} while (0)
static VALUE rb_eval _((VALUE,NODE*));
-static VALUE eval _((VALUE,VALUE,VALUE,char*,int));
-static NODE *compile _((VALUE, char*, int));
+static VALUE eval _((VALUE,VALUE,VALUE,const char*,int));
+static NODE *compile _((VALUE, const char*, int));
static VALUE rb_yield_0 _((VALUE, VALUE, VALUE, int, int));
@@ -1227,7 +1227,7 @@ error_print()
{
VALUE errat = Qnil; /* OK */
volatile VALUE eclass, e;
- char *einfo;
+ const char *einfo;
long elen;
if (NIL_P(ruby_errinfo)) return;
@@ -2032,7 +2032,7 @@ void
rb_frozen_class_p(klass)
VALUE klass;
{
- char *desc = "something(?!)";
+ const char *desc = "something(?!)";
if (OBJ_FROZEN(klass)) {
if (FL_TEST(klass, FL_SINGLETON))
@@ -2070,7 +2070,7 @@ rb_undef(klass, id)
}
body = search_method(klass, id, &origin);
if (!body || !body->nd_body) {
- char *s0 = " class";
+ const char *s0 = " class";
VALUE c = klass;
if (FL_TEST(c, FL_SINGLETON)) {
@@ -2322,9 +2322,9 @@ rb_copy_node_scope(node, rval)
#define MATCH_DATA *rb_svar(node->nd_cnt)
-static char* is_defined _((VALUE, NODE*, char*));
+static const char* is_defined _((VALUE, NODE*, char*));
-static char*
+static const char*
arg_defined(self, node, buf, type)
VALUE self;
NODE *node;
@@ -2351,7 +2351,7 @@ arg_defined(self, node, buf, type)
return type;
}
-static char*
+static const char*
is_defined(self, node, buf)
VALUE self;
NODE *node; /* OK */
@@ -2671,27 +2671,27 @@ set_trace_func(obj, trace)
return trace;
}
-static char *
+static const char *
get_event_name(rb_event_t event)
{
switch (event) {
- case RUBY_EVENT_LINE:
+ case RUBY_EVENT_LINE:
return "line";
- case RUBY_EVENT_CLASS:
+ case RUBY_EVENT_CLASS:
return "class";
- case RUBY_EVENT_END:
+ case RUBY_EVENT_END:
return "end";
- case RUBY_EVENT_CALL:
+ case RUBY_EVENT_CALL:
return "call";
- case RUBY_EVENT_RETURN:
+ case RUBY_EVENT_RETURN:
return "return";
- case RUBY_EVENT_C_CALL:
+ case RUBY_EVENT_C_CALL:
return "c-call";
- case RUBY_EVENT_C_RETURN:
+ case RUBY_EVENT_C_RETURN:
return "c-return";
- case RUBY_EVENT_RAISE:
+ case RUBY_EVENT_RAISE:
return "raise";
- default:
+ default:
return "unknown";
}
}
@@ -2708,7 +2708,7 @@ call_trace_func(event, node, self, id, klass)
struct FRAME *prev;
NODE *node_save;
VALUE srcfile;
- char *event_name;
+ const char *event_name;
if (!trace_func) return;
if (tracing) return;
@@ -4136,7 +4136,7 @@ rb_eval(self, n)
case NODE_DEFINED:
{
char buf[20];
- char *desc = is_defined(self, node->nd_head, buf);
+ const char *desc = is_defined(self, node->nd_head, buf);
if (desc) result = rb_str_new2(desc);
else result = Qnil;
@@ -4804,7 +4804,7 @@ proc_jump_error(state, result)
VALUE result;
{
char mesg[32];
- char *statement;
+ const char *statement;
switch (state) {
case TAG_BREAK:
@@ -5638,7 +5638,7 @@ rb_method_missing(argc, argv, obj)
{
ID id;
VALUE exc = rb_eNoMethodError;
- char *format = 0;
+ const char *format = 0;
NODE *cnode = ruby_current_node;
if (argc == 0 || !SYMBOL_P(argv[0])) {
@@ -6448,7 +6448,7 @@ rb_frame_this_func()
static NODE*
compile(src, file, line)
VALUE src;
- char *file;
+ const char *file;
int line;
{
NODE *node;
@@ -6468,7 +6468,7 @@ compile(src, file, line)
static VALUE
eval(self, src, scope, file, line)
VALUE self, src, scope;
- char *file;
+ const char *file;
int line;
{
struct BLOCK *data = NULL;
@@ -6629,7 +6629,7 @@ rb_f_eval(argc, argv, self)
VALUE self;
{
VALUE src, scope, vfile, vline;
- char *file = "(eval)";
+ const char *file = "(eval)";
int line = 1;
rb_scan_args(argc, argv, "13", &src, &scope, &vfile, &vline);
@@ -6783,7 +6783,7 @@ specific_eval(argc, argv, klass, self)
return yield_under(klass, self, Qundef);
}
else {
- char *file = "(eval)";
+ const char *file = "(eval)";
int line = 1;
if (argc == 0) {
@@ -9014,7 +9014,7 @@ proc_to_s(self)
{
struct BLOCK *data;
NODE *node;
- char *cname = rb_obj_classname(self);
+ const char *cname = rb_obj_classname(self);
const int w = (sizeof(VALUE) * CHAR_BIT) / 4;
long len = strlen(cname)+6+w; /* 6:tags 16:addr */
VALUE str;
@@ -9748,7 +9748,7 @@ method_inspect(method)
struct METHOD *data;
VALUE str;
const char *s;
- char *sharp = "#";
+ const char *sharp = "#";
Data_Get_Struct(method, struct METHOD, data);
str = rb_str_buf_new2("#<");
@@ -12923,7 +12923,7 @@ static VALUE
rb_thread_inspect(thread)
VALUE thread;
{
- char *cname = rb_obj_classname(thread);
+ const char *cname = rb_obj_classname(thread);
rb_thread_t th = rb_thread_check(thread);
const char *status = thread_status_name(th->status);
VALUE str;
@@ -18,11 +18,12 @@
base_frame = Ttk::Frame.new($toolbar_demo).pack(:fill=>:both, :expand=>true)
if Tk.windowingsystem != 'aqua'
- msg = Ttk::Label.new(base_frame, :wraplength=>'4i', :text=><<EOL)
+ msg = Ttk::Label.new(base_frame, :wraplength=>'4i',
+ :text=>Tk::UTF8_String.new(<<EOL))
This is a demonstration of how to do \
a toolbar that is styled correctly \
and which can be torn off (this feature reqrires Tcl/Tk8.5). \
-The buttons are configured to be \u201Ctoolbar style\u201D buttons by \
+The buttons are configured to be \\u201Ctoolbar style\\u201D buttons by \
telling them that they are to use the Toolbutton style. At the left \
end of the toolbar is a simple marker that the cursor changes to a \
movement icon over; drag that away from the toolbar to tear off the \
@@ -31,10 +32,11 @@
and it will reattach to the window it was torn off from.
EOL
else
- msg = Ttk::Label.new(base_frame, :wraplength=>'4i', :text=><<EOL)
+ msg = Ttk::Label.new(base_frame, :wraplength=>'4i',
+ :text=>Tk::UTF8_String.new(<<EOL))
This is a demonstration of how to do \
a toolbar that is styled correctly. The buttons are configured to \
-be \u201Ctoolbar style\u201D buttons by telling them that they are \
+be \\u201Ctoolbar style\\u201D buttons by telling them that they are \
to use the Toolbutton style.
EOL
end
@@ -18,11 +18,11 @@
base_frame = TkFrame.new($ttkprogress_demo).pack(:fill=>:both, :expand=>true)
Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', :justify=>:left,
- :text=><<EOL).pack(:side=>:top, :fill=>:x)
+ :text=>Tk::UTF8_String.new(<<EOL)).pack(:side=>:top, :fill=>:x)
Below are two progress bars. \
-The top one is a \u201Cdeterminate\u201D progress bar, \
+The top one is a \\u201Cdeterminate\\u201D progress bar, \
which is used for showing how far through a defined task the program has got. \
-The bottom one is an \u201Cindeterminate\u201D progress bar, \
+The bottom one is an \\u201Cindeterminate\\u201D progress bar, \
which is used to show that the program is busy \
but does not know how long for. Both are run here in self-animated mode, \
which can be turned on and off using the buttons underneath.
Oops, something went wrong.

0 comments on commit 5376e8a

Please sign in to comment.