[kandinsky] Remove some warnings

This commit is contained in:
Romain Goyet
2018-10-11 13:13:49 +02:00
committed by LeaNumworks
parent 1dd1e6ca8d
commit dfb30e5799
2 changed files with 6 additions and 5 deletions

View File

@@ -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);

View File

@@ -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);
}