From fdb0863fbe0a068dcca20fb7f8a9bf69907e7950 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Sun, 6 Nov 2011 00:39:38 +0000 Subject: [PATCH] Fix some warnings: use accessor functions instead of deprecated struct fields. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43194 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/tools/generate_boot_screen.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/tools/generate_boot_screen.cpp b/src/tools/generate_boot_screen.cpp index f0ea853d78..5869ad26d3 100644 --- a/src/tools/generate_boot_screen.cpp +++ b/src/tools/generate_boot_screen.cpp @@ -201,11 +201,11 @@ read_png(const char* filename, int& width, int& height, png_bytep*& rowPtrs, png_set_bgr(pngPtr); png_read_info(pngPtr, infoPtr); - width = infoPtr->width; - height = infoPtr->height; - if (infoPtr->bit_depth != 8) + width = (int)png_get_image_width(pngPtr, infoPtr); + height = (int)png_get_image_height(pngPtr, infoPtr); + if (png_get_bit_depth(pngPtr, infoPtr) != 8) error("[read_png] File %s has wrong bit depth\n", filename); - if ((int)infoPtr->rowbytes < width * 3) { + if ((int)png_get_rowbytes(pngPtr, infoPtr) < width * 3) { error("[read_png] File %s has wrong color type (RGB required)\n", filename); } @@ -221,7 +221,7 @@ read_png(const char* filename, int& width, int& height, png_bytep*& rowPtrs, rowPtrs = (png_bytep*)malloc(sizeof(png_bytep) * height); for (int y = 0; y < height; y++) - rowPtrs[y] = (png_byte*)malloc(infoPtr->rowbytes); + rowPtrs[y] = (png_byte*)malloc(png_get_rowbytes(pngPtr, infoPtr)); png_read_image(pngPtr, rowPtrs); } @@ -252,7 +252,7 @@ write_24bit_image(const char* baseName, int width, int height, png_bytep* rowPtr static void write_8bit_image(const char* baseName, int width, int height, unsigned char** rowPtrs) { - int buffer[128]; + //int buffer[128]; // buffer[0] stores count, buffer[1..127] holds the actual values fprintf(sOutput, "static uint8 %s8BitCompressedImage[] = {\n\t",