summaryrefslogtreecommitdiff
path: root/re.c
diff options
context:
space:
mode:
authormichal <michal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-08-21 15:47:54 +0000
committermichal <michal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-08-21 15:47:54 +0000
commitffc13a6525c7c72cbb858380e6870106bf5a7dfa (patch)
tree3b51176716a877c59eebbe6e82533d2cae3d7bc5 /re.c
parent022d1f123c6149915970b4cac9664f66d8d5875c (diff)
*.c: Int vs Long cleanup
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 're.c')
-rw-r--r--re.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/re.c b/re.c
index 1dc4152..a8e4cc3 100644
--- a/re.c
+++ b/re.c
@@ -66,7 +66,7 @@ static const char casetable[] = {
'\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377',
};
#else
->>> "You lose. You will need a translation table for your character set." <<<
+# error >>> "You lose. You will need a translation table for your character set." <<<
#endif
#define MIN(a,b) (((a)>(b))?(b):(a))
@@ -217,7 +217,7 @@ static void
rb_reg_expr_str(str, s, len)
VALUE str;
const char *s;
- int len;
+ long len;
{
const char *p, *pend;
int need_escape = 0;
@@ -274,7 +274,7 @@ rb_reg_expr_str(str, s, len)
static VALUE
rb_reg_desc(s, len, re)
const char *s;
- int len;
+ long len;
VALUE re;
{
VALUE str = rb_str_buf_new2("/");
@@ -425,7 +425,7 @@ rb_reg_to_s(re)
static void
rb_reg_raise(s, len, err, re)
const char *s;
- int len;
+ long len;
const char *err;
VALUE re;
{
@@ -482,7 +482,8 @@ rb_reg_kcode_m(re)
static Regexp*
make_regexp(s, len, flags)
const char *s;
- int len, flags;
+ long len;
+ int flags;
{
Regexp *rp;
char *err;
@@ -503,10 +504,10 @@ make_regexp(s, len, flags)
rp->options = flags;
}
err = re_compile_pattern(s, len, rp);
+
if (err != NULL) {
rb_reg_raise(s, len, err, 0);
}
-
return rp;
}
@@ -650,12 +651,12 @@ rb_reg_prepare_re(re)
}
}
-int
+long
rb_reg_adjust_startpos(re, str, pos, reverse)
VALUE re, str;
- int pos, reverse;
+ long pos, reverse;
{
- int range;
+ long range;
rb_reg_check(re);
if (may_need_recompile) rb_reg_prepare_re(re);
@@ -676,15 +677,15 @@ rb_reg_adjust_startpos(re, str, pos, reverse)
pos, range);
}
-int
+long
rb_reg_search(re, str, pos, reverse)
VALUE re, str;
- int pos, reverse;
+ long pos, reverse;
{
- int result;
+ long result;
VALUE match;
static struct re_registers regs;
- int range;
+ long range;
if (pos > RSTRING(str)->len || pos < 0) {
rb_backref_set(Qnil);
@@ -948,7 +949,7 @@ static void
rb_reg_initialize(obj, s, len, options)
VALUE obj;
const char *s;
- int len;
+ long len;
int options; /* CASEFOLD = 1 */
/* EXTENDED = 2 */
/* MULTILINE = 4 */