Skip to content

Commit

Permalink
Merge pull request #496 from scala-steward/update/nscplugin-0.5.1
Browse files Browse the repository at this point in the history
Update nscplugin, sbt-scala-native to 0.5.1
  • Loading branch information
mpilquist authored May 13, 2024
2 parents 81152b5 + 8145b9c commit a7a47dc
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
6 changes: 3 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import com.typesafe.tools.mima.core._
addCommandAlias("fmt", "; compile:scalafmt; test:scalafmt; scalafmtSbt")
addCommandAlias("fmtCheck", "; compile:scalafmtCheck; test:scalafmtCheck; scalafmtSbtCheck")

ThisBuild / tlBaseVersion := "1.1"
ThisBuild / tlBaseVersion := "1.2"

ThisBuild / organization := "org.scodec"
ThisBuild / organizationName := "Scodec"
Expand Down Expand Up @@ -97,7 +97,7 @@ lazy val core = crossProject(JVMPlatform, JSPlatform, NativePlatform)
(base / "NOTICE") +: (base / "LICENSE") +: ((base / "licenses") * "LICENSE_*").get
},
scalacOptions := scalacOptions.value.filterNot(_ == "-source:3.0-migration"),
libraryDependencies += "org.scalameta" %%% "munit-scalacheck" % "1.0.0-M11" % "test"
libraryDependencies += "org.scalameta" %%% "munit-scalacheck" % "1.0.0-RC1" % "test"
)

lazy val coreJVM = core.jvm
Expand Down Expand Up @@ -144,7 +144,7 @@ lazy val coreJS = core.js.settings(
)

lazy val coreNative = core.native.settings(
tlVersionIntroduced ++= List("2.12", "2.13", "3").map(_ -> "1.1.32").toMap
tlVersionIntroduced ++= List("2.12", "2.13", "3").map(_ -> "1.2.0").toMap
)

lazy val benchmark: Project = project
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@

package scodec.bits

import scala.scalanative.unsafe.Ptr
import scala.scalanative.unsafe.Zone
import scala.scalanative.unsafe.alloc
import scala.scalanative.unsafe.{Ptr, Zone, alloc}
import scala.scalanative.unsigned._

private[bits] trait ByteVectorCrossPlatform { self: ByteVector =>
import ByteVector._
Expand All @@ -49,7 +48,7 @@ private[bits] trait ByteVectorCrossPlatform { self: ByteVector =>
}

def toPtr(implicit zone: Zone): Ptr[Byte] = {
val dest = alloc[Byte](size)
val dest = alloc[Byte](size.toCSize)
copyToPtr(dest, 0)
dest
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class ByteVectorNativeTest extends BitsSuite {
}

test("view(Ptr[Byte])") {
Zone { implicit z =>
Zone.acquire { implicit z =>
val ptr = alloc[Byte](4)
setDEADBEEF(ptr)
val byteVector: ByteVector = ByteVector.view(ptr, 4)
Expand All @@ -54,7 +54,7 @@ class ByteVectorNativeTest extends BitsSuite {
}

test("fromPtr") {
Zone { implicit z =>
Zone.acquire { implicit z =>
val ptr = alloc[Byte](4)
setDEADBEEF(ptr)
val byteVector: ByteVector = ByteVector.fromPtr(ptr, 4)
Expand All @@ -65,7 +65,7 @@ class ByteVectorNativeTest extends BitsSuite {
}

test("copyToPtr") {
Zone { implicit z =>
Zone.acquire { implicit z =>
val ptr = alloc[Byte](6)
ptr(0) = 0xaa.toByte
ptr(5) = 0xff.toByte
Expand All @@ -75,7 +75,7 @@ class ByteVectorNativeTest extends BitsSuite {
}

test("toPtr") {
Zone { implicit z =>
Zone.acquire { implicit z =>
assert(ByteVector.view(hex"deadbeef".toPtr, 4) === hex"deadbeef")
}
}
Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
addSbtPlugin("org.typelevel" % "sbt-typelevel" % "0.7.1")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.16.0")
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.3.2")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.17")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.5.1")
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.7")

0 comments on commit a7a47dc

Please sign in to comment.