Replace `fixnum` references with `int`.
The `Fixnum` class is no longer provided by `mruby`.
MODIFY
mrblib/range.rb
mrblib/range.rb
@@ -37,7 +37,7 @@ class Range
end
end
- if val.kind_of?(Integer) && last.kind_of?(Integer) # fixnums are special
+ if val.kind_of?(Integer) && last.kind_of?(Integer) # integers are special
lim = last
lim += 1 unless exclude_end?
i = val

MODIFY
src/gc.c
src/gc.c
@@ -1471,7 +1471,7 @@ gc_disable(mrb_state *mrb, mrb_value obj)
/*
* call-seq:
- * GC.interval_ratio -> fixnum
+ * GC.interval_ratio -> int
*
* Returns ratio of GC interval. Default value is 200(%).
*
@@ -1480,12 +1480,12 @@ gc_disable(mrb_state *mrb, mrb_value obj)
static mrb_value
gc_interval_ratio_get(mrb_state *mrb, mrb_value obj)
{
- return mrb_fixnum_value(mrb->gc.interval_ratio);
+ return mrb_int_value(mrb, mrb->gc.interval_ratio);
}
/*
* call-seq:
- * GC.interval_ratio = fixnum -> nil
+ * GC.interval_ratio = int -> nil
*
* Updates ratio of GC interval. Default value is 200(%).
* GC start as soon as after end all step of GC if you set 100(%).
@@ -1504,7 +1504,7 @@ gc_interval_ratio_set(mrb_state *mrb, mrb_value obj)
/*
* call-seq:
- * GC.step_ratio -> fixnum
+ * GC.step_ratio -> int
*
* Returns step span ratio of Incremental GC. Default value is 200(%).
*
@@ -1513,12 +1513,12 @@ gc_interval_ratio_set(mrb_state *mrb, mrb_value obj)
static mrb_value
gc_step_ratio_get(mrb_state *mrb, mrb_value obj)
{
- return mrb_fixnum_value(mrb->gc.step_ratio);
+ return mrb_int_value(mrb, mrb->gc.step_ratio);
}
/*
* call-seq:
- * GC.step_ratio = fixnum -> nil
+ * GC.step_ratio = int -> nil
*
* Updates step span ratio of Incremental GC. Default value is 200(%).
* 1 step of incrementalGC becomes long if a rate is big.

MODIFY
src/kernel.c
src/kernel.c
@@ -84,8 +84,8 @@ mrb_equal_m(mrb_state *mrb, mrb_value self)
* Document-method: object_id
*
* call-seq:
- * obj.__id__ -> fixnum
- * obj.object_id -> fixnum
+ * obj.__id__ -> int
+ * obj.object_id -> int
*
* Returns an integer identifier for <i>obj</i>. The same number will
* be returned on all calls to <code>id</code> for a given object, and
@@ -293,7 +293,7 @@ mrb_obj_frozen(mrb_state *mrb, mrb_value self)
/* 15.3.1.3.15 */
/*
* call-seq:
- * obj.hash -> fixnum
+ * obj.hash -> int
*
* Generates a <code>Integer</code> hash value for this object. This
* function must have the property that <code>a.eql?(b)</code> implies

MODIFY
src/numeric.c
src/numeric.c
@@ -1064,7 +1064,7 @@ mrb_num_mul(mrb_state *mrb, mrb_value x, mrb_value y)
/* 15.2.8.3.3 */
/*
* call-seq:
- * fix * numeric -> numeric_result
+ * int * numeric -> numeric_result
*
* Performs multiplication: the class of the resulting object depends on
* the class of <code>numeric</code> and on the magnitude of the
@@ -1104,10 +1104,9 @@ intdivmod(mrb_state *mrb, mrb_int x, mrb_int y, mrb_int *divp, mrb_int *modp)
/* 15.2.8.3.5 */
/*
* call-seq:
- * fix % other -> real
- * fix.modulo(other) -> real
+ * int % other -> real
*
- * Returns <code>fix</code> modulo <code>other</code>.
+ * Returns <code>int</code> modulo <code>other</code>.
* See <code>numeric.divmod</code> for more information.
*/
@@ -1139,7 +1138,7 @@ int_mod(mrb_state *mrb, mrb_value x)
/*
* call-seq:
- * fix.divmod(numeric) -> array
+ * int.divmod(numeric) -> array
*
* See <code>Numeric#divmod</code>.
*/
@@ -1190,9 +1189,9 @@ flo_divmod(mrb_state *mrb, mrb_value x)
/* 15.2.8.3.7 */
/*
* call-seq:
- * fix == other -> true or false
+ * int == other -> true or false
*
- * Return <code>true</code> if <code>fix</code> equals <code>other</code>
+ * Return <code>true</code> if <code>int</code> equals <code>other</code>
* numerically.
*
* 1 == 2 #=> false
@@ -1227,7 +1226,7 @@ int_equal(mrb_state *mrb, mrb_value x)
/* 15.2.8.3.8 */
/*
* call-seq:
- * ~fix -> integer
+ * ~int -> integer
*
* One's complement: returns a number where each bit is flipped.
* ex.0---00001 (1)-> 1---11110 (-2)
@@ -1260,7 +1259,7 @@ static mrb_value flo_xor(mrb_state *mrb, mrb_value x);
/* 15.2.8.3.9 */
/*
* call-seq:
- * fix & integer -> integer_result
+ * int & integer -> integer_result
*
* Bitwise AND.
*/
@@ -1276,7 +1275,7 @@ int_and(mrb_state *mrb, mrb_value x)
/* 15.2.8.3.10 */
/*
* call-seq:
- * fix | integer -> integer_result
+ * int | integer -> integer_result
*
* Bitwise OR.
*/
@@ -1292,7 +1291,7 @@ int_or(mrb_state *mrb, mrb_value x)
/* 15.2.8.3.11 */
/*
* call-seq:
- * fix ^ integer -> integer_result
+ * int ^ integer -> integer_result
*
* Bitwise EXCLUSIVE OR.
*/
@@ -1343,9 +1342,9 @@ mrb_num_shift(mrb_state *mrb, mrb_int val, mrb_int width, mrb_int *num)
/* 15.2.8.3.12 */
/*
* call-seq:
- * fix << count -> integer or float
+ * int << count -> integer or float
*
- * Shifts _fix_ left _count_ positions (right if _count_ is negative).
+ * Shifts _int_ left _count_ positions (right if _count_ is negative).
*/
static mrb_value
@@ -1368,9 +1367,9 @@ int_lshift(mrb_state *mrb, mrb_value x)
/* 15.2.8.3.13 */
/*
* call-seq:
- * fix >> count -> integer or float
+ * int >> count -> integer or float
*
- * Shifts _fix_ right _count_ positions (left if _count_ is negative).
+ * Shifts _int_ right _count_ positions (left if _count_ is negative).
*/
static mrb_value
@@ -1394,9 +1393,9 @@ int_rshift(mrb_state *mrb, mrb_value x)
/* 15.2.8.3.23 */
/*
* call-seq:
- * fix.to_f -> float
+ * int.to_f -> float
*
- * Converts <i>fix</i> to a <code>Float</code>.
+ * Converts <i>int</i> to a <code>Float</code>.
*
*/
@@ -1502,7 +1501,7 @@ mrb_num_plus(mrb_state *mrb, mrb_value x, mrb_value y)
/* 15.2.8.3.1 */
/*
* call-seq:
- * fix + numeric -> numeric_result
+ * int + numeric -> numeric_result
*
* Performs addition: the class of the resulting object depends on
* the class of <code>numeric</code> and on the magnitude of the
@@ -1575,7 +1574,7 @@ mrb_num_minus(mrb_state *mrb, mrb_value x, mrb_value y)
/* 15.2.8.3.16 */
/*
* call-seq:
- * fix - numeric -> numeric_result
+ * int - numeric -> numeric_result
*
* Performs subtraction: the class of the resulting object depends on
* the class of <code>numeric</code> and on the magnitude of the
@@ -1641,9 +1640,9 @@ mrb_integer_to_str(mrb_state *mrb, mrb_value x, mrb_int base)
/* 15.2.8.3.25 */
/*
* call-seq:
- * fix.to_s(base=10) -> string
+ * int.to_s(base=10) -> string
*
- * Returns a string containing the representation of <i>fix</i> radix
+ * Returns a string containing the representation of <i>int</i> radix
* <i>base</i> (between 2 and 36).
*
* 12345.to_s #=> "12345"
@@ -1715,7 +1714,7 @@ cmpnum(mrb_state *mrb, mrb_value v1, mrb_value v2)
* < => -1
* = => 0
* > => +1
- * Comparison---Returns -1, 0, or +1 depending on whether <i>fix</i> is
+ * Comparison---Returns -1, 0, or +1 depending on whether <i>int</i> is
* less than, equal to, or greater than <i>numeric</i>. This is the
* basis for the tests in <code>Comparable</code>. When the operands are
* not comparable, it returns nil instead of raising an exception.

MODIFY
src/string.c
src/string.c
@@ -1171,12 +1171,12 @@ mrb_str_aref(mrb_state *mrb, mrb_value str, mrb_value indx, mrb_value alen)
/* 15.2.10.5.34 */
/*
* call-seq:
- * str[fixnum] => fixnum or nil
- * str[fixnum, fixnum] => new_str or nil
+ * str[int] => int or nil
+ * str[int, int] => new_str or nil
* str[range] => new_str or nil
* str[other_str] => new_str or nil
- * str.slice(fixnum) => fixnum or nil
- * str.slice(fixnum, fixnum) => new_str or nil
+ * str.slice(int) => int or nil
+ * str.slice(int, int) => new_str or nil
* str.slice(range) => new_str or nil
* str.slice(other_str) => new_str or nil
*
@@ -1378,8 +1378,8 @@ mrb_str_aset(mrb_state *mrb, mrb_value str, mrb_value indx, mrb_value alen, mrb_
/*
* call-seq:
- * str[fixnum] = replace
- * str[fixnum, fixnum] = replace
+ * str[int] = replace
+ * str[int, int] = replace
* str[range] = replace
* str[other_str] = replace
*
@@ -1750,7 +1750,7 @@ mrb_str_hash(mrb_state *mrb, mrb_value str)
/* 15.2.10.5.20 */
/*
* call-seq:
- * str.hash => fixnum
+ * str.hash => int
*
* Return a hash based on the string's length and content.
*/
@@ -1758,14 +1758,14 @@ static mrb_value
mrb_str_hash_m(mrb_state *mrb, mrb_value self)
{
mrb_int key = mrb_str_hash(mrb, self);
- return mrb_fixnum_value(key);
+ return mrb_int_value(mrb, key);
}
/* 15.2.10.5.21 */
/*
* call-seq:
* str.include? other_str => true or false
- * str.include? fixnum => true or false
+ * str.include? int => true or false
*
* Returns <code>true</code> if <i>str</i> contains the given string or
* character.
@@ -1788,7 +1788,7 @@ mrb_str_include(mrb_state *mrb, mrb_value self)
/* 15.2.10.5.22 */
/*
* call-seq:
- * str.index(substring [, offset]) => fixnum or nil
+ * str.index(substring [, offset]) => int or nil
*
* Returns the index of the first occurrence of the given
* <i>substring</i>. Returns <code>nil</code> if not found.
@@ -2014,7 +2014,7 @@ mrb_str_reverse(mrb_state *mrb, mrb_value str)
/* 15.2.10.5.31 */
/*
* call-seq:
- * str.rindex(substring [, offset]) => fixnum or nil
+ * str.rindex(substring [, offset]) => int or nil
*
* Returns the index of the last occurrence of the given <i>substring</i>.
* Returns <code>nil</code> if not found. If the second parameter is
@@ -2718,7 +2718,7 @@ mrb_str_inspect(mrb_state *mrb, mrb_value str)
/*
* call-seq:
- * str.bytes -> array of fixnums
+ * str.bytes -> array of int
*
* Returns an array of bytes in _str_.
*

Replace `fixnum` references with `int`.

The `Fixnum` class is no longer provided by `mruby`.