[PATCH 2 of 6] cext: fix truncation warnings in revlog on Windows

Matt Harbison mharbison72 at gmail.com
Tue Aug 21 22:55:23 EDT 2018


# HG changeset patch
# User Matt Harbison <matt_harbison at yahoo.com>
# Date 1534899915 14400
#      Tue Aug 21 21:05:15 2018 -0400
# Node ID 66d4a3ebb954ee8f5f6fe9fa26b1a11839c8611f
# Parent  42cc76d0f836d224cacb2441368cf4e546b6c47d
cext: fix truncation warnings in revlog on Windows

diff --git a/mercurial/cext/revlog.c b/mercurial/cext/revlog.c
--- a/mercurial/cext/revlog.c
+++ b/mercurial/cext/revlog.c
@@ -457,7 +457,7 @@ static Py_ssize_t add_roots_get_min(inde
 			Py_DECREF(iter_item);
 			if (iter_item_long < min_idx)
 				min_idx = iter_item_long;
-			phases[iter_item_long] = marker;
+			phases[iter_item_long] = (char)marker;
 		}
 		Py_DECREF(iter);
 	}
@@ -1100,7 +1100,7 @@ static PyObject *nt_insert_py(nodetree *
 		return NULL;
 	}
 	node = index_node_existing(self->index, rev);
-	if (nt_insert(self, node, rev) == -1)
+	if (nt_insert(self, node, (int)rev) == -1)
 		return NULL;
 	Py_RETURN_NONE;
 }
@@ -1283,7 +1283,7 @@ static int index_init_nt(indexObject *se
 		if (self->nt == NULL) {
 			return -1;
 		}
-		if (nt_init(self->nt, self, self->raw_length) == -1) {
+		if (nt_init(self->nt, self, (int)self->raw_length) == -1) {
 			nt_dealloc(self->nt);
 			self->nt = NULL;
 			return -1;


More information about the Mercurial-devel mailing list