Commit Graph

361 Commits

Author SHA1 Message Date
Simon Gladman
364a143b5e As per code review, rename convert(_:to:) to convertElements(of:to:). Also, remove unnecessary import. 2019-04-18 10:22:50 +01:00
Simon Gladman
74e7413b28 Remove spurious parameter from comments for clear() function. 2019-04-18 09:50:24 +01:00
Stephen Canon
57a4553832 SE-0246: Protocols and static functions (#23824)
This implements the protocols and static functions proposed in SE-0246, plus some initial test coverage. It also has some rough accompanying cleanup of tgmath. It does not include the globals (on scalars or SIMD types) nor does it deprecate much in tgmath.h.
2019-04-17 23:57:33 +02:00
Max Moiseev
bd59b2220f Merge pull request #23860 from ebainville/dev/DataProtocol-inputs
DataProtocol inputs in Compression overlay
2019-04-16 16:11:29 -07:00
swift-ci
73edb17824 Merge pull request #23802 from Catfish-Man/transparently-false 2019-04-15 16:28:58 -07:00
David Smith
7db8cb1ea3 SR-10294: convertBoolToDarwinBool and friends should be inlined 2019-04-15 09:00:29 -07:00
simon gladman
f454132641 Add pseudo code to inverted clip description. 2019-04-15 13:25:50 +01:00
Yigitcan Yurtsever
68c00792df Fix doc typo on yearForWeekOfYear case in DateComponents 2019-04-12 18:58:52 -07:00
Karoy Lorentey
13bc567085 [Foundation] Notification: Add note on == not being reflexive and stabilize hashing
The `ObjectIdentifier(object as AnyObject)` is not necessarily stable; this breaks reflexivity for ==, and it makes the hash encoding nondeterministic.
2019-04-12 15:26:40 -07:00
Eric Bainville
1b6f1120e1 made enums RawRepresentable, added availability for all top-level declarations, cosmetic changes 2019-04-09 14:52:44 -07:00
Eric Bainville
4261de491d changes from vode review 2019-04-09 09:05:42 -07:00
Karoy Lorentey
582b65b993 Revert "[Foundation] Data: Hash the entire contents, not just an arbitrary subset"
This reverts commit b711ed9f90.
2019-04-08 18:48:52 -07:00
Karoy Lorentey
7f1dd3ef23 [Foundation] Fix bizarre indentation issues 2019-04-08 18:46:44 -07:00
Karoy Lorentey
2ab2431dbd [Foundation] URL is actually already Hashable
I’m not sure why I was so convinced it wasn’t, but this certainly simplifies things.
2019-04-08 18:30:16 -07:00
Eric Bainville
dafba928a6 rename error states from code review 2019-04-08 13:22:44 -07:00
Karoy Lorentey
f859dd1316 [Foundation] URL: Fix availability of the new hash(into:) implementation 2019-04-05 19:25:27 -07:00
Karoy Lorentey
b711ed9f90 [Foundation] Data: Hash the entire contents, not just an arbitrary subset 2019-04-05 18:07:30 -07:00
Karoy Lorentey
6f40a4abf9 [Foundation] Measurement: Fix hashing 2019-04-05 18:07:30 -07:00
Karoy Lorentey
28e4688c05 [Foundation] PersonNameComponents: Modernize hashing 2019-04-05 18:07:30 -07:00
Karoy Lorentey
a23c3f36bd [Foundation] UUID: Modernize hashing 2019-04-05 18:07:29 -07:00
Karoy Lorentey
23cc71935b [Foundation] URLRequest: Modernize hashing 2019-04-05 18:07:29 -07:00
Karoy Lorentey
590f40770e [Foundation] URLComponents: Modernize hashing 2019-04-05 18:07:29 -07:00
Karoy Lorentey
10cb05ae6c [Foundation] URL: Add hash(into:) implementation
Note: URL does not implement Hashable.
2019-04-05 18:07:29 -07:00
Karoy Lorentey
b41eb97896 [Foundation] TimeZone: Modernize hashing 2019-04-05 18:07:29 -07:00
Karoy Lorentey
afa253961b [Foundation] NSRange: Modernize hashing 2019-04-05 18:07:29 -07:00
Karoy Lorentey
4bdc458c52 [Foundation] Notification: Modernize hashing 2019-04-05 18:07:29 -07:00
Karoy Lorentey
5e451e6d8f [Foundation] IndexPath: Modernize hashing 2019-04-05 18:07:29 -07:00
Karoy Lorentey
2d5520e80d [Foundation] IndexSet: Modernize hashing 2019-04-05 18:07:29 -07:00
Karoy Lorentey
9c46858d05 [Foundation] Locale: Modernize hashing 2019-04-05 18:07:29 -07:00
Karoy Lorentey
a0004226b1 [Foundation] Decimal: Modernize hashing 2019-04-05 18:07:29 -07:00
Karoy Lorentey
c1049e7b79 [Foundation] DateInterval: Modernize hashing 2019-04-05 18:07:29 -07:00
Karoy Lorentey
73be6b8335 [Foundation] DateComponents: Modernize hashing 2019-04-05 18:07:29 -07:00
Karoy Lorentey
741122ae65 [Foundation] Date: Modernize hashing 2019-04-05 18:07:29 -07:00
Karoy Lorentey
8b7adb35d3 [Foundation] AffineTransform: modernize hashing 2019-04-05 18:07:29 -07:00
Karoy Lorentey
0867f7e17f [Foundation] String.Encoding: Modernize hashing 2019-04-05 18:07:29 -07:00
Karoy Lorentey
81567ed85e [Foundation] CharacterSet: Modernize hashing 2019-04-05 18:07:26 -07:00
Karoy Lorentey
73ad830e40 [Foundation] Calendar: Modernize hashing 2019-04-05 18:07:21 -07:00
Karoy Lorentey
569e380337 [Foundation] NSRange: Add an explicit definition for hash(into:)
This replaces the compiler-generated variant (based on hashValue) with a better implementation.
2019-04-05 15:21:24 -07:00
Karoy Lorentey
46225d728a [Foundation] IndexPath: Add explicit hash(into:) definition, hashing *all* components
The new definition diverges from the existing hashValue: it feeds all path components to the hasher, rather than just a limited subset.

Hashing all the bits that are compared in == is necessary to ensure proper operation of the hash table.
2019-04-05 15:21:24 -07:00
Stephen Canon
c5e3f85378 Revert SE-0246 (#23800)
* Revert "Merge pull request #23791 from compnerd/you-know-nothing-clang"

This reverts commit 5150981150, reversing
changes made to 8fc305c03e.

* Revert "Merge pull request #23780 from compnerd/math-is-terrible"

This reverts commit 2d7fedd25f, reversing
changes made to 0205150b8f.

* Revert "Merge pull request #23140 from stephentyrone/mafs"

This reverts commit 777750dc51, reversing
changes made to 0c8920e747.
2019-04-04 19:35:25 -04:00
Philippe Hausler
02c55f372c Avoid O(n) copies when bridgable NSData objects are available 2019-04-04 09:33:17 -07:00
Eric Bainville
b1d4d40516 take DataProtocol as input; simplified errors; fixed availability 2019-04-03 15:20:40 -07:00
Ted Kremenek
777750dc51 Merge pull request #23140 from stephentyrone/mafs
Math functions for Swift
2019-04-03 14:53:16 -07:00
Karoy Lorentey
3c74c0f1cb [stdlib] Change the signature of Dictionary’s bulk initializer (#23758)
The initializer was originally introduced without proper availability; in https://github.com/apple/swift/pull/23643, we fixed this by applying the `@_alwaysEmitIntoClient` attribute. However, this had the unfortunate side-effect that the symbol disappeared from `libswiftCore.dylib`, which somehow confuses some simulator builds.

Try to figure out what’s happening by replacing the third closure argument with an integer return value. This changes the mangled name of the bulk initializer, which should make it more obvious how/why these builds fail.

rdar://problem/49479386
2019-04-03 10:51:36 -07:00
simon gladman
4721423535 Added floatToDouble and doubleToFloat 2019-04-03 13:49:58 +01:00
simon gladman
a0f504b821 Add conversion operations that return the result. 2019-04-03 11:37:33 +01:00
Steve (Numerics) Canon
3fda509805 Implementation of ElementaryFunctions / Real protocols.
This commit implements SE-0246, by adding conformance to Real to the Float, CGFloat, Double, and Float80 types, implemented either in terms of the system's C math library, existing standard library functionality, or LLVM intrinsics. It includes basic test coverage for these new functions, and deprecates and obsoletes *some* existing functionality in the Platform overlay. We still need to make a decision about how to handle the remaining "tgmath" functions, because obsoleting them is technically a source-breaking change (if users have unqualified names like "exp(1)", it's fine, but it would break users who have used qualified names like "Darwin.exp(1)".)
2019-04-02 18:49:31 -04:00
simon gladman
df1ed6a879 Merge branch 'master' into accelerate-vDSP-conversion 2019-04-02 17:32:15 +01:00
simon gladman
4cfbaa90b8 Add conversion functions that return the result. 2019-04-02 17:29:26 +01:00
simon gladman
0606fdd98b Create versions of window and ramp generation operations that return a result. 2019-04-02 16:13:01 +01:00