From 6def15d6965436e016c8a0c54c84a8a79c8acafe Mon Sep 17 00:00:00 2001 From: Paul Harris Date: Mon, 7 Oct 2013 08:50:59 +0800 Subject: [PATCH 1/4] Fix cast warnings --- miniz.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/miniz.c b/miniz.c index 358143a..be6ed0b 100644 --- a/miniz.c +++ b/miniz.c @@ -2810,7 +2810,7 @@ void *tdefl_write_image_to_png_file_in_memory_ex(const void *pImage, int w, int for (z = 41; z; --z) tdefl_output_buffer_putter(&z, 1, &out_buf); // compress image data tdefl_init(pComp, tdefl_output_buffer_putter, &out_buf, s_tdefl_png_num_probes[MZ_MIN(10, level)] | TDEFL_WRITE_ZLIB_HEADER); - for (y = 0; y < h; ++y) { tdefl_compress_buffer(pComp, &z, 1, TDEFL_NO_FLUSH); tdefl_compress_buffer(pComp, (mz_uint8*)pImage + (flip ? (h - 1 - y) : y) * bpl, bpl, TDEFL_NO_FLUSH); } + for (y = 0; y < h; ++y) { tdefl_compress_buffer(pComp, &z, 1, TDEFL_NO_FLUSH); tdefl_compress_buffer(pComp, (mz_uint8 const*)pImage + (flip ? (h - 1 - y) : y) * bpl, bpl, TDEFL_NO_FLUSH); } if (tdefl_compress_buffer(pComp, NULL, 0, TDEFL_FINISH) != TDEFL_STATUS_DONE) { MZ_FREE(pComp); MZ_FREE(out_buf.m_pBuf); return NULL; } // write real header *pLen_out = out_buf.m_size-41; From e7d558dd1d66701d6ff58751abcb24bcfc471793 Mon Sep 17 00:00:00 2001 From: Paul Harris Date: Mon, 7 Oct 2013 13:58:02 +0800 Subject: [PATCH 2/4] Added .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3268211 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.*.sw? From 374790a5d84148d575f4a8f96937e9c6e8eab914 Mon Sep 17 00:00:00 2001 From: paulharris Date: Tue, 8 Oct 2013 11:17:14 +0800 Subject: [PATCH 3/4] Create README.md --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..12d8980 --- /dev/null +++ b/README.md @@ -0,0 +1,15 @@ +miniz +===== + +Patches on top of the original svn repo. + +https://code.google.com/p/miniz/ + +svn checkout http://miniz.googlecode.com/svn/trunk/ miniz-read-only + +This git repo also includes all the upstream SVN checkins too. + +I have: +* Rearranged the file structure to make it easier to #include into my project, +* Added a CMake build (just for the examples, but could also be used to build it as a library), +* Fix various compiler warnings (GCC, and later will fix for MSVC 2010). From b491f840588377c6933604745ac3da5e77531471 Mon Sep 17 00:00:00 2001 From: Paul Harris Date: Tue, 26 May 2015 15:09:09 +0800 Subject: [PATCH 4/4] Add in a cmake install option, see CMakeLists.txt for notes. --- CMakeLists.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index c5b01e0..8c47b14 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -62,3 +62,15 @@ add_executable(example6 ${EXAMPLE6_SRC_LIST}) target_link_libraries(example6 m) add_executable(miniz_tester ${MINIZ_TESTER_SRC_LIST}) + +# Allow user to 'make install' into the build dir, +# so that library user can add to the -I include path: +# INSTALLDIR / include +# and then they can include miniz like so: +# #include +# +# Also allows for future option to customise the generated +# files via cmake (ie can control the #define options via +# cmake OS detection routines). +# +install(FILES miniz.c tinfl.c DESTINATION include/miniz)