From 2328cf5fcf828bfb64667e9bf0ef850311d3d803 Mon Sep 17 00:00:00 2001 From: Abduqodiri Qurbonzoda Date: Thu, 6 Apr 2023 17:34:11 +0300 Subject: [PATCH] [K/N] Internalize FloatingPointParser As a part of efforts to stabilize K/N stdlib. --- .../kotlin/kotlin/native/internal/FloatingPointParser.kt | 2 +- .../src/main/kotlin/kotlin/text/StringNumberConversions.kt | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/kotlin-native/runtime/src/main/kotlin/kotlin/native/internal/FloatingPointParser.kt b/kotlin-native/runtime/src/main/kotlin/kotlin/native/internal/FloatingPointParser.kt index 818546e3fcd..8e5618d908f 100644 --- a/kotlin-native/runtime/src/main/kotlin/kotlin/native/internal/FloatingPointParser.kt +++ b/kotlin-native/runtime/src/main/kotlin/kotlin/native/internal/FloatingPointParser.kt @@ -53,7 +53,7 @@ private external fun parseFloatImpl(s: String, e: Int): Float * Used to parse a string and return either a single or double precision * floating point number. */ -object FloatingPointParser { +internal object FloatingPointParser { /* * All number with exponent larger than MAX_EXP can be treated as infinity. * All number with exponent smaller than MIN_EXP can be treated as zero. diff --git a/kotlin-native/runtime/src/main/kotlin/kotlin/text/StringNumberConversions.kt b/kotlin-native/runtime/src/main/kotlin/kotlin/text/StringNumberConversions.kt index 86dcee5d222..e81dfb12392 100644 --- a/kotlin-native/runtime/src/main/kotlin/kotlin/text/StringNumberConversions.kt +++ b/kotlin-native/runtime/src/main/kotlin/kotlin/text/StringNumberConversions.kt @@ -137,16 +137,14 @@ public actual inline fun String.toLong(radix: Int): Long = toLongOrNull(radix) ? * Parses the string as a [Float] number and returns the result. * @throws NumberFormatException if the string is not a valid representation of a number. */ -@kotlin.internal.InlineOnly -public actual inline fun String.toFloat(): Float = FloatingPointParser.parseFloat(this) +public actual fun String.toFloat(): Float = FloatingPointParser.parseFloat(this) /** * Parses the string as a [Double] number and returns the result. * @throws NumberFormatException if the string is not a valid representation of a number. */ -@kotlin.internal.InlineOnly -public actual inline fun String.toDouble(): Double = FloatingPointParser.parseDouble(this) +public actual fun String.toDouble(): Double = FloatingPointParser.parseDouble(this) /** * Parses the string as a [Float] number and returns the result