diff --git a/ChangeLog b/ChangeLog index c7f0c621b0..eb7774ec17 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,37 @@ +Wed Feb 7 16:05:22 2001 Nobuyoshi Nakada + + * parse.y (parse_quotedwords): %w should allow parenthesis escape. + +Wed Feb 7 00:57:42 2001 Yukihiro Matsumoto + + * parse.y (parse_qstring): %q should allow terminator escape. + +Wed Feb 7 00:57:42 2001 Yukihiro Matsumoto + + * re.c (rb_reg_equal): all option flags should be same to be equal. + Tue Feb 6 21:01:29 2001 Minero Aoki * lib/net/protocol.rb: ignore EOFError on only specified case. * lib/net/http.rb: take HTTP 1.0 server into account. +Mon Feb 5 00:39:06 2001 KANEKO Naoshi + + * dir.c: use ISXXX() instead of isxxx(). + + * dln.c (aix_loaderror): ditto. + + * file.c (rb_file_s_expand_path): ditto. + + * string.c (rb_str_upcase_bang): ditto. + + * win32/win32.c (do_spawn): ditto. + + * win32/win32.c (NtMakeCmdVector): ditto. + + * win32/win32.c (opendir): ditto. + Fri Feb 3 00:48:50 2001 Usaku Nakamura * win32/win32.c (isInternalCmd): ignore case for shell's internal @@ -11,9 +39,6 @@ Fri Feb 3 00:48:50 2001 Usaku Nakamura Fri Feb 2 16:14:51 2001 Yukihiro Matsumoto - * array.c (rb_ary_sort_bang): returns self, even if its length is - less than 2. - * eval.c (POP_VARS): propagate DVAR_DONT_RECYCLE, if SCOPE_DONT_RECYCLE of ruby_scope is set. diff --git a/configure.in b/configure.in index 9e4516b6d3..7a72397182 100644 --- a/configure.in +++ b/configure.in @@ -319,6 +319,7 @@ main() ], rb_cv_func_strtod=yes, rb_cv_func_strtod=no, rb_cv_func_strtod=no)]) test $rb_cv_func_strtod = no && LIBOBJS="$LIBOBJS strtod.o" +AC_C_INLINE AC_C_BIGENDIAN AC_C_CONST AC_C_CHAR_UNSIGNED diff --git a/dir.c b/dir.c index 37cf332cb5..49002fc77c 100644 --- a/dir.c +++ b/dir.c @@ -69,7 +69,7 @@ char *strchr _((char*,char)); #define FNM_NOMATCH 1 #define FNM_ERROR 2 -#define downcase(c) (nocase && isupper(c) ? tolower(c) : (c)) +#define downcase(c) (nocase && ISUPPER(c) ? tolower(c) : (c)) #if defined DOSISH #define isdirsep(c) ((c) == '/' || (c) == '\\') diff --git a/dln.c b/dln.c index 8046b158b3..a98a44c517 100644 --- a/dln.c +++ b/dln.c @@ -1204,7 +1204,7 @@ aix_loaderror(const char *pathname) if (nerr == load_errtab[i].errno && load_errtab[i].errstr) ERRBUF_APPEND(load_errtab[i].errstr); } - while (isdigit(*message[i])) message[i]++; + while (ISDIGIT(*message[i])) message[i]++; ERRBUF_APPEND(message[i]); ERRBUF_APPEND("\n"); } diff --git a/eval.c b/eval.c index 861a656f0c..1195bebdb1 100644 --- a/eval.c +++ b/eval.c @@ -4471,7 +4471,7 @@ rb_call(klass, recv, mid, argc, argv, scope) struct cache_entry *ent; if (!klass) { - rb_raise(rb_eNotImpError, "method call on terminated obejct"); + rb_raise(rb_eNotImpError, "method call on terminated object"); } /* is it in the method cache? */ ent = cache + EXPR1(klass, mid); diff --git a/file.c b/file.c index db200c6f7e..667ff1cb12 100644 --- a/file.c +++ b/file.c @@ -1253,7 +1253,7 @@ rb_file_s_expand_path(argc, argv) } #if defined DOSISH /* skip drive letter */ - else if (isalpha(s[0]) && s[1] == ':' && isdirsep(s[2])) { + else if (ISALPHA(s[0]) && s[1] == ':' && isdirsep(s[2])) { while (*s && !isdirsep(*s)) { *p++ = *s++; } diff --git a/gc.c b/gc.c index 2e5bcf8871..f8cc4cff35 100644 --- a/gc.c +++ b/gc.c @@ -315,10 +315,7 @@ rb_data_object_alloc(klass, datap, dmark, dfree) extern st_table *rb_class_tbl; VALUE *rb_gc_stack_start = 0; -#if defined(__GNUC__) && __GNUC__ >= 2 -__inline__ -#endif -static int +static inline int is_pointer_to_heap(ptr) void *ptr; { @@ -1053,6 +1050,7 @@ os_live_obj() case T_CLASS: if (FL_TEST(p, FL_SINGLETON)) continue; default: + if (!p->as.basic.klass) continue; rb_yield((VALUE)p); n++; } @@ -1085,6 +1083,7 @@ os_obj_of(of) case T_CLASS: if (FL_TEST(p, FL_SINGLETON)) continue; default: + if (!p->as.basic.klass) continue; if (rb_obj_is_kind_of((VALUE)p, of)) { rb_yield((VALUE)p); n++; @@ -1218,7 +1217,6 @@ run_final(obj) } if (finalizer_table && st_delete(finalizer_table, &obj, &table)) { for (i=0; ilen; i++) { - printf("n finals=>%d\n", finalizer_table->num_entries); args[0] = RARRAY(table)->ptr[i]; rb_protect(run_single_final, (VALUE)args, &status); } @@ -1247,7 +1245,6 @@ rb_gc_call_finalizer_at_exit() if (FL_TEST(p, FL_FINALIZE)) { FL_UNSET(p, FL_FINALIZE); p->as.basic.klass = 0; - printf("%p\n", p); run_final((VALUE)p); } p++; diff --git a/lib/importenv.rb b/lib/importenv.rb index fcf306a9ab..abf1c306ef 100644 --- a/lib/importenv.rb +++ b/lib/importenv.rb @@ -9,11 +9,12 @@ for k,v in ENV next unless /^[a-zA-Z][_a-zA-Z0-9]*/ =~ k + v = v.gsub(/\\/) {|s| '\\'+s} eval <?\\)?\\|>[>=]?\\|===?\\|=~\\|\\[\\]\\|\\(\\w\\|_\\)+\\([!?=]\\|\\b\\)\\)\\)" 2 font-lock-reference-face)) "*Additional expressions to highlight in ruby mode.")) diff --git a/pack.c b/pack.c index cb5e024e6a..9e05f46c5a 100644 --- a/pack.c +++ b/pack.c @@ -1026,11 +1026,7 @@ qpencode(str, from, len) } } -#if defined(__GNUC__) && __GNUC__ >= 2 && !defined(RUBY_NO_INLINE) -static __inline__ int -#else -static int -#endif +static inline int hex2num(c) char c; { diff --git a/parse.y b/parse.y index bae2daba09..0665ef685b 100644 --- a/parse.y +++ b/parse.y @@ -2547,13 +2547,12 @@ parse_qstring(term, paren) c = '\\'; break; - case '\'': - if (term == '\'') { - c = '\''; - break; - } - /* fall through */ default: + /* fall through */ + if (c == term || (paren && c == paren)) { + tokadd(c); + continue; + } tokadd('\\'); } } @@ -2608,7 +2607,7 @@ parse_quotedwords(term, paren) c = '\\'; break; default: - if (c == term) { + if (c == term || (paren && c == paren)) { tokadd(c); continue; } diff --git a/re.c b/re.c index eb5d5a7540..0cf81ef607 100644 --- a/re.c +++ b/re.c @@ -915,8 +915,7 @@ rb_reg_equal(re1, re2) if (min > RREGEXP(re2)->len) min = RREGEXP(re2)->len; if (memcmp(RREGEXP(re1)->str, RREGEXP(re2)->str, min) == 0 && rb_reg_cur_kcode(re1) == rb_reg_cur_kcode(re2) && - !((RREGEXP(re1)->ptr->options & RE_OPTION_IGNORECASE) ^ - (RREGEXP(re2)->ptr->options & RE_OPTION_IGNORECASE))) { + RREGEXP(re1)->ptr->options == RREGEXP(re2)->ptr->options) { return Qtrue; } return Qfalse; diff --git a/ruby.h b/ruby.h index 5052d80e85..8d18c0ccb6 100644 --- a/ruby.h +++ b/ruby.h @@ -542,12 +542,14 @@ EXTERN VALUE rb_eNameError; EXTERN VALUE rb_eSyntaxError; EXTERN VALUE rb_eLoadError; -#if defined(__GNUC__) && __GNUC__ >= 2 && !defined(RUBY_NO_INLINE) -extern __inline__ VALUE rb_class_of _((VALUE)); -extern __inline__ int rb_type _((VALUE)); -extern __inline__ int rb_special_const_p _((VALUE)); +extern inline VALUE rb_class_of _((VALUE)); +extern inline int rb_type _((VALUE)); +extern inline int rb_special_const_p _((VALUE)); -extern __inline__ VALUE +#ifndef RUBY_NO_INLINE +extern inline +#endif +VALUE rb_class_of(VALUE obj) { if (FIXNUM_P(obj)) return rb_cFixnum; @@ -559,7 +561,10 @@ rb_class_of(VALUE obj) return RBASIC(obj)->klass; } -extern __inline__ int +#ifndef RUBY_NO_INLINE +extern inline +#endif +int rb_type(VALUE obj) { if (FIXNUM_P(obj)) return T_FIXNUM; @@ -571,19 +576,16 @@ rb_type(VALUE obj) return BUILTIN_TYPE(obj); } -extern __inline__ int +#ifndef RUBY_NO_INLINE +extern inline +#endif +int rb_special_const_p(VALUE obj) { if (SPECIAL_CONST_P(obj)) return Qtrue; return Qfalse; } -#else -VALUE rb_class_of _((VALUE)); -int rb_type _((VALUE)); -int rb_special_const_p _((VALUE)); -#endif - #include "intern.h" #if defined(EXTLIB) && defined(USE_DLN_A_OUT) diff --git a/string.c b/string.c index ccfd969bf1..6beff47737 100644 --- a/string.c +++ b/string.c @@ -1652,7 +1652,7 @@ rb_str_upcase_bang(str) if (ismbchar(*s)) { s+=mbclen(*s) - 1; } - else if (islower(*s)) { + else if (ISLOWER(*s)) { *s = toupper(*s); modify = 1; } diff --git a/util.c b/util.c index 9cbfb5fc74..25c00ae2d6 100644 --- a/util.c +++ b/util.c @@ -19,42 +19,6 @@ #define RUBY_NO_INLINE #include "ruby.h" -VALUE -rb_class_of(obj) - VALUE obj; -{ - if (FIXNUM_P(obj)) return rb_cFixnum; - if (obj == Qnil) return rb_cNilClass; - if (obj == Qfalse) return rb_cFalseClass; - if (obj == Qtrue) return rb_cTrueClass; - if (SYMBOL_P(obj)) return rb_cSymbol; - - return RBASIC(obj)->klass; -} - -int -rb_type(obj) - VALUE obj; -{ - if (FIXNUM_P(obj)) return T_FIXNUM; - if (obj == Qnil) return T_NIL; - if (obj == Qfalse) return T_FALSE; - if (obj == Qtrue) return T_TRUE; - if (obj == Qundef) return T_UNDEF; - if (SYMBOL_P(obj)) return T_SYMBOL; - - return BUILTIN_TYPE(obj); -} - -int -rb_special_const_p(obj) - VALUE obj; -{ - if (SPECIAL_CONST_P(obj)) return Qtrue; - - return Qfalse; -} - #include "util.h" #ifndef HAVE_STRING_H char *strchr _((char*,char)); diff --git a/win32/win32.c b/win32/win32.c index 54f763f70f..4fb621cf8e 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -777,10 +777,10 @@ char *cmd; strcpy(cmd2, cmd); a = argv; for (s = cmd2; *s;) { - while (*s && isspace(*s)) s++; + while (*s && ISSPACE(*s)) s++; if (*s) *(a++) = s; - while (*s && !isspace(*s)) s++; + while (*s && !ISSPACE(*s)) s++; if (*s) *s++ = '\0'; } @@ -1054,7 +1054,7 @@ NtMakeCmdVector (char *cmdline, char ***vec, int InputCmd) // ptr = cmdline+(cmdlen - 1); - while(ptr >= cmdline && isspace(*ptr)) + while(ptr >= cmdline && ISSPACE(*ptr)) --ptr; *++ptr = '\0'; @@ -1074,7 +1074,7 @@ NtMakeCmdVector (char *cmdline, char ***vec, int InputCmd) // zap any leading whitespace // - while(isspace(*ptr)) + while(ISSPACE(*ptr)) ptr++; base = ptr; @@ -1311,7 +1311,7 @@ opendir(char *filename) if ((stat (filename, &sbuf) < 0 || sbuf.st_mode & _S_IFDIR == 0) && - (!isalpha(filename[0]) || filename[1] != ':' || filename[2] != '\0' || + (!ISALPHA(filename[0]) || filename[1] != ':' || filename[2] != '\0' || ((1 << (filename[0] & 0x5f) - 'A') & GetLogicalDrives()) == 0)) { return NULL; }