infraruby-java 3.7.0 → 3.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +3 -4
- data/ext/primitive/PrimitiveService.java +14 -0
- data/ext/primitive/primitive.c +23 -1
- data/infraruby-java.gemspec +1 -1
- data/lib/primitive/primitive.jar +0 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d00e7de703aae51d7d474b145c2f703c933efc4f
|
4
|
+
data.tar.gz: c389f046d3fdbda9139c73b98180c50a0acb69ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c25fed5902e1ab4cece7e6c4fc9d2f262a351bc7831c311d11687f6c583fd839ceddc222e46697f4472e498dff753e003fbe3210c8f01b3f96581609c66ed305
|
7
|
+
data.tar.gz: 1d9c2782e59fea5010dad56119371ff996c4ce93f7deb6ea9f86b61674d8fa072d04633a7d9202439414eef90a1f774e7c83fc8917f11faa90ecab9e7d33ec0e
|
data/README.md
CHANGED
@@ -1195,6 +1195,13 @@ public class PrimitiveService implements BasicLibraryService {
|
|
1195
1195
|
return RubyString.newString(runtime, PrimitiveService.__int32_chr(runtime, value));
|
1196
1196
|
}
|
1197
1197
|
@JRubyMethod
|
1198
|
+
public Int32 succ() {
|
1199
|
+
Ruby runtime = getRuntime();
|
1200
|
+
if (value == 0x7FFFFFFF)
|
1201
|
+
throw runtime.newLightweightStopIterationError("StopIteration");
|
1202
|
+
return new Int32(PrimitiveService.Int32Class, value + 1);
|
1203
|
+
}
|
1204
|
+
@JRubyMethod
|
1198
1205
|
public Int32 rol(IRubyObject o) {
|
1199
1206
|
Ruby runtime = getRuntime();
|
1200
1207
|
int v = PrimitiveService.__object_i32(runtime, o);
|
@@ -1532,6 +1539,13 @@ public class PrimitiveService implements BasicLibraryService {
|
|
1532
1539
|
return RubyString.newString(runtime, PrimitiveService.__int64_to_hex(runtime, value));
|
1533
1540
|
}
|
1534
1541
|
@JRubyMethod
|
1542
|
+
public Int64 succ() {
|
1543
|
+
Ruby runtime = getRuntime();
|
1544
|
+
if (value == 0x7FFFFFFFFFFFFFFFL)
|
1545
|
+
throw runtime.newLightweightStopIterationError("StopIteration");
|
1546
|
+
return new Int64(PrimitiveService.Int64Class, value + 1);
|
1547
|
+
}
|
1548
|
+
@JRubyMethod
|
1535
1549
|
public Int64 rol(IRubyObject o) {
|
1536
1550
|
Ruby runtime = getRuntime();
|
1537
1551
|
int v = PrimitiveService.__object_i32(runtime, o);
|
data/ext/primitive/primitive.c
CHANGED
@@ -2048,6 +2048,16 @@ r_Int32_chr(VALUE self)
|
|
2048
2048
|
return __int32_chr(value);
|
2049
2049
|
}
|
2050
2050
|
static VALUE
|
2051
|
+
r_Int32_succ(VALUE self)
|
2052
|
+
{
|
2053
|
+
Int32 *p;
|
2054
|
+
Data_Get_Struct(self, Int32, p);
|
2055
|
+
int32_t value = p->value;
|
2056
|
+
if (value == 0x7FFFFFFF)
|
2057
|
+
rb_raise(rb_eStopIteration, "StopIteration");
|
2058
|
+
return __allocate_Int32(value + 1);
|
2059
|
+
}
|
2060
|
+
static VALUE
|
2051
2061
|
r_Int32_rol(VALUE self, VALUE o)
|
2052
2062
|
{
|
2053
2063
|
Int32 *p;
|
@@ -2452,7 +2462,7 @@ r_Int64_bang_to_int32(VALUE self)
|
|
2452
2462
|
Int64 *p;
|
2453
2463
|
Data_Get_Struct(self, Int64, p);
|
2454
2464
|
int64_t value = p->value;
|
2455
|
-
if (value < -
|
2465
|
+
if (value < -0x0000000080000000L || value > 0x000000007FFFFFFFL)
|
2456
2466
|
rb_raise(rb_eRangeError, "int64 too big to convert to int32");
|
2457
2467
|
return __allocate_Int32((int32_t) value);
|
2458
2468
|
}
|
@@ -2478,6 +2488,16 @@ r_Int64_to_hex(VALUE self)
|
|
2478
2488
|
return __int64_to_hex(value);
|
2479
2489
|
}
|
2480
2490
|
static VALUE
|
2491
|
+
r_Int64_succ(VALUE self)
|
2492
|
+
{
|
2493
|
+
Int64 *p;
|
2494
|
+
Data_Get_Struct(self, Int64, p);
|
2495
|
+
int64_t value = p->value;
|
2496
|
+
if (value == 0x7FFFFFFFFFFFFFFFL)
|
2497
|
+
rb_raise(rb_eStopIteration, "StopIteration");
|
2498
|
+
return __allocate_Int64(value + 1);
|
2499
|
+
}
|
2500
|
+
static VALUE
|
2481
2501
|
r_Int64_rol(VALUE self, VALUE o)
|
2482
2502
|
{
|
2483
2503
|
Int64 *p;
|
@@ -3813,6 +3833,7 @@ Init_primitive()
|
|
3813
3833
|
rb_define_method(r_Int32, "new_fixnum", r_Int32_to_fixnum, 0);
|
3814
3834
|
rb_define_method(r_Int32, "to_hex", r_Int32_to_hex, 0);
|
3815
3835
|
rb_define_method(r_Int32, "chr", r_Int32_chr, 0);
|
3836
|
+
rb_define_method(r_Int32, "succ", r_Int32_succ, 0);
|
3816
3837
|
rb_define_method(r_Int32, "rol", r_Int32_rol, 1);
|
3817
3838
|
rb_define_method(r_Int32, "ror", r_Int32_ror, 1);
|
3818
3839
|
rb_define_method(r_Int32, "count", r_Int32_count, 0);
|
@@ -3866,6 +3887,7 @@ Init_primitive()
|
|
3866
3887
|
rb_define_method(r_Int64, "to_fixnum", r_Int64_to_fixnum, 0);
|
3867
3888
|
rb_define_method(r_Int64, "new_fixnum", r_Int64_to_fixnum, 0);
|
3868
3889
|
rb_define_method(r_Int64, "to_hex", r_Int64_to_hex, 0);
|
3890
|
+
rb_define_method(r_Int64, "succ", r_Int64_succ, 0);
|
3869
3891
|
rb_define_method(r_Int64, "rol", r_Int64_rol, 1);
|
3870
3892
|
rb_define_method(r_Int64, "ror", r_Int64_ror, 1);
|
3871
3893
|
rb_define_method(r_Int64, "count", r_Int64_count, 0);
|
data/infraruby-java.gemspec
CHANGED
data/lib/primitive/primitive.jar
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: infraruby-java
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.7.
|
4
|
+
version: 3.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- InfraRuby Vision
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: infraruby-base
|