Skip to content

Commit 8e87138

Browse files
authored
Merge pull request #811 from ikesyo/replace-LONG_MAX
[gardening] Replace `LONG_MAX` with `Int.max`
2 parents cc8f43a + 7dd5b21 commit 8e87138

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Foundation/NSCalendar.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1264,7 +1264,7 @@ extension NSNotification.Name {
12641264
// or quantities of the units.
12651265
// When you create a new one of these, all values begin Undefined.
12661266

1267-
public var NSDateComponentUndefined: Int = LONG_MAX
1267+
public var NSDateComponentUndefined: Int = Int.max
12681268

12691269
open class NSDateComponents : NSObject, NSCopying, NSSecureCoding {
12701270
internal var _calendar: Calendar?

Foundation/NSThread.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ open class Thread : NSObject {
8989
var ti = end_at - start_at
9090
let end_ut = start_ut + ti
9191
while (0.0 < ti) {
92-
var __ts__ = timespec(tv_sec: LONG_MAX, tv_nsec: 0)
93-
if ti < Double(LONG_MAX) {
92+
var __ts__ = timespec(tv_sec: Int.max, tv_nsec: 0)
93+
if ti < Double(Int.max) {
9494
var integ = 0.0
9595
let frac: Double = withUnsafeMutablePointer(to: &integ) { integp in
9696
return modf(ti, integp)
@@ -110,8 +110,8 @@ open class Thread : NSObject {
110110
let start_ut = CFGetSystemUptime()
111111
let end_ut = start_ut + ti
112112
while 0.0 < ti {
113-
var __ts__ = timespec(tv_sec: LONG_MAX, tv_nsec: 0)
114-
if ti < Double(LONG_MAX) {
113+
var __ts__ = timespec(tv_sec: Int.max, tv_nsec: 0)
114+
if ti < Double(Int.max) {
115115
var integ = 0.0
116116
let frac: Double = withUnsafeMutablePointer(to: &integ) { integp in
117117
return modf(ti, integp)

0 commit comments

Comments
 (0)