]> www.infradead.org Git - users/hch/blktests.git/commitdiff
Fix build failure for discontiguous-io on 32-bit platforms
authorTheodore Ts'o <tytso@mit.edu>
Tue, 30 Oct 2018 14:36:49 +0000 (10:36 -0400)
committerBart Van Assche <bvanassche@acm.org>
Thu, 1 Nov 2018 17:40:42 +0000 (10:40 -0700)
Avoid that building with a 32-bit compiler fails as follows:
discontiguous-io.cpp:294:34: error: no matching function for call to 'min(long unsigned int, size_t)'
         std::min(4ul, len - i * 4));
                                  ^
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
[bvanassche: elaborated commit message]
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
src/discontiguous-io.cpp

index 5e0ee0f5b13fbe28061fdd29c00d142429312898..f51a305f94bbda6c19b56655a8e254e9e305e32b 100644 (file)
@@ -251,7 +251,7 @@ int main(int argc, char **argv)
        const char *dev;
        int c;
        std::vector<uint8_t> buf;
-       size_t len = 512;
+       unsigned long len = 512;
 
        while ((c = getopt(argc, argv, "hl:o:sw")) != EOF) {
                switch (c) {