shithub: pokecrystal

Download patch

ref: 90bec40276b6a690cfa9b0a331cde183bd7f94f7
parent: 89a888277a7b03093128bce2974c3cbddc500cc5
author: Rangi <[email protected]>
date: Fri Oct 14 12:17:52 EDT 2022

Fix LodePNG to avoid `-Wcast-qual` warnings

<https://github.com/lvandeve/lodepng/issues/160>

--- a/tools/Makefile
+++ b/tools/Makefile
@@ -1,7 +1,7 @@
 .PHONY: all clean
 
 CC := gcc
-CFLAGS := -O3 -flto -std=c11 -Wall -Wextra -pedantic -Wno-missing-field-initializers
+CFLAGS := -O3 -flto -std=c11 -Wall -Wextra -pedantic
 
 tools := \
 	bpp2png \
--- a/tools/lodepng/lodepng.c
+++ b/tools/lodepng/lodepng.c
@@ -4618,10 +4618,10 @@
                               length, &zlibsettings);
       /*error: compressed text larger than  decoder->max_text_size*/
       if(error && size > zlibsettings.max_output_size) error = 112;
-      if(!error) error = lodepng_add_itext_sized(info, key, langtag, transkey, (char*)str, size);
+      if(!error) error = lodepng_add_itext_sized(info, key, langtag, transkey, (const char*)str, size);
       lodepng_free(str);
     } else {
-      error = lodepng_add_itext_sized(info, key, langtag, transkey, (char*)(data + begin), length);
+      error = lodepng_add_itext_sized(info, key, langtag, transkey, (const char*)(data + begin), length);
     }
 
     break;