about summary refs log tree commit diff
path: root/src/libstore/references.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2018-05-02T11·56+0200
committerEelco Dolstra <edolstra@gmail.com>2018-05-02T11·56+0200
commit53ec5ac69f59ac435b18297a594933e83e236766 (patch)
treef50797b3f3338de1d471a9b6f3b3e377813f09c9 /src/libstore/references.cc
parent548ad391d96d8922d0f8c35b5dd72bf4fb7e3ed1 (diff)
Fix some random -Wconversion warnings
Diffstat (limited to 'src/libstore/references.cc')
-rw-r--r--src/libstore/references.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libstore/references.cc b/src/libstore/references.cc
index ba9f18b9ca5e..5b7eb1f846af 100644
--- a/src/libstore/references.cc
+++ b/src/libstore/references.cc
@@ -13,7 +13,7 @@ namespace nix {
 static unsigned int refLength = 32; /* characters */
 
 
-static void search(const unsigned char * s, unsigned int len,
+static void search(const unsigned char * s, size_t len,
     StringSet & hashes, StringSet & seen)
 {
     static bool initialised = false;
@@ -25,7 +25,7 @@ static void search(const unsigned char * s, unsigned int len,
         initialised = true;
     }
 
-    for (unsigned int i = 0; i + refLength <= len; ) {
+    for (size_t i = 0; i + refLength <= len; ) {
         int j;
         bool match = true;
         for (j = refLength - 1; j >= 0; --j)
@@ -73,7 +73,7 @@ void RefScanSink::operator () (const unsigned char * data, size_t len)
 
     search(data, len, hashes, seen);
 
-    unsigned int tailLen = len <= refLength ? len : refLength;
+    size_t tailLen = len <= refLength ? len : refLength;
     tail =
         string(tail, tail.size() < refLength - tailLen ? 0 : tail.size() - (refLength - tailLen)) +
         string((const char *) data + len - tailLen, tailLen);