Patchwork [1,of,2,remotefilelog-ext] remotefilelog: don't assign a size_t to an int

login
register
mail settings
Submitter via Mercurial-devel
Date April 4, 2017, 5:32 p.m.
Message ID <c6a91402499e92d38297.1491327153@martinvonz.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/19958/
State Accepted
Delegated to: Jun Wu
Headers show

Comments

via Mercurial-devel - April 4, 2017, 5:32 p.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1491326717 25200
#      Tue Apr 04 10:25:17 2017 -0700
# Node ID c6a91402499e92d3829761521436ead8a42dc2ee
# Parent  e0c13e2aa439be27c87f2e1edce7cfdf44837184
remotefilelog: don't assign a size_t to an int

On some platforms, size_t is 64 bits and int is 32 bits.

Patch

diff -r e0c13e2aa439 -r c6a91402499e ctreemanifest/treemanifest.cpp
--- a/ctreemanifest/treemanifest.cpp	Mon Apr 03 17:24:08 2017 -0700
+++ b/ctreemanifest/treemanifest.cpp	Tue Apr 04 10:25:17 2017 -0700
@@ -508,7 +508,7 @@ 
   memcpy(this->parents[1].node, NULLID, BIN_NODE_SIZE);
 
   bool alreadyExists = false;
-  int matchingParent = -1;
+  size_t matchingParent = -1;
   bool isRootManifest = this->mainStack.size() == 1;
 
   // Record the nodes of all cmp manifest equivalents