Re: [Cleanup] Int vs Long #3 (RESEND with -p)

From: Michal Rokos <m.rokos@...>
Date: 2002-08-23 11:47:37 UTC
List: ruby-core #352
On Fri, Aug 23, 2002 at 07:41:22PM +0900, nobu.nokada@softhome.net wrote:
> > > # I'd like you to use -p option.

	Here's the -p version.

	Thank you.

		Michal


Index: error.c
===================================================================
RCS file: /src/ruby/error.c,v
retrieving revision 1.47
diff -u -p -r1.47 error.c
--- error.c	2002/08/21 15:47:54	1.47
+++ error.c	2002/08/23 11:43:31
@@ -35,10 +35,10 @@ int ruby_nerrs;
 static void
 err_snprintf(buf, len, fmt, args)
     char *buf, *fmt;
-    int len;
+    long len;
     va_list args;
 {
-    int n;
+    long n;
 
     ruby_set_current_source();
     if (!ruby_sourcefile) {
Index: eval.c
===================================================================
RCS file: /src/ruby/eval.c,v
retrieving revision 1.318
diff -u -p -r1.318 eval.c
--- eval.c	2002/08/21 15:47:54	1.318
+++ eval.c	2002/08/23 11:43:46
@@ -1006,7 +1006,7 @@ error_print()
 	}
 	else {
 	    char *tail  = 0;
-	    int len = elen;
+	    long len = elen;
 
 	    if (RSTRING(epath)->ptr[0] == '#') epath = 0;
 	    if (tail = strchr(einfo, '\n')) {
@@ -3513,12 +3513,12 @@ rb_mod_method_defined(mod, mid)
     return Qfalse;
 }
 
-NORETURN(static void terminate_process _((int, const char*, int)));
+NORETURN(static void terminate_process _((int, const char*, long)));
 static void
 terminate_process(status, mesg, mlen)
     int status;
     const char *mesg;
-    int mlen;
+    long mlen;
 {
     VALUE exit = rb_exc_new(rb_eSystemExit, mesg, mlen);
 
Index: file.c
===================================================================
RCS file: /src/ruby/file.c,v
retrieving revision 1.105
diff -u -p -r1.105 file.c
--- file.c	2002/08/21 15:47:54	1.105
+++ file.c	2002/08/23 11:43:50
@@ -79,7 +79,7 @@ VALUE rb_cFile;
 VALUE rb_mFileTest;
 static VALUE rb_cStat;
 
-static int
+static long
 apply2files(func, vargs, arg)
     void (*func)();
     VALUE vargs;
@@ -844,7 +844,7 @@ rb_file_s_size(klass, fname)
 
     if (rb_stat(fname, &st) < 0)
 	rb_sys_fail(RSTRING(fname)->ptr);
-    return rb_int2inum(st.st_size);
+    return OFFT2NUM(st.st_size);
 }
 
 static VALUE
@@ -994,14 +994,15 @@ rb_file_s_chmod(argc, argv)
 {
     VALUE vmode;
     VALUE rest;
-    int mode, n;
+    int mode;
+    long n;
 
     rb_secure(2);
     rb_scan_args(argc, argv, "1*", &vmode, &rest);
     mode = NUM2INT(vmode);
 
     n = apply2files(chmod_internal, rest, mode);
-    return INT2FIX(n);
+    return LONG2FIX(n);
 }
 
 static VALUE
@@ -1044,14 +1045,15 @@ rb_file_s_lchmod(argc, argv)
 {
     VALUE vmode;
     VALUE rest;
-    int mode, n;
+    int mode;
+    long n;
 
     rb_secure(2);
     rb_scan_args(argc, argv, "1*", &vmode, &rest);
     mode = NUM2INT(vmode);
 
     n = apply2files(lchmod_internal, rest, mode);
-    return INT2FIX(n);
+    return LONG2FIX(n);
 }
 #else
 static VALUE
@@ -1083,7 +1085,7 @@ rb_file_s_chown(argc, argv)
 {
     VALUE o, g, rest;
     struct chown_args arg;
-    int n;
+    long n;
 
     rb_secure(2);
     rb_scan_args(argc, argv, "2*", &o, &g, &rest);
@@ -1101,7 +1103,7 @@ rb_file_s_chown(argc, argv)
     }
 
     n = apply2files(chown_internal, rest, &arg);
-    return INT2FIX(n);
+    return LONG2FIX(n);
 }
 
 static VALUE
@@ -1141,7 +1143,7 @@ rb_file_s_lchown(argc, argv)
 {
     VALUE o, g, rest;
     struct chown_args arg;
-    int n;
+    long n;
 
     rb_secure(2);
     rb_scan_args(argc, argv, "2*", &o, &g, &rest);
@@ -1159,7 +1161,7 @@ rb_file_s_lchown(argc, argv)
     }
 
     n = apply2files(lchown_internal, rest, &arg);
-    return INT2FIX(n);
+    return LONG2FIX(n);
 }
 #else
 static VALUE
