* re.c (KR_REHASH): wrong hash value on sizeof(long) > sizeof(int).

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5693 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2004-02-13 16:03:15 +00:00
parent be1de4f8db
commit 829a44822d
6 changed files with 35 additions and 8 deletions

View File

@ -333,6 +333,10 @@ Sat Jan 31 01:09:41 2004 NAKAMURA, Hiroshi <nakahiro@sarion.co.jp>
* lib/logger.rb: leading 0 padding of timestamp usec part. * lib/logger.rb: leading 0 padding of timestamp usec part.
Fri Jan 30 18:53:23 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* re.c (KR_REHASH): wrong hash value on sizeof(long) > sizeof(int).
Thu Jan 29 23:11:57 2004 WATANABE Hirofumi <eban@ruby-lang.org> Thu Jan 29 23:11:57 2004 WATANABE Hirofumi <eban@ruby-lang.org>
* configure.in (DLEXT2): removed. Ruby does not treat * configure.in (DLEXT2): removed. Ruby does not treat

View File

@ -2318,3 +2318,4 @@ class CGI
end # class CGI end # class CGI
?

View File

@ -36,8 +36,8 @@ module Find
paths.collect!{|d| d.dup} paths.collect!{|d| d.dup}
while file = paths.shift while file = paths.shift
catch(:prune) do catch(:prune) do
yield file.dup next unless File.exist? file
file.untaint yield file.dup.taint
begin begin
if File.lstat(file).directory? then if File.lstat(file).directory? then
d = Dir.open(file) d = Dir.open(file)
@ -51,7 +51,7 @@ module Find
else else
f = File.join(file, f) f = File.join(file, f)
end end
paths.unshift f paths.unshift f.untaint
end end
ensure ensure
d.close d.close

View File

@ -538,6 +538,26 @@ def have_header(header, &b)
end end
end end
def find_header(header, *paths)
checking_for header do
if try_cpp(cpp_include(header))
true
else
found = false
paths.each do |dir|
opt = "-I#{dir}"
if try_cpp(cpp_include(header), opt)
$INCFLAGS += " "
$INCFLAGS += opt
found = true
break
end
end
found
end
end
end
def have_struct_member(type, member, header = nil, &b) def have_struct_member(type, member, header = nil, &b)
checking_for "#{type}.#{member}" do checking_for "#{type}.#{member}" do
if try_compile(<<"SRC", &b) if try_compile(<<"SRC", &b)

View File

@ -222,7 +222,7 @@ Also ignores spaces after parenthesis when 'space."
(make-variable-buffer-local 'comment-column) (make-variable-buffer-local 'comment-column)
(setq comment-column ruby-comment-column) (setq comment-column ruby-comment-column)
(make-variable-buffer-local 'comment-start-skip) (make-variable-buffer-local 'comment-start-skip)
(setq comment-start-skip "\\(^\\|\\s-\\);?#+ *") (setq comment-start-skip "#+ *")
(setq indent-tabs-mode ruby-indent-tabs-mode) (setq indent-tabs-mode ruby-indent-tabs-mode)
(make-local-variable 'parse-sexp-ignore-comments) (make-local-variable 'parse-sexp-ignore-comments)
(setq parse-sexp-ignore-comments t) (setq parse-sexp-ignore-comments t)
@ -731,8 +731,10 @@ The variable ruby-indent-level controls the amount of indentation.
(not (looking-at ruby-block-hanging-re)) (not (looking-at ruby-block-hanging-re))
(eq (ruby-deep-indent-paren-p t) 'space) (eq (ruby-deep-indent-paren-p t) 'space)
(not (bobp))) (not (bobp)))
(ruby-beginning-of-arg (or begin parse-start) (point)) (save-excursion
(current-column)) (widen)
(ruby-beginning-of-arg (or begin parse-start) (point))
(current-column)))
(t (t
(+ indent ruby-indent-level)))))))) (+ indent ruby-indent-level))))))))
indent))) indent)))
@ -802,7 +804,7 @@ An end of a defun is found by moving forward from the beginning of one."
((> start pos) ((> start pos)
(setq done t))))) (setq done t)))))
(if done (if done
(progn (save-excursion
(back-to-indentation) (back-to-indentation)
(if (looking-at ruby-block-mid-re) (if (looking-at ruby-block-mid-re)
(setq done nil)))))) (setq done nil))))))

2
re.c
View File

@ -105,7 +105,7 @@ rb_memsearch(x0, m, y0, n)
int d; int d;
unsigned long hx, hy; unsigned long hx, hy;
#define KR_REHASH(a, b, h) (((h) << 1) - ((a)<<d) + (b)) #define KR_REHASH(a, b, h) (((h) << 1) - ((long)(a)<<d) + (b))
if (m > n) return -1; if (m > n) return -1;
s = y; e = s + n - m; s = y; e = s + n - m;