From 2f132d49325941c886d0fc620e9095488328076b Mon Sep 17 00:00:00 2001 From: Jesin Date: Thu, 14 Jun 2018 16:06:54 -0400 Subject: [PATCH] fix compiler warnings about const-breaking cast `buffer` is already declared as `const unsigned char*`, which can be transparently accepted by `fwrite()`. Casting it to `char*` here just makes compilers complain about "discarding cv-qualifiers", so this commit removes that cast. --- lodepng.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lodepng.cpp b/lodepng.cpp index 2b12fb57..05287bbf 100644 --- a/lodepng.cpp +++ b/lodepng.cpp @@ -398,7 +398,7 @@ unsigned lodepng_save_file(const unsigned char* buffer, size_t buffersize, const FILE* file; file = fopen(filename, "wb" ); if(!file) return 79; - fwrite((char*)buffer , 1 , buffersize, file); + fwrite(buffer, 1, buffersize, file); fclose(file); return 0; }