@@ -1191,7 +1193,7 @@ rb_file_s_utime(argc, argv)
 {
     VALUE atime, mtime, rest;
     struct timeval tvp[2];
-    int n;
+    long n;
 
     rb_scan_args(argc, argv, "2*", &atime, &mtime, &rest);
 
@@ -1199,7 +1201,7 @@ rb_file_s_utime(argc, argv)
     tvp[1] = rb_time_timeval(mtime);
 
     n = apply2files(utime_internal, rest, tvp);
-    return INT2FIX(n);
+    return LONG2FIX(n);
 }
 
 #else
@@ -1237,7 +1239,7 @@ rb_file_s_utime(argc, argv)
     VALUE *argv;
 {
     VALUE atime, mtime, rest;
-    int n;
+    long n;
     struct timeval tv;
     struct utimbuf utbuf;
 
@@ -1249,7 +1251,7 @@ rb_file_s_utime(argc, argv)
     utbuf.modtime = tv.tv_sec;
 
     n = apply2files(utime_internal, rest, &utbuf);
-    return INT2FIX(n);
+    return LONG2FIX(n);
 }
 
 #endif
@@ -1322,11 +1324,11 @@ static VALUE
 rb_file_s_unlink(klass, args)
     VALUE klass, args;
 {
-    int n;
+    long n;
 
     rb_secure(2);
     n = apply2files(unlink_internal, args, 0);
-    return INT2FIX(n);
+    return LONG2FIX(n);
 }
 
 static VALUE
@@ -2266,10 +2268,10 @@ static VALUE
 rb_stat_s(obj)
     VALUE obj;
 {
-    int size = get_stat(obj)->st_size;
+    off_t size = get_stat(obj)->st_size;
 
     if (size == 0) return Qnil;
-    return INT2FIX(size);
+    return OFFT2NUM(size);
 }
 
 static VALUE
Index: gc.c
===================================================================
RCS file: /src/ruby/gc.c,v
retrieving revision 1.97
diff -u -p -r1.97 gc.c
--- gc.c	2002/08/21 15:47:54	1.97
+++ gc.c	2002/08/23 11:43:52
@@ -777,7 +777,7 @@ rb_gc_mark_children(ptr)
 
       case T_ARRAY:
 	{
-	    int i, len = obj->as.array.len;
+	    long i, len = obj->as.array.len;
 	    VALUE *ptr = obj->as.array.ptr;
 
 	    for (i=0; i < len; i++)
@@ -839,7 +839,7 @@ rb_gc_mark_children(ptr)
 
       case T_STRUCT:
 	{
-	    int i, len = obj->as.rstruct.len;
+	    long i, len = obj->as.rstruct.len;
 	    VALUE *ptr = obj->as.rstruct.ptr;
 
 	    for (i=0; i < len; i++)
Index: io.c
===================================================================
RCS file: /src/ruby/io.c,v
retrieving revision 1.148
diff -u -p -r1.148 io.c
--- io.c	2002/08/21 15:47:54	1.148
+++ io.c	2002/08/23 11:43:59
@@ -555,7 +555,7 @@ rb_io_fread(ptr, len, f)
 
     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);
@@ -599,7 +599,6 @@ rb_io_fread(ptr, len, f)
 	*ptr++ = c;
 	n--;
     }
