Skip to content

Commit fe13e6c

Browse files
authored
Merge pull request #2905 from frootloops/int32
2 parents f688257 + 2c634e7 commit fe13e6c

File tree

7 files changed

+56
-56
lines changed

7 files changed

+56
-56
lines changed

stdlib/public/Platform/MachError.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#if os(OSX) || os(iOS) || os(tvOS) || os(watchOS)
22
/// Enumeration describing Mach error codes.
3-
@objc public enum MachError : CInt {
3+
@objc public enum MachError : Int32 {
44
case KERN_SUCCESS = 0
55

66
/// Specified address is not currently valid.

stdlib/public/Platform/POSIXError.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#if os(OSX) || os(iOS) || os(tvOS) || os(watchOS)
44
/// Enumeration describing POSIX error codes.
5-
@objc public enum POSIXError : CInt {
5+
@objc public enum POSIXError : Int32 {
66
// FIXME: These are the values for Darwin. We need to get the Linux
77
// values as well.
88
/// Operation not permitted.

stdlib/public/Platform/Platform.swift

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -168,84 +168,84 @@ public func snprintf(ptr: UnsafeMutablePointer<Int8>, _ len: Int, _ format: Unsa
168168
@_silgen_name("_swift_Platform_open")
169169
func _swift_Platform_open(
170170
_ path: UnsafePointer<CChar>,
171-
_ oflag: CInt,
171+
_ oflag: Int32,
172172
_ mode: mode_t
173-
) -> CInt
173+
) -> Int32
174174

175175
@_silgen_name("_swift_Platform_openat")
176176
func _swift_Platform_openat(
177-
_ fd: CInt,
177+
_ fd: Int32,
178178
_ path: UnsafePointer<CChar>,
179-
_ oflag: CInt,
179+
_ oflag: Int32,
180180
_ mode: mode_t
181-
) -> CInt
181+
) -> Int32
182182

183183
public func open(
184184
_ path: UnsafePointer<CChar>,
185-
_ oflag: CInt
186-
) -> CInt {
185+
_ oflag: Int32
186+
) -> Int32 {
187187
return _swift_Platform_open(path, oflag, 0)
188188
}
189189

190190
public func open(
191191
_ path: UnsafePointer<CChar>,
192-
_ oflag: CInt,
192+
_ oflag: Int32,
193193
_ mode: mode_t
194-
) -> CInt {
194+
) -> Int32 {
195195
return _swift_Platform_open(path, oflag, mode)
196196
}
197197

198198
public func openat(
199-
_ fd: CInt,
199+
_ fd: Int32,
200200
_ path: UnsafePointer<CChar>,
201-
_ oflag: CInt
202-
) -> CInt {
201+
_ oflag: Int32
202+
) -> Int32 {
203203
return _swift_Platform_openat(fd, path, oflag, 0)
204204
}
205205

206206
public func openat(
207-
_ fd: CInt,
207+
_ fd: Int32,
208208
_ path: UnsafePointer<CChar>,
209-
_ oflag: CInt,
209+
_ oflag: Int32,
210210
_ mode: mode_t
211-
) -> CInt {
211+
) -> Int32 {
212212
return _swift_Platform_openat(fd, path, oflag, mode)
213213
}
214214

215215
@_silgen_name("_swift_Platform_fcntl")
216216
internal func _swift_Platform_fcntl(
217-
_ fd: CInt,
218-
_ cmd: CInt,
219-
_ value: CInt
220-
) -> CInt
217+
_ fd: Int32,
218+
_ cmd: Int32,
219+
_ value: Int32
220+
) -> Int32
221221

222222
@_silgen_name("_swift_Platform_fcntlPtr")
223223
internal func _swift_Platform_fcntlPtr(
224-
_ fd: CInt,
225-
_ cmd: CInt,
224+
_ fd: Int32,
225+
_ cmd: Int32,
226226
_ ptr: UnsafeMutablePointer<Void>
227-
) -> CInt
227+
) -> Int32
228228

229229
public func fcntl(
230-
_ fd: CInt,
231-
_ cmd: CInt
232-
) -> CInt {
230+
_ fd: Int32,
231+
_ cmd: Int32
232+
) -> Int32 {
233233
return _swift_Platform_fcntl(fd, cmd, 0)
234234
}
235235

236236
public func fcntl(
237-
_ fd: CInt,
238-
_ cmd: CInt,
239-
_ value: CInt
240-
) -> CInt {
237+
_ fd: Int32,
238+
_ cmd: Int32,
239+
_ value: Int32
240+
) -> Int32 {
241241
return _swift_Platform_fcntl(fd, cmd, value)
242242
}
243243

244244
public func fcntl(
245-
_ fd: CInt,
246-
_ cmd: CInt,
245+
_ fd: Int32,
246+
_ cmd: Int32,
247247
_ ptr: UnsafeMutablePointer<Void>
248-
) -> CInt {
248+
) -> Int32 {
249249
return _swift_Platform_fcntlPtr(fd, cmd, ptr)
250250
}
251251

@@ -397,27 +397,27 @@ public var SEM_FAILED: UnsafeMutablePointer<sem_t>? {
397397
@_silgen_name("_swift_Platform_sem_open2")
398398
internal func _swift_Platform_sem_open2(
399399
_ name: UnsafePointer<CChar>,
400-
_ oflag: CInt
400+
_ oflag: Int32
401401
) -> UnsafeMutablePointer<sem_t>?
402402

403403
@_silgen_name("_swift_Platform_sem_open4")
404404
internal func _swift_Platform_sem_open4(
405405
_ name: UnsafePointer<CChar>,
406-
_ oflag: CInt,
406+
_ oflag: Int32,
407407
_ mode: mode_t,
408408
_ value: CUnsignedInt
409409
) -> UnsafeMutablePointer<sem_t>?
410410

411411
public func sem_open(
412412
_ name: UnsafePointer<CChar>,
413-
_ oflag: CInt
413+
_ oflag: Int32
414414
) -> UnsafeMutablePointer<sem_t>? {
415415
return _swift_Platform_sem_open2(name, oflag)
416416
}
417417

418418
public func sem_open(
419419
_ name: UnsafePointer<CChar>,
420-
_ oflag: CInt,
420+
_ oflag: Int32,
421421
_ mode: mode_t,
422422
_ value: CUnsignedInt
423423
) -> UnsafeMutablePointer<sem_t>? {

stdlib/public/Platform/tgmath.swift.gyb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ public func modf(_ value: ${T}) -> (${T}, ${T}) {
211211
% for T, CT, f in AllFloatTypes():
212212
@_transparent
213213
public func ldexp(_ x: ${T}, _ n: Int) -> ${T} {
214-
return ${T}(ldexp${f}(${CT}(x), CInt(n)))
214+
return ${T}(ldexp${f}(${CT}(x), Int32(n)))
215215
}
216216

217217
% end
@@ -220,7 +220,7 @@ public func ldexp(_ x: ${T}, _ n: Int) -> ${T} {
220220
% for T, CT, f in AllFloatTypes():
221221
@_transparent
222222
public func frexp(_ value: ${T}) -> (${T}, Int) {
223-
var exp = CInt(0)
223+
var exp = Int32(0)
224224
let frac = frexp${f}(${CT}(value), &exp)
225225
return (${T}(frac), Int(exp))
226226
}
@@ -231,7 +231,7 @@ public func frexp(_ value: ${T}) -> (${T}, Int) {
231231
% for T, CT, f in AllFloatTypes():
232232
@_transparent
233233
public func ilogb(_ x: ${T}) -> Int {
234-
return Int(ilogb${f}(${CT}(x)) as CInt)
234+
return Int(ilogb${f}(${CT}(x)) as Int32)
235235
}
236236

237237
% end
@@ -240,7 +240,7 @@ public func ilogb(_ x: ${T}) -> Int {
240240
% for T, CT, f in AllFloatTypes():
241241
@_transparent
242242
public func scalbn(_ x: ${T}, _ n: Int) -> ${T} {
243-
return ${T}(scalbn${f}(${CT}(x), CInt(n)))
243+
return ${T}(scalbn${f}(${CT}(x), Int32(n)))
244244
}
245245

246246
% end
@@ -250,7 +250,7 @@ public func scalbn(_ x: ${T}, _ n: Int) -> ${T} {
250250
#if os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Windows)
251251
@_transparent
252252
public func lgamma(_ x: ${T}) -> (${T}, Int) {
253-
var sign = CInt(0)
253+
var sign = Int32(0)
254254
let value = lgamma${f}_r(${CT}(x), &sign)
255255
return (${T}(value), Int(sign))
256256
}
@@ -260,13 +260,13 @@ public func lgamma(_ x: ${T}) -> (${T}, Int) {
260260
@_versioned
261261
@_silgen_name("_swift_Darwin_lgamma${f}_r")
262262
func _swift_Darwin_lgamma${f}_r(_: ${CT},
263-
_: UnsafeMutablePointer<CInt>) -> ${CT}
263+
_: UnsafeMutablePointer<Int32>) -> ${CT}
264264

265265
@_transparent
266266
public func lgamma(_ x: ${T}) -> (${T}, Int) {
267-
var sign = CInt(0)
267+
var sign = Int32(0)
268268
let value = withUnsafeMutablePointer(&sign) {
269-
(signp: UnsafeMutablePointer<CInt>) -> ${CT} in
269+
(signp: UnsafeMutablePointer<Int32>) -> ${CT} in
270270
return _swift_Darwin_lgamma${f}_r(${CT}(x), signp)
271271
}
272272
return (${T}(value), Int(sign))
@@ -279,7 +279,7 @@ public func lgamma(_ x: ${T}) -> (${T}, Int) {
279279
% for T, CT, f in AllFloatTypes():
280280
@_transparent
281281
public func remquo(_ x: ${T}, _ y: ${T}) -> (${T}, Int) {
282-
var quo = CInt(0)
282+
var quo = Int32(0)
283283
let rem = remquo${f}(${CT}(x), ${CT}(y), &quo)
284284
return (${T}(rem), Int(quo))
285285
}
@@ -305,12 +305,12 @@ public func fma(_ x: ${T}, _ y: ${T}, _ z: ${T}) -> ${T} {
305305
% # These C functions only support double. The overlay fixes the Int parameter.
306306
@_transparent
307307
public func jn(_ n: Int, _ x: Double) -> Double {
308-
return jn(CInt(n), x)
308+
return jn(Int32(n), x)
309309
}
310310

311311
@_transparent
312312
public func yn(_ n: Int, _ x: Double) -> Double {
313-
return yn(CInt(n), x)
313+
return yn(Int32(n), x)
314314
}
315315

316316
% end

stdlib/public/core/Process.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ public enum Process {
3333
}
3434

3535
@_versioned
36-
internal static var _argc: CInt = CInt()
36+
internal static var _argc: Int32 = Int32()
3737

3838
@_versioned
3939
internal static var _unsafeArgv:
4040
UnsafeMutablePointer<UnsafeMutablePointer<Int8>?>?
4141
= nil
4242

4343
/// Access to the raw argc value from C.
44-
public static var argc: CInt {
44+
public static var argc: Int32 {
4545
return _argc
4646
}
4747

@@ -82,6 +82,6 @@ func _stdlib_didEnterMain(
8282
) {
8383
// Initialize the Process.argc and Process.unsafeArgv variables with the
8484
// values that were passed in to main.
85-
Process._argc = CInt(argc)
85+
Process._argc = Int32(argc)
8686
Process._unsafeArgv = argv
8787
}

stdlib/public/core/VarArgs.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public func _encodeBitsAsWords<T : CVarArg>(_ x: T) -> [Int] {
121121
}
122122

123123
// CVarArg conformances for the integer types. Everything smaller
124-
// than a CInt must be promoted to CInt or CUnsignedInt before
124+
// than an Int32 must be promoted to Int32 or CUnsignedInt before
125125
// encoding.
126126

127127
// Signed types
@@ -160,15 +160,15 @@ extension Int16 : CVarArg {
160160
/// Transform `self` into a series of machine words that can be
161161
/// appropriately interpreted by C varargs.
162162
public var _cVarArgEncoding: [Int] {
163-
return _encodeBitsAsWords(CInt(self))
163+
return _encodeBitsAsWords(Int32(self))
164164
}
165165
}
166166

167167
extension Int8 : CVarArg {
168168
/// Transform `self` into a series of machine words that can be
169169
/// appropriately interpreted by C varargs.
170170
public var _cVarArgEncoding: [Int] {
171-
return _encodeBitsAsWords(CInt(self))
171+
return _encodeBitsAsWords(Int32(self))
172172
}
173173
}
174174

test/IDE/print_stdlib.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
// CHECK-UNDERSCORED-PROT: public protocol _SignedInteger
2525
// CHECK-UNDERSCORED-PROT-NOT: protocol _
2626

27-
// CHECK-ARGC: static var argc: CInt { get }
27+
// CHECK-ARGC: static var argc: Int32 { get }
2828

2929
// CHECK-NOT: @rethrows
3030
// CHECK-NOT: {{^}}import

0 commit comments

Comments
 (0)