stdlib: add first argument labels and some other changes to conform to API guidelines

This commit is contained in:
Dmitri Gribenko
2016-02-12 16:59:15 -08:00
parent a558d13a3b
commit efaa39ea79
132 changed files with 1653 additions and 1592 deletions

View File

@@ -775,13 +775,13 @@ internal func _transcodeSomeUTF16AsUTF8<
// Replace it with U+FFFD.
r = 0xbdbfef
scalarUtf8Length = 3
} else if _slowPath(nextIndex.advancedBy(1) == endIndex) {
} else if _slowPath(nextIndex.advanced(by: 1) == endIndex) {
// We have seen a high-surrogate and EOF, so we have an ill-formed
// sequence. Replace it with U+FFFD.
r = 0xbdbfef
scalarUtf8Length = 3
} else {
let unit1 = UInt(input[nextIndex.advancedBy(1)])
let unit1 = UInt(input[nextIndex.advanced(by: 1)])
if _fastPath((unit1 >> 10) == 0b1101_11) {
// `unit1` is a low-surrogate. We have a well-formed surrogate
// pair.
@@ -809,7 +809,7 @@ internal func _transcodeSomeUTF16AsUTF8<
result |= numericCast(r) << shift
utf8Count += scalarUtf8Length
}
nextIndex = nextIndex.advancedBy(utf16Length)
nextIndex = nextIndex.advanced(by: utf16Length)
}
// FIXME: Annoying check, courtesy of <rdar://problem/16740169>
if utf8Count < sizeofValue(result) {