summaryrefslogtreecommitdiff
path: root/src/msil
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2009-11-11 00:56:31 +0000
committerPaul Phillips <paulp@improving.org>2009-11-11 00:56:31 +0000
commitfc07ece2e71a722dc44d366c8463dd27f825e289 (patch)
tree3ebd81e90b98cbd394d60e58947a405f2bd41204 /src/msil
parent1e9a86e70122babbba0d248b930b78584871fc87 (diff)
downloadscala-fc07ece2e71a722dc44d366c8463dd27f825e289.tar.gz
scala-fc07ece2e71a722dc44d366c8463dd27f825e289.tar.bz2
scala-fc07ece2e71a722dc44d366c8463dd27f825e289.zip
The preferred way to convert between primitives...
The preferred way to convert between primitives is to call .toInt etc, but there were lots of casts for historical reasons. This patch remedies that.
Diffstat (limited to 'src/msil')
-rw-r--r--src/msil/ch/epfl/lamp/compiler/msil/emit/OpCode.scala6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/msil/ch/epfl/lamp/compiler/msil/emit/OpCode.scala b/src/msil/ch/epfl/lamp/compiler/msil/emit/OpCode.scala
index 076bf50360..e7bff447cc 100644
--- a/src/msil/ch/epfl/lamp/compiler/msil/emit/OpCode.scala
+++ b/src/msil/ch/epfl/lamp/compiler/msil/emit/OpCode.scala
@@ -52,13 +52,13 @@ class OpCode extends Visitable {
protected def length(): byte = {
val code = OpCode.length(CEE_code)
val inline = OpCode.INLINE_length(CEE_inline)
- return if(inline < 0) { -1 } else { (code + inline).asInstanceOf[byte] }
+ return if(inline < 0) { -1 } else { (code + inline).toByte }
}
protected def popush(): byte = {
val pop = OpCode.POP_size(CEE_pop)
val push = OpCode.PUSH_size(CEE_push)
- return if(pop < 0 || push < 0) { OpCode.POPUSH_SPECIAL } else { (push - pop).asInstanceOf[byte] }
+ return if(pop < 0 || push < 0) { OpCode.POPUSH_SPECIAL } else { (push - pop).toByte }
}
override def toString(): String = {
@@ -524,7 +524,7 @@ object OpCode {
pop: byte, push: byte, inline: byte, flow: byte) {
that.CEE_opcode = opcode
that.CEE_string = string
- that.CEE_code = code.asInstanceOf[short]
+ that.CEE_code = code.toShort
that.CEE_pop = pop
that.CEE_push = push
that.CEE_inline = inline