adds dynamic preview loading and silence minizip warnings (#11)

* make use of the return value for safety

* get rid of warnings
(sizeof(wchar_t) is the same as sizeof(u32), so no problem there)

* dynamic preview loading
fix crash when too many themes have previews available
This commit is contained in:
LiquidFenrir
2017-09-01 03:57:08 +02:00
committed by Alex Taber
parent 4811fa1c4c
commit 70e086b20c
10 changed files with 117 additions and 68 deletions

View File

@@ -11,6 +11,14 @@
See the accompanying LICENSE file for the full text of the license.
*/
//taken and adapted from https://stackoverflow.com/a/13492589
// save diagnostic state
#pragma GCC diagnostic push
// turn off the specific warning. Can also use "-Wall"
#pragma GCC diagnostic ignored "-Wunused-parameter"
#include <stdlib.h>
#include <string.h>
@@ -367,3 +375,6 @@ void fill_fopen64_filefunc (zlib_filefunc64_def* pzlib_filefunc_def)
pzlib_filefunc_def->zerror_file = ferror_file_func;
pzlib_filefunc_def->opaque = NULL;
}
// turn the warnings back on
#pragma GCC diagnostic pop

View File

@@ -18,6 +18,13 @@
with.
*/
//taken and adapted from https://stackoverflow.com/a/13492589
// save diagnostic state
#pragma GCC diagnostic push
// turn off the specific warning. Can also use "-Wall"
#pragma GCC diagnostic ignored "-Wunused-parameter"
#include <stdio.h>
#include <stdlib.h>
@@ -190,3 +197,6 @@ void fill_memory_filefunc (pzlib_filefunc_def, ourmem)
pzlib_filefunc_def->zerror_file = ferror_mem_func;
pzlib_filefunc_def->opaque = ourmem;
}
// turn the warnings back on
#pragma GCC diagnostic pop

View File

@@ -21,6 +21,14 @@
access functions to crctables and pkeys
*/
//taken and adapted from https://stackoverflow.com/a/13492589
// save diagnostic state
#pragma GCC diagnostic push
// turn off the specific warning. Can also use "-Wall"
#pragma GCC diagnostic ignored "-Wtype-limits"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -1949,3 +1957,6 @@ extern int ZEXPORT unzeof(unzFile file)
return 1;
return 0;
}
// turn the warnings back on
#pragma GCC diagnostic pop