summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/scala/tools/util/AbstractTimer.scala11
-rw-r--r--src/compiler/scala/tools/util/SocketConnection.scala8
-rw-r--r--src/compiler/scala/tools/util/SocketServer.scala7
-rw-r--r--src/compiler/scala/tools/util/StringOps.scala4
-rw-r--r--src/compiler/scala/tools/util/UTF8Codec.scala21
5 files changed, 26 insertions, 25 deletions
diff --git a/src/compiler/scala/tools/util/AbstractTimer.scala b/src/compiler/scala/tools/util/AbstractTimer.scala
index f734692a79..0fe9625197 100644
--- a/src/compiler/scala/tools/util/AbstractTimer.scala
+++ b/src/compiler/scala/tools/util/AbstractTimer.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2002-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -35,19 +35,20 @@ abstract class AbstractTimer {
def issue(message: String, duration: Long): Unit
/** Starts a new timer. */
- def start() = {
+ def start() {
starts += currentTime
}
/** Ends the current timer. */
- def stop(message: String): Unit = {
+ def stop(message: String) {
val stop = currentTime
issue(message, stop - starts.pop)
}
/** Drops the current timer. */
- def drop(): Unit =
+ def drop() {
starts.pop
+ }
//########################################################################
}
diff --git a/src/compiler/scala/tools/util/SocketConnection.scala b/src/compiler/scala/tools/util/SocketConnection.scala
index c1a9fb2a20..7936cfea72 100644
--- a/src/compiler/scala/tools/util/SocketConnection.scala
+++ b/src/compiler/scala/tools/util/SocketConnection.scala
@@ -1,12 +1,12 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2002-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
-// $id: $
+// $Id$
package scala.tools.util
@@ -45,7 +45,7 @@ class SocketConnection(hostname: String, port: Int) {
}
}
- def close() = {
+ def close() {
in.close()
out.close()
socket.close()
diff --git a/src/compiler/scala/tools/util/SocketServer.scala b/src/compiler/scala/tools/util/SocketServer.scala
index 06b732c6cb..cfa5b3170e 100644
--- a/src/compiler/scala/tools/util/SocketServer.scala
+++ b/src/compiler/scala/tools/util/SocketServer.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2002-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -46,7 +46,7 @@ abstract class SocketServer {
fatal("Could not listen on any port; exiting.")
}
- def run(): unit =
+ def run() {
while (!shutDown) {
val serverSocket = try {
new ServerSocket(port)
@@ -75,6 +75,7 @@ abstract class SocketServer {
clientSocket.close()
serverSocket.close()
}
+ }
}
diff --git a/src/compiler/scala/tools/util/StringOps.scala b/src/compiler/scala/tools/util/StringOps.scala
index b1cd5d9b1a..98c0934f19 100644
--- a/src/compiler/scala/tools/util/StringOps.scala
+++ b/src/compiler/scala/tools/util/StringOps.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2002-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
diff --git a/src/compiler/scala/tools/util/UTF8Codec.scala b/src/compiler/scala/tools/util/UTF8Codec.scala
index d2d420c4b6..c082a3f0d7 100644
--- a/src/compiler/scala/tools/util/UTF8Codec.scala
+++ b/src/compiler/scala/tools/util/UTF8Codec.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2002-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -23,20 +23,20 @@ object UTF8Codec {
val end = from + len
while (i < end) {
val ch = src(i)
- i = i + 1
+ i += 1
if (ch < 128) {
dst(j) = ch.toByte
- j = j + 1
+ j += 1
}
else if (ch <= 0x3FF) {
dst(j) = (0xC0 | (ch >> 6)).toByte
dst(j+1) = (0x80 | (ch & 0x3F)).toByte
- j = j + 2
+ j += 2
} else {
dst(j) = (0xE0 | (ch >> 12)).toByte
dst(j+1) = (0x80 | ((ch >> 6) & 0x3F)).toByte
dst(j+2) = (0x80 | (ch & 0x3F)).toByte
- j = j + 3
+ j += 3
}
}
j
@@ -45,7 +45,6 @@ object UTF8Codec {
def encode(s: String, dst: Array[Byte], to: Int): Int =
encode(s.toCharArray(), 0, dst, to, s.length())
-
def encode(s: String): Array[Byte] = {
val dst = new Array[Byte](s.length() * 3)
val len = encode(s, dst, 0)
@@ -60,17 +59,17 @@ object UTF8Codec {
val end = from + len
while (i < end) {
var b = src(i) & 0xFF
- i = i + 1
+ i += 1
if (b >= 0xE0) {
b = ((b & 0x0F) << 12) | (src(i) & 0x3F) << 6
b = b | (src(i+1) & 0x3F)
- i = i + 2
+ i += 2
} else if (b >= 0xC0) {
b = ((b & 0x1F) << 6) | (src(i) & 0x3F)
- i = i + 1
+ i += 1
}
dst(j) = b.toChar
- j = j + 1
+ j += 1
}
j
}