From cff13b54421095190314c724896842abf4dd2dc1 Mon Sep 17 00:00:00 2001 From: ducky Date: Tue, 20 Oct 2015 17:51:53 -0700 Subject: Add explicit types for public methods --- src/main/scala/Chisel/Utils.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/main/scala/Chisel/Utils.scala') diff --git a/src/main/scala/Chisel/Utils.scala b/src/main/scala/Chisel/Utils.scala index a7a18193..68005f7f 100644 --- a/src/main/scala/Chisel/Utils.scala +++ b/src/main/scala/Chisel/Utils.scala @@ -89,12 +89,12 @@ object RegInit { /** A register with an Enable signal */ object RegEnable { - def apply[T <: Data](updateData: T, enable: Bool) = { + def apply[T <: Data](updateData: T, enable: Bool): T = { val r = Reg(updateData) when (enable) { r := updateData } r } - def apply[T <: Data](updateData: T, resetData: T, enable: Bool) = { + def apply[T <: Data](updateData: T, resetData: T, enable: Bool): T = { val r = RegInit(resetData) when (enable) { r := updateData } r @@ -185,7 +185,7 @@ object is { // Begin deprecation of non-type-parameterized is statements. * } }}}*/ object switch { def apply[T <: Bits](cond: T)(x: => Unit): Unit = macro impl - def impl(c: Context)(cond: c.Tree)(x: c.Tree) = { import c.universe._ + def impl(c: Context)(cond: c.Tree)(x: c.Tree): c.Tree = { import c.universe._ val sc = c.universe.internal.reificationSupport.freshTermName("sc") def extractIsStatement(tree: Tree): List[c.universe.Tree] = tree match { case q"Chisel.is.apply( ..$params )( ..$body )" => List(q"$sc.is( ..$params )( ..$body )") -- cgit v1.2.3