From 3a66f25c648c798d472f0de3b40c36a64fe75252 Mon Sep 17 00:00:00 2001 From: B Stack Date: Fri, 12 Apr 2019 08:05:57 -0400 Subject: 10.11 --- wx+/focus.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'wx+') diff --git a/wx+/focus.h b/wx+/focus.h index e2daef79..4ba5f3f5 100644 --- a/wx+/focus.h +++ b/wx+/focus.h @@ -54,7 +54,7 @@ struct FocusPreserver { //wxTopLevelWindow::IsActive() does NOT call Win32 ::GetActiveWindow()! //Instead it checks if ::GetFocus() is set somewhere inside the top level - //Note: Both Win32 active and focus windows are *thread-local* values, while foreground window is global! https://blogs.msdn.microsoft.com/oldnewthing/20131016-00/?p=2913 + //Note: Both Win32 active and focus windows are *thread-local* values, while foreground window is global! https://devblogs.microsoft.com/oldnewthing/20131016-00/?p=2913 if (oldFocusId_ != wxID_ANY) if (wxWindow* oldFocusWin = wxWindow::FindWindowById(oldFocusId_)) -- cgit From 6394794a2d79cc0e18e37303d751f9e46042719b Mon Sep 17 00:00:00 2001 From: Daniel Wilhelm Date: Mon, 15 Apr 2019 02:13:48 +0200 Subject: remove files deleted in upstream --- wx+/zlib_wrap.cpp | 53 ------------------------- wx+/zlib_wrap.h | 114 ------------------------------------------------------ 2 files changed, 167 deletions(-) delete mode 100755 wx+/zlib_wrap.cpp delete mode 100755 wx+/zlib_wrap.h (limited to 'wx+') diff --git a/wx+/zlib_wrap.cpp b/wx+/zlib_wrap.cpp deleted file mode 100755 index fbbe2f09..00000000 --- a/wx+/zlib_wrap.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// ***************************************************************************** -// * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: https://www.gnu.org/licenses/gpl-3.0 * -// * Copyright (C) Zenju (zenju AT freefilesync DOT org) - All Rights Reserved * -// ***************************************************************************** - -#include "zlib_wrap.h" -//Windows: use the SAME zlib version that wxWidgets is linking against! //C:\Data\Projects\wxWidgets\Source\src\zlib\zlib.h -//Linux/macOS: use zlib system header for both wxWidgets and Curl (zlib is required for HTTP) -// => don't compile wxWidgets with: --with-zlib=builtin -#include - -using namespace zen; - - -size_t zen::impl::zlib_compressBound(size_t len) -{ - return ::compressBound(static_cast(len)); //upper limit for buffer size, larger than input size!!! -} - - -size_t zen::impl::zlib_compress(const void* src, size_t srcLen, void* trg, size_t trgLen, int level) //throw ZlibInternalError -{ - uLongf bufferSize = static_cast(trgLen); - const int rv = ::compress2(static_cast(trg), //Bytef* dest, - &bufferSize, //uLongf* destLen, - static_cast(src), //const Bytef* source, - static_cast(srcLen), //uLong sourceLen, - level); //int level - // Z_OK: success - // Z_MEM_ERROR: not enough memory - // Z_BUF_ERROR: not enough room in the output buffer - if (rv != Z_OK || bufferSize > trgLen) - throw ZlibInternalError(); - return bufferSize; -} - - -size_t zen::impl::zlib_decompress(const void* src, size_t srcLen, void* trg, size_t trgLen) //throw ZlibInternalError -{ - uLongf bufferSize = static_cast(trgLen); - const int rv = ::uncompress(static_cast(trg), //Bytef* dest, - &bufferSize, //uLongf* destLen, - static_cast(src), //const Bytef* source, - static_cast(srcLen)); //uLong sourceLen - // Z_OK: success - // Z_MEM_ERROR: not enough memory - // Z_BUF_ERROR: not enough room in the output buffer - // Z_DATA_ERROR: input data was corrupted or incomplete - if (rv != Z_OK || bufferSize > trgLen) - throw ZlibInternalError(); - return bufferSize; -} diff --git a/wx+/zlib_wrap.h b/wx+/zlib_wrap.h deleted file mode 100755 index d3bb017b..00000000 --- a/wx+/zlib_wrap.h +++ /dev/null @@ -1,114 +0,0 @@ -// ***************************************************************************** -// * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: https://www.gnu.org/licenses/gpl-3.0 * -// * Copyright (C) Zenju (zenju AT freefilesync DOT org) - All Rights Reserved * -// ***************************************************************************** - -#ifndef ZLIB_WRAP_H_428597064566 -#define ZLIB_WRAP_H_428597064566 - -#include - - -namespace zen -{ -class ZlibInternalError {}; - -// compression level must be between 0 and 9: -// 0: no compression -// 9: best compression -template //as specified in serialize.h -BinContainer compress(const BinContainer& stream, int level); //throw ZlibInternalError -//caveat: output stream is physically larger than input! => strip additional reserved space if needed: "BinContainer(output.begin(), output.end())" - -template -BinContainer decompress(const BinContainer& stream); //throw ZlibInternalError - - - - - - - - - - - -//######################## implementation ########################## -namespace impl -{ -size_t zlib_compressBound(size_t len); -size_t zlib_compress (const void* src, size_t srcLen, void* trg, size_t trgLen, int level); //throw ZlibInternalError -size_t zlib_decompress(const void* src, size_t srcLen, void* trg, size_t trgLen); //throw ZlibInternalError -} - - -template -BinContainer compress(const BinContainer& stream, int level) //throw ZlibInternalError -{ - BinContainer contOut; - if (!stream.empty()) //don't dereference iterator into empty container! - { - //save uncompressed stream size for decompression - const uint64_t uncompressedSize = stream.size(); //use portable number type! - contOut.resize(sizeof(uncompressedSize)); - std::copy(reinterpret_cast(&uncompressedSize), - reinterpret_cast(&uncompressedSize) + sizeof(uncompressedSize), - &*contOut.begin()); - - const size_t bufferEstimate = impl::zlib_compressBound(stream.size()); //upper limit for buffer size, larger than input size!!! - - contOut.resize(contOut.size() + bufferEstimate); - - const size_t bytesWritten = impl::zlib_compress(&*stream.begin(), - stream.size(), - &*contOut.begin() + contOut.size() - bufferEstimate, - bufferEstimate, - level); //throw ZlibInternalError - if (bytesWritten < bufferEstimate) - contOut.resize(contOut.size() - (bufferEstimate - bytesWritten)); //caveat: unsigned arithmetics - //caveat: physical memory consumption still *unchanged*! - } - return contOut; -} - - -template -BinContainer decompress(const BinContainer& stream) //throw ZlibInternalError -{ - BinContainer contOut; - if (!stream.empty()) //don't dereference iterator into empty container! - { - //retrieve size of uncompressed data - uint64_t uncompressedSize = 0; //use portable number type! - if (stream.size() < sizeof(uncompressedSize)) - throw ZlibInternalError(); - std::copy(&*stream.begin(), - &*stream.begin() + sizeof(uncompressedSize), - reinterpret_cast(&uncompressedSize)); - //attention: contOut MUST NOT be empty! Else it will pass a nullptr to zlib_decompress() => Z_STREAM_ERROR although "uncompressedSize == 0"!!! - //secondary bug: don't dereference iterator into empty container! - if (uncompressedSize == 0) //cannot be 0: compress() directly maps empty -> empty container skipping zlib! - throw ZlibInternalError(); - - try - { - contOut.resize(static_cast(uncompressedSize)); //throw std::bad_alloc - } - catch (std::bad_alloc&) //most likely due to data corruption! - { - throw ZlibInternalError(); - } - - const size_t bytesWritten = impl::zlib_decompress(&*stream.begin() + sizeof(uncompressedSize), - stream.size() - sizeof(uncompressedSize), - &*contOut.begin(), - static_cast(uncompressedSize)); //throw ZlibInternalError - if (bytesWritten != static_cast(uncompressedSize)) - throw ZlibInternalError(); - } - return contOut; -} -} - -#endif //ZLIB_WRAP_H_428597064566 -- cgit