[#290] — Florian Frank <flori@...>
Hi all,
5 messages
2002/08/03
[#297] GC longjmp macros — Michal Rokos <m.rokos@...>
Hi,
5 messages
2002/08/05
[#308] Q: OSSL in std. distr? — Michal Rokos <m.rokos@...>
Hi,
4 messages
2002/08/08
[#326] Implications of a #force_free method in Object? — Matthew Bloch <mattbee@...>
Hello;
8 messages
2002/08/19
[#328] Int vs Long — Michal Rokos <m.rokos@...>
Hi,
7 messages
2002/08/21
[#337] Int vs Long (2nd part) — Michal Rokos <m.rokos@...>
Hi,
7 messages
2002/08/22
[#340] Int vs Long #3 — Michal Rokos <m.rokos@...>
Hi,
9 messages
2002/08/22
[#344] Re: [Cleanup] Int vs Long #3
— nobu.nokada@...
2002/08/22
Hi,
[#348] Re: [Cleanup] Int vs Long #3
— Michal Rokos <m.rokos@...>
2002/08/23
Hello,
[#353] File (struct stat handling) — Michal Rokos <m.rokos@...>
Hello,
6 messages
2002/08/23
[#358] node.h for eval.c — Michal Rokos <m.rokos@...>
Hi,
5 messages
2002/08/23
[#372] rb_class_path — Michal Rokos <m.rokos@...>
Hello,
7 messages
2002/08/27
[#382] Port match to new dup, clone framework — Michal Rokos <m.rokos@...>
Hi,
5 messages
2002/08/28
[#393] in dln.c — Michal Rokos <m.rokos@...>
Hi,
14 messages
2002/08/30
[#398] Re: [MemLeak] in dln.c
— nobu.nokada@...
2002/08/31
Hi,
[#403] Re: [MemLeak] in dln.c
— Michal Rokos <m.rokos@...>
2002/09/02
Hello,
Re: [Cleanup] Int vs Long #3
From:
nobu.nokada@...
Date:
2002-08-22 23:47:10 UTC
List:
ruby-core #344
Hi,
At Fri, 23 Aug 2002 01:16:15 +0900,
Michal Rokos wrote:
> Index: file.c
> ===================================================================
> RCS file: /src/ruby/file.c,v
> retrieving revision 1.105
> diff -u -r1.105 file.c
> --- file.c 2002/08/21 15:47:54 1.105
> +++ file.c 2002/08/22 16:07:28
> @@ -79,7 +79,7 @@
> VALUE rb_mFileTest;
> static VALUE rb_cStat;
>
> -static int
> +static long
> apply2files(func, vargs, arg)
> void (*func)();
> VALUE vargs;
> Index: io.c
> ===================================================================
> RCS file: /src/ruby/io.c,v
> retrieving revision 1.148
> diff -u -r1.148 io.c
> --- io.c 2002/08/21 15:47:54 1.148
> +++ io.c 2002/08/22 16:07:41
> @@ -555,7 +555,7 @@
>
> while (n > 0) {
> #ifdef READ_DATA_PENDING_COUNT
> - int i = READ_DATA_PENDING_COUNT(f);
> + long i = READ_DATA_PENDING_COUNT(f);
> if (i <= 0) {
> rb_thread_wait_fd(fileno(f));
> i = READ_DATA_PENDING_COUNT(f);
Although I doubt if they can exceed INT limit, well, no
problem.
> Index: numeric.c
> ===================================================================
> RCS file: /src/ruby/numeric.c,v
> retrieving revision 1.56
> diff -u -r1.56 numeric.c
> --- numeric.c 2002/08/21 15:47:54 1.56
> +++ numeric.c 2002/08/22 16:07:44
> @@ -1022,7 +1022,7 @@
> {
> if (FIXNUM_P(num)) {
> long i = FIX2LONG(num) + 1;
> - return rb_int2inum(i);
> + return LONG2FIX(i);
> }
> return rb_funcall(num, '+', 1, INT2FIX(1));
> }
This arithmetic operation may overflow. You might intended
LONG2NUM() here too?
# I'd like you to use -p option.
--
Nobu Nakada