Deprecate Char-to-Number conversions in stdlib (Native)

- Synchronize code of Ranges, Progressions, ProgressionIterators
- Suppress deprecations in regex implementation code

KT-23451
This commit is contained in:
Ilya Gorbunov
2021-04-07 04:50:55 +03:00
parent 833955e56d
commit 7cd306950a
30 changed files with 152 additions and 78 deletions
@@ -81,7 +81,7 @@ internal object nativeMemUtils {
val sourceArray = source.reinterpret<ShortVar>().ptr
var index = 0
while (index < length) {
dest[index] = sourceArray[index].toChar()
dest[index] = sourceArray[index].toInt().toChar()
++index
}
}
@@ -91,7 +91,7 @@ internal object nativeMemUtils {
val destArray = dest.reinterpret<ShortVar>().ptr
var index = 0
while (index < length) {
destArray[index] = source[index].toShort()
destArray[index] = source[index].code.toShort()
++index
}
}
@@ -148,7 +148,7 @@ public fun CPointer<UShortVar>.toKStringFromUtf16(): String {
val chars = kotlin.CharArray(length)
var index = 0
while (index < length) {
chars[index] = nativeBytes[index].toShort().toChar()
chars[index] = nativeBytes[index].toInt().toChar()
++index
}
return chars.concatToString()