-
     return len - n;
 }
 
@@ -722,7 +721,7 @@ appendline(fptr, delim, strp)
 
     do {
 #ifdef READ_DATA_PENDING_PTR
-	int pending = READ_DATA_PENDING_COUNT(f);
+	long pending = READ_DATA_PENDING_COUNT(f);
 	if (pending > 0) {
 	    const char *p = READ_DATA_PENDING_PTR(f);
 	    const char *e = memchr(p, delim, pending);
@@ -796,7 +795,7 @@ swallow(fptr, term)
 
     do {
 #ifdef READ_DATA_PENDING_PTR
-	int cnt;
+	long cnt;
 	while ((cnt = READ_DATA_PENDING_COUNT(f)) > 0) {
 	    char buf[1024];
 	    const char *p = READ_DATA_PENDING_PTR(f);
Index: numeric.c
===================================================================
RCS file: /src/ruby/numeric.c,v
retrieving revision 1.56
diff -u -p -r1.56 numeric.c
--- numeric.c	2002/08/21 15:47:54	1.56
+++ numeric.c	2002/08/23 11:44:01
@@ -1022,7 +1022,7 @@ int_succ(num)
 {
     if (FIXNUM_P(num)) {
 	long i = FIX2LONG(num) + 1;
-	return rb_int2inum(i);
+	return LONG2NUM(i);
     }
     return rb_funcall(num, '+', 1, INT2FIX(1));
 }
@@ -1083,7 +1083,7 @@ static VALUE
 fix_uminus(num)
     VALUE num;
 {
-    return rb_int2inum(-FIX2LONG(num));
+    return LONG2NUM(-FIX2LONG(num));
 }
 
 VALUE
@@ -1385,7 +1385,7 @@ fix_rev(num)
     long val = FIX2LONG(num);
 
     val = ~val;
-    return rb_int2inum(val);
+    return LONG2NUM(val);
 }
 
 static VALUE
@@ -1398,7 +1398,7 @@ fix_and(x, y)
 	return rb_big_and(y, x);
     }
     val = FIX2LONG(x) & NUM2LONG(y);
-    return rb_int2inum(val);
+    return LONG2NUM(val);
 }
 
 static VALUE
@@ -1411,7 +1411,7 @@ fix_or(x, y)
 	return rb_big_or(y, x);
     }
     val = FIX2LONG(x) | NUM2LONG(y);
-    return rb_int2inum(val);
+    return LONG2NUM(val);
 }
 
 static VALUE
@@ -1424,7 +1424,7 @@ fix_xor(x, y)
 	return rb_big_xor(y, x);
     }
     val = FIX2LONG(x) ^ NUM2LONG(y);
-    return rb_int2inum(val);
+    return LONG2NUM(val);
 }
 
 static VALUE fix_rshift _((VALUE, VALUE));
@@ -1444,7 +1444,7 @@ fix_lshift(x, y)
 	return rb_big_lshift(rb_int2big(val), y);
     }
     val = val << width;
-    return rb_int2inum(val);
+    return LONG2NUM(val);
 }
 
 static VALUE
@@ -1512,7 +1512,7 @@ fix_abs(fix)
 
     if (i < 0) i = -i;
 
-    return rb_int2inum(i);
+    return LONG2NUM(i);
 }
 
 static VALUE
Index: pack.c
===================================================================
RCS file: /src/ruby/pack.c,v
retrieving revision 1.42
diff -u -p -r1.42 pack.c
--- pack.c	2002/08/21 15:47:54	1.42
+++ pack.c	2002/08/23 11:44:03
@@ -323,11 +323,11 @@ typedef unsigned int U32;
 #endif
 static char *toofew = "too few arguments";
 
-static void encodes _((VALUE,char*,int,int));
-static void qpencode _((VALUE,VALUE,int));
+static void encodes _((VALUE,char*,long,int));
+static void qpencode _((VALUE,VALUE,long));
 
 static int uv_to_utf8 _((char*,unsigned long));
