* 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
Родитель be1de4f8db
Коммит 829a44822d
6 изменённых файлов: 35 добавлений и 8 удалений

Просмотреть файл

@ -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.
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>
* configure.in (DLEXT2): removed. Ruby does not treat

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

@ -538,6 +538,26 @@ def have_header(header, &b)
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)
checking_for "#{type}.#{member}" do
if try_compile(<<"SRC", &b)

Просмотреть файл

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

2
re.c
Просмотреть файл

@ -105,7 +105,7 @@ rb_memsearch(x0, m, y0, n)
int d;
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;
s = y; e = s + n - m;