From f77ea3be0ffdb378b181c9d136f9cf5664886c69 Mon Sep 17 00:00:00 2001 From: Andrew Cassidy Date: Sat, 2 Jul 2022 17:14:12 -0700 Subject: [PATCH] MSVC is a joke For some reason index variables need to be signed? --- quicktex/Encoder.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/quicktex/Encoder.h b/quicktex/Encoder.h index 4797011..3f3ff53 100644 --- a/quicktex/Encoder.h +++ b/quicktex/Encoder.h @@ -56,8 +56,9 @@ template class BlockEncoder : public Encoder { // As a result, this is sometimes left as a serial operation despite being embarassingly parallelizable // threshold for number of blocks before multithreading is set by overriding MTThreshold() #pragma omp parallel for if (blocks_x * blocks_y >= MTThreshold()) - for (unsigned y = 0; y < blocks_y; y++) { - for (unsigned x = 0; x < blocks_x; x++) { + for (int y = 0; y < (int)blocks_y; y++) { + for (int x = 0; x < (int)blocks_x; x++) { + // index variables have to be signed for MSVC for some reason auto pixels = decoded.get_block(x, y); auto block = EncodeBlock(pixels); encoded.set_block(x, y, block);