rust/hg-cpython/src/cindex.rs
branchstable
changeset 46412 7d0405e458a0
parent 44973 26114bd6ec60
child 47268 9d1a8829f959
--- a/rust/hg-cpython/src/cindex.rs	Thu Jan 28 13:25:37 2021 +0100
+++ b/rust/hg-cpython/src/cindex.rs	Thu Jan 28 13:15:34 2021 +0100
@@ -16,7 +16,7 @@
 };
 use hg::revlog::{Node, RevlogIndex};
 use hg::{Graph, GraphError, Revision, WORKING_DIRECTORY_REVISION};
-use libc::c_int;
+use libc::{c_int, ssize_t};
 
 const REVLOG_CABI_VERSION: c_int = 2;
 
@@ -24,10 +24,10 @@
 pub struct Revlog_CAPI {
     abi_version: c_int,
     index_length:
-        unsafe extern "C" fn(index: *mut revlog_capi::RawPyObject) -> c_int,
+        unsafe extern "C" fn(index: *mut revlog_capi::RawPyObject) -> ssize_t,
     index_node: unsafe extern "C" fn(
         index: *mut revlog_capi::RawPyObject,
-        rev: c_int,
+        rev: ssize_t,
     ) -> *const Node,
     index_parents: unsafe extern "C" fn(
         index: *mut revlog_capi::RawPyObject,
@@ -157,7 +157,7 @@
 
     fn node(&self, rev: Revision) -> Option<&Node> {
         let raw = unsafe {
-            (self.capi.index_node)(self.index.as_ptr(), rev as c_int)
+            (self.capi.index_node)(self.index.as_ptr(), rev as ssize_t)
         };
         if raw.is_null() {
             None