mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Revert "[gardening] Fix typo: "nul-terminated" → "null-terminated""
This commit is contained in:
@@ -48,7 +48,7 @@ enum class DeclRefKind {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/// Identifier - This is an instance of a uniqued identifier created by
|
/// Identifier - This is an instance of a uniqued identifier created by
|
||||||
/// ASTContext. It just wraps a null-terminated "const char*".
|
/// ASTContext. It just wraps a nul-terminated "const char*".
|
||||||
class Identifier {
|
class Identifier {
|
||||||
friend class ASTContext;
|
friend class ASTContext;
|
||||||
const char *Pointer;
|
const char *Pointer;
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ class Lexer {
|
|||||||
|
|
||||||
/// Pointer to one past the end character of the buffer, even in a lexer
|
/// Pointer to one past the end character of the buffer, even in a lexer
|
||||||
/// that scans a subrange of the buffer. Because the buffer is always
|
/// that scans a subrange of the buffer. Because the buffer is always
|
||||||
/// NULL-terminated, this points to the NUL terminator.
|
/// NUL-terminated, this points to the NUL terminator.
|
||||||
const char *BufferEnd;
|
const char *BufferEnd;
|
||||||
|
|
||||||
/// Pointer to the artificial EOF that is located before BufferEnd. Useful
|
/// Pointer to the artificial EOF that is located before BufferEnd. Useful
|
||||||
|
|||||||
@@ -594,7 +594,7 @@ extension String {
|
|||||||
/// `encoding`, without any allocations. Does not NULL-terminate.
|
/// `encoding`, without any allocations. Does not NULL-terminate.
|
||||||
///
|
///
|
||||||
/// - Parameter buffer: A buffer into which to store the bytes from
|
/// - Parameter buffer: A buffer into which to store the bytes from
|
||||||
/// the receiver. The returned bytes are not NULL-terminated.
|
/// the receiver. The returned bytes are not NUL-terminated.
|
||||||
///
|
///
|
||||||
/// - Parameter maxBufferCount: The maximum number of bytes to write
|
/// - Parameter maxBufferCount: The maximum number of bytes to write
|
||||||
/// to buffer.
|
/// to buffer.
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
import SwiftShims
|
import SwiftShims
|
||||||
|
|
||||||
extension String {
|
extension String {
|
||||||
/// Creates a new `String` by copying the null-terminated UTF-8 data
|
/// Creates a new `String` by copying the nul-terminated UTF-8 data
|
||||||
/// referenced by a `CString`.
|
/// referenced by a `CString`.
|
||||||
///
|
///
|
||||||
/// Returns `nil` if the `CString` is `NULL` or if it contains ill-formed
|
/// Returns `nil` if the `CString` is `NULL` or if it contains ill-formed
|
||||||
@@ -30,7 +30,7 @@ extension String {
|
|||||||
input: UnsafeBufferPointer(start: UnsafeMutablePointer(cs), count: len))
|
input: UnsafeBufferPointer(start: UnsafeMutablePointer(cs), count: len))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Creates a new `String` by copying the null-terminated UTF-8 data
|
/// Creates a new `String` by copying the nul-terminated UTF-8 data
|
||||||
/// referenced by a `CString`.
|
/// referenced by a `CString`.
|
||||||
///
|
///
|
||||||
/// Returns `nil` if the `CString` is `NULL`. If `CString` contains
|
/// Returns `nil` if the `CString` is `NULL`. If `CString` contains
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ public func withExtendedLifetime<T, Result>(
|
|||||||
extension String {
|
extension String {
|
||||||
|
|
||||||
/// Invoke `f` on the contents of this string, represented as
|
/// Invoke `f` on the contents of this string, represented as
|
||||||
/// a null-terminated array of char, ensuring that the array's
|
/// a nul-terminated array of char, ensuring that the array's
|
||||||
/// lifetime extends through the execution of `f`.
|
/// lifetime extends through the execution of `f`.
|
||||||
public func withCString<Result>(
|
public func withCString<Result>(
|
||||||
@noescape f: UnsafePointer<Int8> throws -> Result
|
@noescape f: UnsafePointer<Int8> throws -> Result
|
||||||
|
|||||||
@@ -247,7 +247,7 @@ extension String {
|
|||||||
return _core.elementWidth == 1 ? _core.startASCII : nil
|
return _core.elementWidth == 1 ? _core.startASCII : nil
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A contiguously-stored null-terminated UTF-8 representation of
|
/// A contiguously-stored nul-terminated UTF-8 representation of
|
||||||
/// `self`.
|
/// `self`.
|
||||||
///
|
///
|
||||||
/// To access the underlying memory, invoke
|
/// To access the underlying memory, invoke
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ struct String {
|
|||||||
: String(ptr, strlen(ptr))
|
: String(ptr, strlen(ptr))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
/// Create a Swift String from two concatenated null-terminated strings.
|
/// Create a Swift String from two concatenated nul-terminated strings.
|
||||||
explicit String(const char *ptr1, const char *ptr2) {
|
explicit String(const char *ptr1, const char *ptr2) {
|
||||||
size_t len1 = strlen(ptr1);
|
size_t len1 = strlen(ptr1);
|
||||||
size_t len2 = strlen(ptr2);
|
size_t len2 = strlen(ptr2);
|
||||||
|
|||||||
Reference in New Issue
Block a user