# HG changeset patch
# User Yuya Nishihara <y...@tcha.org>
# Date 1540728996 -32400
#      Sun Oct 28 21:16:36 2018 +0900
# Branch stable
# Node ID 2af0076a5465be08dc2dc91e352abfbbe9c2ab17
# Parent  7e4ffe2719e4af2a9e56c9ee097ed6720f5c3906
rust: fix signature of rustlazyancestors_init() function

diff --git a/mercurial/cext/revlog.c b/mercurial/cext/revlog.c
--- a/mercurial/cext/revlog.c
+++ b/mercurial/cext/revlog.c
@@ -2311,7 +2311,7 @@ rustlazyancestorsObject *rustlazyancesto
        /* to pass index_get_parents() */
        int (*)(indexObject *, Py_ssize_t, int*, int),
        /* intrevs vector */
-       int initrevslen, long *initrevs,
+       Py_ssize_t initrevslen, long *initrevs,
        long stoprev,
        int inclusive);
 void rustlazyancestors_drop(rustlazyancestorsObject *self);
diff --git a/rust/hg-direct-ffi/src/ancestors.rs 
b/rust/hg-direct-ffi/src/ancestors.rs
--- a/rust/hg-direct-ffi/src/ancestors.rs
+++ b/rust/hg-direct-ffi/src/ancestors.rs
@@ -60,15 +60,16 @@ impl Graph for Index {
 pub extern "C" fn rustlazyancestors_init(
     index: IndexPtr,
     parents: IndexParentsFn,
-    initrevslen: usize,
+    initrevslen: ssize_t,
     initrevs: *mut c_long,
     stoprev: c_long,
     inclusive: c_int,
 ) -> *mut AncestorsIterator<Index> {
+    assert!(initrevslen >= 0);
     unsafe {
         raw_init(
             Index::new(index, parents),
-            initrevslen,
+            initrevslen as usize,
             initrevs,
             stoprev,
             inclusive,
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to