Commit Graph

2952 Commits

Author SHA1 Message Date
Dmitri Gribenko
bcb5a363d1 Merge pull request #3287 from PatrickPijnappel/utf-refactor
[stdlib] Significant UTF8/16 decode speed-ups for iterator nil-guarantee
2016-07-08 14:07:15 -07:00
Stephen Canon
5f47048491 Fix sNaN behavior of .minimum, .maximum, .minimumMagnitude and .maximumMagnitude. (#3361)
* Bring the behavior of Self.minimum, .maximum, .minimumMagnitude and .maximumMagnitude in line with the IEEE 754 rules.

Specifically, if either argument is a signaling NaN, the result should be a quiet NaN.  Previously, signaling NaN inputs were treated identically to quiet NaN inputs.

Some other changes folded in with this:
- Formally define which argument is returned if lhs == rhs or abs(lhs) == abs(rhs) in the case of the Magnitude versions.  This guarantees that the set {min,max} is identitical to the set {lhs,rhs} so long as neither argument is NaN.  This is not only a nod to formalism; it's also a critical property for generic head-tail arithmetic to simulate wider types.
- Added test coverage for these four operations.
2016-07-07 22:57:38 -04:00
Patrick Pijnappel
d4470aa6ee [stdlib] Refactor UTF16 decode to use UInt16 locals 2016-07-08 12:38:39 +10:00
Dmitri Gribenko
ce94bd9cca Merge pull request #3268 from natecook1000/nc-scalarindex-nocore
[stdlib] Remove _StringCore from UnicodeScalarIndex
2016-07-07 17:41:36 -07:00
Patrick Pijnappel
69e6e190cd [stdlib] Minor refactor of StrideThroughGenerator.next() 2016-07-07 18:39:45 +10:00
Dave Abrahams
125823d16c [stdlib] ManagedBuffer: rename Value => Header
This implements SE-0114 Updating Buffer "Value" Names to "Header" Names
https://github.com/apple/swift-evolution/blob/master/proposals/0114-buffer-naming.md
2016-07-06 17:45:17 -07:00
swift-ci
817b8e3ea5 Merge pull request #3349 from moiseev/qualified 2016-07-05 19:06:46 -07:00
Max Moiseev
1cca4ff528 Adding @warn_unqualified_access to Sequence.min/max and Strideable.stride 2016-07-05 16:08:05 -07:00
Dmitri Gribenko
acac328eaa stdlib: remove _Reflectable 2016-07-05 14:13:23 -07:00
Nate Cook
2d75c12c2d [stdlib] Remove _StringCore reference from UnicodeScalarIndex
This removes the `_core` property from UnicodeScalarView.Index
and moves any remaining index-moving logic from the index to
the view in UnicodeScalarView and CharacterView.
2016-07-02 23:16:22 -05:00
swift-ci
06d0959cb8 Merge pull request #3322 from lucianomarisi/chore/sequence-documenation-typo 2016-07-02 17:09:50 -07:00
Chris Lattner
45f2cfaaa0 Implement SE-0099, but where the migration diagnostics are left as warnings
for now.  I'll upgrade them to errors in a week or two to give downstream
projects a chance to update.
2016-07-02 15:44:57 -07:00
Luciano Marisi
360b07550d Fixed incorrect reference name of CountdownIterator on Sequence documentation 2016-07-02 19:01:20 +01:00
Rintaro Ishizaki
7ca06d5c43 [stdlib] Add missing anyGenerator migration aid 2016-07-02 12:08:27 +09:00
swift-ci
fe13e6c0e3 Merge pull request #2905 from frootloops/int32 2016-07-01 19:10:12 -07:00
swift-ci
4d52626484 Merge pull request #3300 from practicalswift/remove-after-variable-before-colon 2016-07-01 18:18:10 -07:00
Dmitri Gribenko
cb13d70a0f Merge pull request #3270 from apple/stdlib-fix-unsafety-in-ManagedBuffer-value
stdlib: Fix lifetime issues in ManagedBuffer.value
2016-07-01 16:24:24 -07:00
swift-ci
530c1f1429 Merge pull request #3272 from apple/stdlib-add-rethrows 2016-07-01 16:20:33 -07:00
practicalswift
5d1af107a3 [gardening] Use "{let,var} c: C" instead of "{let,var} c : C"
Inspired by @gribozavr:s fix in 1ad666742e
2016-07-01 23:51:32 +02:00
Patrick Pijnappel
34b82bf82c Resolve conflicts with master 2016-07-01 22:32:27 +10:00
Rintaro Ishizaki
6ef62f3c73 [stdlib] Better diagnosis for unavailable APIs
Added tests for expected-error and fix-its.

- Add arguments signature regardless that is the same as before.
  Because the error message looks more natural.
  e.g. "makeIterator" => "makeIterator()",
  "replaceSubrange" => "replaceSubrange(_:with:)"
- Any${ExistentialCollection}.underestimateCount() was a method, not
  computed property.
- 'LazySequenceType' has been renamed to 'LazySequenceProtocol', but not
  'LazyCollectionProtocol'
- Streamable.writeTo(_:) had no argument label.
- Fixed typo in print() debugPrint() error message (not working for now)
- Repeated.init(): changed `renamed` to `message` because the arugment
  order has changed.
- Marked `public` for some unavailable method on `Sequence`
- Sequence.split(_:maxSplit:allowEmptySlices) was replaced with
  split(separator:maxSplits:omittingEmptySubsequences:),
  not split(separator:omittingEmptySubsequences:isSeparator:)
- Sequence.split(_:allowEmptySlices:isSeparator) was replaced with
  split(maxSplits:omittingEmptySubsequences:isSeparator:),
  not split(_:omittingEmptySubsequences:isSeparator:)
- Sequence.startsWith(_:isEquivalent:) or startsWith(_:) had no label on
  the first argument.
- transcode(_:_:_:_:stopOnError), not transcode(_:_:_:_:stoppingOnError)
- Removed mutating methods from UnsafePointer.
  alloc(_:), dealloc(_:), setter:memory, initialize(_:), destroy(),
  and destroy(_:)
2016-07-01 14:52:09 +09:00
Nicholas Maccharoli
0af6f09758 Remove unnecessary parenthesis 2016-07-01 11:59:50 +09:00
Stephen Canon
5da37a5b1a Round Float.pi down so that it's in [0,π].
* Change value of Float.pi so that it's rounded down; this helps insure that angles computed via trigonometry end up in the correct quadrant.

* Missed commit of corresponding test change.
2016-06-30 16:20:22 -04:00
Doug Gregor
7e0491b69f [Standard library] Remove dead function _arrayUpCast 2016-06-30 11:06:30 -07:00
Dmitri Gribenko
49b1ab8eaf stdlib: add 'rethrows' to ManagedBuffer APIs 2016-06-29 20:58:08 -07:00
swift-ci
8fe85c3368 Merge pull request #2977 from ultramiraculous/failable-float-float 2016-06-29 20:30:11 -07:00
Dmitri Gribenko
e8706ad0f3 stdlib: Fix lifetime issues in ManagedBuffer.value
This property had unsafe addressors, but there was nothing that kept the
memory owner (the `self` reference) alive.
2016-06-29 18:39:08 -07:00
Dmitri Gribenko
6f86f3d80f stdlib: use defer for _fixLifetime() 2016-06-29 17:29:17 -07:00
Dmitri Gribenko
e44db1e01d stdlib: add @noescape in ManagedBuffer APIs
These APIs were missed during earlier audits.
2016-06-29 17:28:35 -07:00
Chris Williams
26623fdbef SE-0080 - Failable initializers for Float->Float 2016-06-29 16:23:27 -07:00
Dmitri Gribenko
2642eab20d Merge pull request #3143 from benlangmuir/stdlib-array-buffer-init
[stdlib] Stop copying the _ContiguousArrayBuffer when initializing an ArraySlice from a literal
2016-06-28 13:56:23 -07:00
Nate Cook
a7ab3d5123 Merge pull request #3177 from natecook1000/nc-docs-split
[stdlib] Fix and clean up 'split' documentation
2016-06-23 23:08:08 -05:00
Nate Cook
4aaa31efbd [stdlib] Fix and clean up 'split' documentation
* Collection's default implementation for
  split(separator:maxSplits:omittingEmptySubsequences:) had the wrong
  version of the documentation.
* Some parameter docs were missing default values.
* Fixed an indentation issue.
* Reviewed the post-index-change TODO comments throughout
  Collection.swift.
2016-06-23 16:02:40 -05:00
practicalswift
e78e7e4c3c [gardening] Fix recently introduced typos. 2016-06-23 16:42:48 +02:00
Dmitri Gribenko
7fcf1dbd04 Merge pull request #3155 from natecook1000/nc-ump-doc
[stdlib] Re-attach documentation comment
2016-06-23 00:01:38 -07:00
Dmitri Gribenko
81bc0eed45 Merge pull request #3146 from apple/stdlib-dictionary-make-safer
stdlib: make some internal Dictionary APIs safer
2016-06-22 21:56:14 -07:00
Nate Cook
2c769b1828 [stdlib] Re-attach documentation comment
This removes a `FIXME` comment between the documentation for `UnsafeMutablePointer.initialize(with:count:)` that is preventing the documentation from attaching to the symbol.
2016-06-22 22:44:05 -05:00
Dave Abrahams
2d6efaff60 [stdlib] constistently name param to map/flatMap 2016-06-22 16:19:24 -07:00
Dmitri Gribenko
90b3625a10 stdlib: avoid copying the _ContiguousArrayBuffer when initializing an ArraySlice from a literal 2016-06-22 15:07:20 -07:00
Dmitri Gribenko
6f502fae0b stdlib: make some internal Dictionary APIs safer by sinking the _fixLifetime() call deeper into implementation details 2016-06-22 14:10:10 -07:00
Ben Langmuir
826dae3300 [stdlib] Rename stdlib-private init(_ _buffer:) to init(_buffer:)
This is good hygiene, since the buffer will also be a collection and
could potentially be passed to the unspecialized Sequence initializer,
as indeed was happenining for ArraySlice (see FIXME(ABI) comment).
2016-06-22 13:54:17 -07:00
swift-ci
2031bdc185 Merge pull request #2963 from ultramiraculous/failable-int-int 2016-06-21 23:49:11 -07:00
swift-ci
ba19162548 Merge pull request #3121 from CodaFi/up-and-atom 2016-06-21 21:40:25 -07:00
Chris Williams
1858b3edf1 Rename srcWord to src 2016-06-21 21:18:17 -07:00
Chris Williams
a61ff5081c Int->Int Failable Initializers 2016-06-21 21:11:04 -07:00
Robert Widmann
c8d9720fab Re-add the optional overload for atomic ptr swaps 2016-06-21 18:42:49 -07:00
swift-ci
25f4455546 Merge pull request #3116 from apple/stdlib-fix-int-docs 2016-06-21 17:43:53 -07:00
swift-ci
63c36dff0a Merge pull request #2943 from xwu/floating-point-stride 2016-06-21 15:06:43 -07:00
Dmitri Gribenko
d7a4e97f3b stdlib: make doc comments for Int and UInt cross-platform 2016-06-21 14:44:34 -07:00
Dmitri Gribenko
ac73d7ecfb stdlib: use a better type parameter name in _Box 2016-06-21 11:23:22 -07:00