Skip to content

Commit 8b0693d

Browse files
committed
Rename swiftvim_asint
1 parent 4fa09e7 commit 8b0693d

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

Sources/Vim/VimValue.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ extension Int {
99
let intValue = Int(strValue) {
1010
self.init(intValue)
1111
} else {
12-
self.init(swiftvim_asint(value.reference))
12+
self.init(swiftvim_asnum(value.reference))
1313
}
1414
}
1515

@@ -231,7 +231,7 @@ extension UnsafeVimValue {
231231
self,
232232
UnsafeMutablePointer(mutating: fCStr))
233233
}
234-
return Int(swiftvim_asint(value))
234+
return Int(swiftvim_asnum(value))
235235
}
236236
}
237237

Sources/Vim/VimWindow.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public class VimWindow {
1313
}
1414
let first = swiftvim_tuple_get(cursor, 0)
1515
let second = swiftvim_tuple_get(cursor, 1)
16-
return (Int(swiftvim_asint(first)), Int(swiftvim_asint(second)))
16+
return (Int(swiftvim_asnum(first)), Int(swiftvim_asnum(second)))
1717
}
1818

1919
public var height: Int {

Sources/VimInterface/include/VimInterface/swiftvim.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ void *_Nullable swiftvim_incref(void *_Nullable value);
99

1010
// Value extraction
1111
const char *_Nullable swiftvim_asstring(void *_Nullable value);
12-
int swiftvim_asint(void *_Nullable value);
12+
long swiftvim_asnum(void *_Nullable value);
1313

1414
// List
1515
int swiftvim_list_size(void *_Nonnull list);

Sources/VimInterface/swiftvim_lib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ VIM_INTEN const char *swiftvim_asstring(void *value) {
192192
return v;
193193
}
194194

195-
VIM_INTEN int swiftvim_asint(void *value) {
195+
VIM_INTEN long swiftvim_asnum(void *value) {
196196
PyGILState_STATE gstate = PyGILState_Ensure();
197197
int v = PyLong_AsLong(value);
198198
PyGILState_Release(gstate);

Tests/VimInterfaceTests/CallingTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class VimInterfaceTests: XCTestCase {
4747
UnsafeMutablePointer(mutating: moduleCStr),
4848
UnsafeMutablePointer(mutating: fCStr),
4949
UnsafeMutablePointer(mutating: argCStr))
50-
let value = swiftvim_asint(result)
50+
let value = swiftvim_asnum(result)
5151
XCTAssertEqual(value, 1)
5252
}
5353
}
@@ -81,7 +81,7 @@ class VimInterfaceTests: XCTestCase {
8181
UnsafeMutablePointer(mutating: moduleCStr),
8282
UnsafeMutablePointer(mutating: fCStr),
8383
UnsafeMutablePointer(mutating: argCStr))
84-
let value = swiftvim_asint(result)
84+
let value = swiftvim_asnum(result)
8585
XCTAssertEqual(value, 1)
8686
}
8787
}

0 commit comments

Comments
 (0)