]> granicus.if.org Git - xz/commitdiff
Tests: Silence a warning from -Wsign-conversion.
authorLasse Collin <lasse.collin@tukaani.org>
Mon, 24 Jun 2019 17:53:55 +0000 (20:53 +0300)
committerLasse Collin <lasse.collin@tukaani.org>
Mon, 24 Jun 2019 17:53:55 +0000 (20:53 +0300)
tests/create_compress_files.c

index bd5b4ef40d404dcc8de747e59bb6b149bdcc5580..88d60b73635d999fa7ff759843548ce4c3d5b070 100644 (file)
@@ -94,10 +94,10 @@ write_random(FILE *file)
        for (size_t i = 0; i < 123456; ++i) {
                n = 101771 * n + 71777;
 
-               putc(n & 0xFF, file);
-               putc((n >> 8) & 0xFF, file);
-               putc((n >> 16) & 0xFF, file);
-               putc(n >> 24, file);
+               putc((uint8_t)(n), file);
+               putc((uint8_t)(n >> 8), file);
+               putc((uint8_t)(n >> 16), file);
+               putc((uint8_t)(n >> 24), file);
        }
 }