From 34d3319cc63d56cd30a1c768f12025dc17bfda1c Mon Sep 17 00:00:00 2001 From: gitlost Date: Mon, 15 Jun 2020 16:06:11 +0100 Subject: [PATCH] Windows: cast _allocas/mallocs, update DLL version, props Pierre Y. --- backend/bmp.c | 2 +- backend/dllversion.c | 4 ++-- backend/gif.c | 2 +- backend/large.c | 2 +- backend/libzint.rc | 10 +++++----- backend/qr.c | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/backend/bmp.c b/backend/bmp.c index 03a4b9c7..240c6975 100644 --- a/backend/bmp.c +++ b/backend/bmp.c @@ -55,7 +55,7 @@ INTERNAL int bmp_pixel_plot(struct zint_symbol *symbol, char *pixelbuf) { data_offset = sizeof (bitmap_file_header_t) + sizeof (bitmap_info_header_t); file_size = data_offset + data_size; - bitmap_file_start = malloc(file_size); + bitmap_file_start = (unsigned char *) malloc(file_size); if (bitmap_file_start == NULL) { strcpy(symbol->errtxt, "602: Out of memory"); return ZINT_ERROR_MEMORY; diff --git a/backend/dllversion.c b/backend/dllversion.c index d59725e1..71f5a757 100644 --- a/backend/dllversion.c +++ b/backend/dllversion.c @@ -20,11 +20,11 @@ HRESULT DllGetVersion (DLLVERSIONINFO2* pdvi) return (E_INVALIDARG); pdvi->info1.dwMajorVersion = 2; - pdvi->info1.dwMinorVersion = 2; + pdvi->info1.dwMinorVersion = 8; pdvi->info1.dwBuildNumber = 1; pdvi->info1.dwPlatformID = DLLVER_PLATFORM_WINDOWS; if (sizeof(DLLVERSIONINFO2) == pdvi->info1.cbSize) - pdvi->ullVersion = MAKEDLLVERULL(2, 2, 1, 0); + pdvi->ullVersion = MAKEDLLVERULL(2, 8, 1, 0); return S_OK; } diff --git a/backend/gif.c b/backend/gif.c index 238eb1b7..c5b19ee3 100644 --- a/backend/gif.c +++ b/backend/gif.c @@ -309,7 +309,7 @@ INTERNAL int gif_pixel_plot(struct zint_symbol *symbol, char *pixelbuf) { #ifndef _MSC_VER char lzwoutbuf[lzoutbufSize]; #else - lzwoutbuf = _alloca(lzoutbufSize); + lzwoutbuf = (char *) _alloca(lzoutbufSize); #endif /* _MSC_VER */ /* Open output file in binary mode */ diff --git a/backend/large.c b/backend/large.c index 41c16dd4..6f7d7af5 100644 --- a/backend/large.c +++ b/backend/large.c @@ -280,7 +280,7 @@ INTERNAL void large_uchar_array(const large_int *t, unsigned char *uchar_array, #ifndef _MSC_VER unsigned int uint_array[size ? size : 1]; /* Avoid run-time warning if size is 0 */ #else - unsigned int *uint_array = _alloca((size ? size : 1) * sizeof(unsigned int)); + unsigned int *uint_array = (unsigned int *) _alloca((size ? size : 1) * sizeof(unsigned int)); #endif large_uint_array(t, uint_array, size, bits); diff --git a/backend/libzint.rc b/backend/libzint.rc index be47aac4..ba08f73e 100644 --- a/backend/libzint.rc +++ b/backend/libzint.rc @@ -7,8 +7,8 @@ VS_VERSION_INFO VERSIONINFO #else VS_VERSION_INFO VERSIONINFO #endif - FILEVERSION 2,7,1,0 - PRODUCTVERSION 2,7,1,0 + FILEVERSION 2,8,1,0 + PRODUCTVERSION 2,8,1,0 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK #ifdef _DEBUG FILEFLAGS VS_FF_DEBUG @@ -25,12 +25,12 @@ BEGIN //language ID = U.S. English, char set = Windows, Multilingual BEGIN VALUE "FileDescription", "libzint barcode library\0" - VALUE "FileVersion", "2.7.1.0\0" + VALUE "FileVersion", "2.8.1.0\0" VALUE "InternalName", "zint.dll\0" - VALUE "LegalCopyright", "Copyright © 2017 Robin Stuart & BogDan Vatra\0" + VALUE "LegalCopyright", "Copyright © 2020 Robin Stuart & BogDan Vatra\0" VALUE "OriginalFilename", "zint.dll\0" VALUE "ProductName", "libzint\0" - VALUE "ProductVersion", "2.7.1.0\0" + VALUE "ProductVersion", "2.8.1.0\0" VALUE "License", "BSD License version 3\0" VALUE "WWW", "http://www.sourceforge.net/projects/zint" END diff --git a/backend/qr.c b/backend/qr.c index 9bd04bf1..40a1c324 100644 --- a/backend/qr.c +++ b/backend/qr.c @@ -240,7 +240,7 @@ static void qr_cur_cost(unsigned int state[], const unsigned int jisdata[], cons static void qr_define_mode(char mode[], const unsigned int jisdata[], const size_t length, const int gs1, const int version, const int debug) { unsigned int state[11] = { 0 /*N*/, 0 /*A*/, 0 /*B*/, 0 /*K*/, - version, gs1, + (unsigned int) version, (unsigned int) gs1, 0 /*numeric_end*/, 0 /*numeric_cost*/, 0 /*alpha_end*/, 0 /*alpha_cost*/, 0 /*alpha_pcent*/ };