diff --git a/kandinsky/fonts/rasterizer.c b/kandinsky/fonts/rasterizer.c index 617bfc099..97c09aac2 100644 --- a/kandinsky/fonts/rasterizer.c +++ b/kandinsky/fonts/rasterizer.c @@ -232,8 +232,8 @@ int main(int argc, char * argv[]) { ENSURE(uncompressedGlyphBufferIndex == sizeOfUncompressedGlyphBuffer, "Error filling uncompressed buffer, only %d out of %d", uncompressedGlyphBufferIndex, sizeOfUncompressedGlyphBuffer); int sizeOfCompressedGlyphBuffer = LZ4_compress_HC( - uncompressedGlyphBuffer, - glyphData + lastOffset, + (const char *)uncompressedGlyphBuffer, + (char *)(glyphData + lastOffset), sizeOfUncompressedGlyphBuffer, maxGlyphDataSize - lastOffset, LZ4HC_CLEVEL_MAX @@ -251,9 +251,9 @@ int main(int argc, char * argv[]) { size_t finalDataSize = lastOffset; size_t initialDataSize = GLYPH_COUNT * glyph_width * glyph_height; - fprintf(sourceFile, "/* Rasterized = %5d bytes (%d glyphs x %d pixels)\n", initialDataSize, GLYPH_COUNT, glyph_width*glyph_height); - fprintf(sourceFile, " * Downsampled = %5d bytes (1/%d of rasterized)\n", initialDataSize*greyscaleBitsPerPixel/8, 8/greyscaleBitsPerPixel); - fprintf(sourceFile, " * Compressed = %5d bytes (%.2f%% of rasterized) */\n", finalDataSize, 100.0*finalDataSize/initialDataSize); + fprintf(sourceFile, "/* Rasterized = %5zu bytes (%d glyphs x %d pixels)\n", initialDataSize, GLYPH_COUNT, glyph_width*glyph_height); + fprintf(sourceFile, " * Downsampled = %5lu bytes (1/%d of rasterized)\n", initialDataSize*greyscaleBitsPerPixel/8, 8/greyscaleBitsPerPixel); + fprintf(sourceFile, " * Compressed = %5zu bytes (%.2f%% of rasterized) */\n", finalDataSize, 100.0*finalDataSize/initialDataSize); fprintf(sourceFile, "static constexpr uint8_t glyphData[%d] = {", lastOffset); prettyPrintArray(sourceFile, 80, 1, glyphData, lastOffset); diff --git a/kandinsky/src/font.cpp b/kandinsky/src/font.cpp index 907356d12..07ca8d4fd 100644 --- a/kandinsky/src/font.cpp +++ b/kandinsky/src/font.cpp @@ -31,6 +31,7 @@ void KDFont::fetchGreyscaleGlyphForChar(char c, uint8_t * greyscaleBuffer) const compressedGlyphDataSize(c), m_glyphSize.width() * m_glyphSize.height() * k_bitsPerPixel/8 ); + (void)resultSize; // Silence the "variable unused" warning if assertions are not enabled assert(resultSize == m_glyphSize.width() * m_glyphSize.height() * k_bitsPerPixel/8); }