-static unsigned long utf8_to_uv _((char*,int*));
+static unsigned long utf8_to_uv _((char*,long*));
 
 static VALUE
 pack_pack(ary, fmt)
@@ -431,7 +431,7 @@ pack_pack(ary, fmt)
 	      case 'b':
 		{
 		    int byte = 0;
-		    int i, j = 0;
+		    long i, j = 0;
 
 		    if (len > plen) {
 			j = (len - plen + 1)/2;
@@ -461,7 +461,7 @@ pack_pack(ary, fmt)
 	      case 'B':
 		{
 		    int byte = 0;
-		    int i, j = 0;
+		    long i, j = 0;
 
 		    if (len > plen) {
 			j = (len - plen + 1)/2;
@@ -490,7 +490,7 @@ pack_pack(ary, fmt)
 	      case 'h':
 		{
 		    int byte = 0;
-		    int i, j = 0;
+		    long i, j = 0;
 
 		    if (len > plen) {
 			j = (len - plen + 1)/2;
@@ -520,7 +520,7 @@ pack_pack(ary, fmt)
 	      case 'H':
 		{
 		    int byte = 0;
-		    int i, j = 0;
+		    long i, j = 0;
 
 		    if (len > plen) {
 			j = (len - plen + 1)/2;
@@ -800,7 +800,7 @@ pack_pack(ary, fmt)
 	    else
 		len = len / 3 * 3;
 	    while (plen > 0) {
-		int todo;
+		long todo;
 
 		if (plen > len)
 		    todo = len;
@@ -915,11 +915,11 @@ static void
 encodes(str, s, len, type)
     VALUE str;
     char *s;
-    int len;
+    long len;
     int type;
 {
     char *buff = ALLOCA_N(char, len * 4 / 3 + 6);
-    int i = 0;
+    long i = 0;
     char *trans = type == 'u' ? uu_table : b64_table;
     int padding;
 
@@ -959,10 +959,10 @@ static char hex_table[] = "0123456789ABC
 static void
 qpencode(str, from, len)
     VALUE str, from;
-    int len;
+    long len;
 {
     char buff[1024];
-    int i = 0, n = 0, prev = EOF;
+    long i = 0, n = 0, prev = EOF;
     unsigned char *s = (unsigned char*)RSTRING(from)->ptr;
     unsigned char *send = s + RSTRING(from)->len;
 
@@ -1136,7 +1136,7 @@ pack_unpack(str, fmt)
 	  case 'A':
 	    if (len > send - s) len = send - s;
 	    {
-		int end = len;
+		long end = len;
 		char *t = s + len - 1;
 
 		while (t >= s) {
@@ -1151,7 +1151,7 @@ pack_unpack(str, fmt)
 	  case 'Z':
 	    if (len > send - s) len = send - s;
 	    {
-		int end = len;
+		long end = len;
 		char *t = s + len - 1;
 
 		while (t >= s) {
@@ -1174,7 +1174,8 @@ pack_unpack(str, fmt)
 	    {
 		VALUE bitstr;
 		char *t;
-		int bits, i;
+		int bits;
+		long i;
 
 		if (p[-1] == '*' || len > (send - s) * 8)
 		    len = (send - s) * 8;
@@ -1193,7 +1194,8 @@ pack_unpack(str, fmt)
 	    {
 		VALUE bitstr;
 		char *t;
-		int bits, i;
+		int bits;
+		long i;
 
 		if (p[-1] == '*' || len > (send - s) * 8)
 		    len = (send - s) * 8;
@@ -1212,7 +1214,8 @@ pack_unpack(str, fmt)
 	    {
 		VALUE bitstr;
 		char *t;
-		int bits, i;
+		int bits;
+		long i;
 
 		if (p[-1] == '*' || len > (send - s) * 2)
 		    len = (send - s) * 2;
@@ -1233,7 +1236,8 @@ pack_unpack(str, fmt)
 	    {
 		VALUE bitstr;
 		char *t;
-		int bits, i;
+		int bits;
+		long i;
 
 		if (p[-1] == '*' || len > (send - s) * 2)
 		    len = (send - s) * 2;
@@ -1297,7 +1301,7 @@ pack_unpack(str, fmt)
 		int tmp;
 		memcpy(&tmp, s, sizeof(int));
 		s += sizeof(int);
-		rb_ary_push(ary, rb_int2inum(tmp));
+		rb_ary_push(ary, INT2NUM(tmp));
 	    }
 	    PACK_ITEM_ADJUST();
 	    break;
@@ -1308,7 +1312,7 @@ pack_unpack(str, fmt)
 		unsigned int tmp;
 		memcpy(&tmp, s, sizeof(unsigned int));
 		s += sizeof(unsigned int);
-		rb_ary_push(ary, rb_uint2inum(tmp));
+		rb_ary_push(ary, UINT2NUM(tmp));
 	    }
 	    PACK_ITEM_ADJUST();
 	    break;
@@ -1319,7 +1323,7 @@ pack_unpack(str, fmt)
 		long tmp = 0;
 		memcpy(OFF32(&tmp), s, NATINT_LEN(long,4));
 		s += NATINT_LEN(long,4);
-		rb_ary_push(ary, rb_int2inum(tmp));
+		rb_ary_push(ary, LONG2NUM(tmp));
 	    }
 	    PACK_ITEM_ADJUST();
 	    break;
@@ -1330,7 +1334,7 @@ pack_unpack(str, fmt)
 		unsigned long tmp = 0;
 		memcpy(OFF32(&tmp), s, NATINT_LEN(unsigned long,4));
 		s += NATINT_LEN(unsigned long,4);
-		rb_ary_push(ary, rb_uint2inum(tmp));
+		rb_ary_push(ary, ULONG2NUM(tmp));
 	    }
 	    PACK_ITEM_ADJUST();
 	    break;
@@ -1359,7 +1363,7 @@ pack_unpack(str, fmt)
 		unsigned short tmp = 0;
 		memcpy(OFF16B(&tmp), s, NATINT_LEN(unsigned short,2));
 		s += NATINT_LEN(unsigned short,2);
-		rb_ary_push(ary, rb_uint2inum(ntohs(tmp)));
+		rb_ary_push(ary, UINT2NUM(ntohs(tmp)));
 	    }
 	    PACK_ITEM_ADJUST();
 	    break;
@@ -1370,7 +1374,7 @@ pack_unpack(str, fmt)
 		unsigned long tmp = 0;
 		memcpy(OFF32B(&tmp), s, NATINT_LEN(unsigned long,4));
 		s += NATINT_LEN(unsigned long,4);
-		rb_ary_push(ary, rb_uint2inum(ntohl(tmp)));
+		rb_ary_push(ary, ULONG2NUM(ntohl(tmp)));
 	    }
 	    PACK_ITEM_ADJUST();
 	    break;
@@ -1381,7 +1385,7 @@ pack_unpack(str, fmt)
 		unsigned short tmp = 0;
 		memcpy(OFF16(&tmp), s, NATINT_LEN(unsigned short,2));
 		s += NATINT_LEN(unsigned short,2);
-		rb_ary_push(ary, rb_uint2inum(vtohs(tmp)));
+		rb_ary_push(ary, UINT2NUM(vtohs(tmp)));
 	    }
 	    PACK_ITEM_ADJUST();
 	    break;
@@ -1392,7 +1396,7 @@ pack_unpack(str, fmt)
 		unsigned long tmp = 0;
 		memcpy(OFF32(&tmp), s, NATINT_LEN(long,4));
 		s += NATINT_LEN(long,4);
-		rb_ary_push(ary, rb_uint2inum(vtohl(tmp)));
+		rb_ary_push(ary, ULONG2NUM(vtohl(tmp)));
 	    }
 	    PACK_ITEM_ADJUST();
 	    break;
@@ -1480,12 +1484,12 @@ pack_unpack(str, fmt)
 	  case 'U':
 	    if (len > send - s) len = send - s;
 	    while (len > 0 && s < send) {
-		int alen = send - s;
+		long alen = send - s;
 		unsigned long l;
 
 		l = utf8_to_uv(s, &alen);
 		s += alen; len--;
-		rb_ary_push(ary, rb_uint2inum(l));
+		rb_ary_push(ary, ULONG2NUM(l));
 	    }
 	    break;
 
@@ -1508,7 +1512,7 @@ pack_unpack(str, fmt)
 		    }
 
 		    while (len > 0) {
-			int mlen = len > 3 ? 3 : len;
+			long mlen = len > 3 ? 3 : len;
 
 			if (s < send && *s >= ' ')
 			    a = (*s++ - ' ') & 077;
@@ -1718,7 +1722,7 @@ pack_unpack(str, fmt)
 		    ul <<= 7;
 		    ul |= (*s & 0x7f);
 		    if (!(*s++ & 0x80)) {
-			rb_ary_push(ary, rb_uint2inum(ul));
+			rb_ary_push(ary, ULONG2NUM(ul));
 			len--;
 			ul = 0;
 		    }
@@ -1814,11 +1818,11 @@ uv_to_utf8(buf, uv)
 static unsigned long
 utf8_to_uv(p, lenp)
     char *p;
-    int *lenp;
+    long *lenp;
 {
     int c = (*p++)&0xff;
     unsigned long uv;
-    int n = 1;
+    long n = 1;
 
     if (c < 0xc0) n = 1;
     else if (c < 0xe0) n = 2;
Index: process.c
===================================================================
RCS file: /src/ruby/process.c,v
retrieving revision 1.54
diff -u -p -r1.54 process.c
--- process.c	2002/08/21 15:47:54	1.54
+++ process.c	2002/08/23 11:44:04
@@ -831,8 +831,7 @@ rb_f_system(argc, argv)
 
     if (status == 0) return Qtrue;
     return Qfalse;
-#else
-#ifdef DJGPP
+#elif defined(DJGPP)
     VALUE cmd;
     int status;
 
@@ -855,10 +854,8 @@ rb_f_system(argc, argv)
 
     if (status == 0) return Qtrue;
     return Qfalse;
-#else
-#if defined(__human68k__)
+#elif defined(__human68k__)
     VALUE prog = 0;
-    int i;
     int status;
 
     fflush(stdin);
@@ -885,8 +882,7 @@ rb_f_system(argc, argv)
     }
     last_status_set(status == -1 ? 127 : status);
     return status == 0 ? Qtrue : Qfalse;
-#else
-#if defined(__VMS)
+#elif defined(__VMS)
     VALUE cmd;
     int status;
 
@@ -962,10 +958,7 @@ rb_f_system(argc, argv)
     if (NUM2INT(rb_last_status) == 0)
 	return Qtrue;
     return Qfalse;
-#endif /* __VMS */
-#endif /* __human68k__ */
-#endif /* DJGPP */
-#endif /* NT */
+#endif
 }
 
 static VALUE
Index: re.c
===================================================================
RCS file: /src/ruby/re.c,v
retrieving revision 1.75
diff -u -p -r1.75 re.c
--- re.c	2002/08/21 15:47:54	1.75
+++ re.c	2002/08/23 11:44:08
@@ -765,7 +765,7 @@ rb_reg_nth_match(nth, match)
     VALUE match;
 {
     VALUE str;
-    int start, end, len;
+    long start, end, len;
 
     if (NIL_P(match)) return Qnil;
     if (nth >= RMATCH(match)->regs->num_regs) {
@@ -1077,7 +1077,7 @@ VALUE
 rb_reg_match(re, str)
     VALUE re, str;
 {
-    int start;
+    long start;
 
     if (NIL_P(str)) {
 	rb_backref_set(Qnil);
@@ -1088,14 +1088,14 @@ rb_reg_match(re, str)
     if (start < 0) {
 	return Qnil;
     }
-    return INT2FIX(start);
+    return LONG2FIX(start);
 }
 
 VALUE
 rb_reg_match2(re)
     VALUE re;
 {
-    int start;
+    long start;
     VALUE line = rb_lastline_get();
 
     if (TYPE(line) != T_STRING) {
@@ -1107,7 +1107,7 @@ rb_reg_match2(re)
     if (start < 0) {
 	return Qnil;
     }
-    return INT2FIX(start);
+    return LONG2FIX(start);
 }
 
 static VALUE
Index: sprintf.c
===================================================================
RCS file: /src/ruby/sprintf.c,v
retrieving revision 1.24
diff -u -p -r1.24 sprintf.c
--- sprintf.c	2002/08/21 15:47:54	1.24
+++ sprintf.c	2002/08/23 11:44:08
@@ -26,7 +26,7 @@ remove_sign_bits(str, base)
     int base;
 {
     char *s, *t, *end;
-    int len;
+    unsigned long len;
     
     s = t = str;
     len = strlen(str);
Index: string.c
===================================================================
RCS file: /src/ruby/string.c,v
retrieving revision 1.111
diff -u -p -r1.111 string.c
--- string.c	2002/08/21 15:47:54	1.111
+++ string.c	2002/08/23 11:44:15
@@ -1055,7 +1055,7 @@ rb_str_succ(orig)
     VALUE str;
     char *sbeg, *s;
     int c = -1;
-    int n = 0;
+    long n = 0;
 
     str = rb_str_new5(orig,RSTRING(orig)->ptr, RSTRING(orig)->len);
     OBJ_INFECT(str, orig);
@@ -1255,7 +1255,7 @@ rb_str_subpat_set(str, re, nth, val)
     VALUE val;
 {
     VALUE match;
-    int start, end, len;
+    long start, end, len;
 
     if (rb_reg_search(re, str, 0, 0) < 0) {
 	rb_raise(rb_eIndexError, "regexp not matched");
@@ -3029,7 +3029,7 @@ rb_str_sum(argc, argv, str)
     VALUE str;
 {
     VALUE vbits;
-    int   bits;
+    int bits;
     char *p, *pend;
 
     if (rb_scan_args(argc, argv, "01", &vbits) == 0) {
Index: time.c
===================================================================
RCS file: /src/ruby/time.c,v
retrieving revision 1.63
diff -u -p -r1.63 time.c
--- time.c	2002/08/21 15:47:54	1.63
+++ time.c	2002/08/23 11:44:17
@@ -1191,7 +1191,7 @@ time_utc_offset(time)
 #else
 	struct tm *u, *l;
 	time_t t;
-	int off;
+	long off;
 	l = &tobj->tm;
 	t = tobj->tv.tv_sec;
 	u = gmtime(&t);
@@ -1208,7 +1208,7 @@ time_utc_offset(time)
 	off = off * 24 + l->tm_hour - u->tm_hour;
 	off = off * 60 + l->tm_min - u->tm_min;
 	off = off * 60 + l->tm_sec - u->tm_sec;
-	return INT2FIX(off);
+	return LONG2FIX(off);
 #endif
     }
 }
Index: util.c
===================================================================
RCS file: /src/ruby/util.c,v
retrieving revision 1.28
diff -u -p -r1.28 util.c
--- util.c	2002/08/21 15:47:54	1.28
+++ util.c	2002/08/23 11:44:18
@@ -27,9 +27,9 @@ char *strchr _((char*,char));
 
 unsigned long
 scan_oct(start, len, retlen)
-const char *start;
-int len;
-int *retlen;
+    const char *start;
+    int len;
+    int *retlen;
 {
     register const char *s = start;
     register unsigned long retval = 0;
@@ -44,9 +44,9 @@ int *retlen;
 
 unsigned long
 scan_hex(start, len, retlen)
-const char *start;
-int len;
-int *retlen;
+    const char *start;
+    int len;
+    int *retlen;
 {
     static char hexdigit[] = "0123456789abcdef0123456789ABCDEF";
     register const char *s = start;
-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Michal Rokos                         Czech Technical University, Prague
E-mail:m.rokos@sh.cvut.cz      ICQ:36118339      Jabber:majkl@jabber.cz
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

In This Thread