diff options
author | Daniel Wilhelm <shieldwed@outlook.com> | 2017-04-20 16:55:28 -0600 |
---|---|---|
committer | Daniel Wilhelm <shieldwed@outlook.com> | 2017-04-20 16:59:56 -0600 |
commit | 823740e1ffa2b3bd39f8dea8062f5c5a0d9c741b (patch) | |
tree | 63222010af3b90a36f29c1c9c360116973cdff38 /wx+/zlib_wrap.cpp | |
parent | add .gitattributes for less line ending hassles (diff) | |
download | FreeFileSync-823740e1ffa2b3bd39f8dea8062f5c5a0d9c741b.tar.gz FreeFileSync-823740e1ffa2b3bd39f8dea8062f5c5a0d9c741b.tar.bz2 FreeFileSync-823740e1ffa2b3bd39f8dea8062f5c5a0d9c741b.zip |
normalize most lineendings
Diffstat (limited to 'wx+/zlib_wrap.cpp')
-rwxr-xr-x | wx+/zlib_wrap.cpp | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/wx+/zlib_wrap.cpp b/wx+/zlib_wrap.cpp index 8b2e2976..32ed65e1 100755 --- a/wx+/zlib_wrap.cpp +++ b/wx+/zlib_wrap.cpp @@ -1,50 +1,50 @@ -// *****************************************************************************
-// * This file is part of the FreeFileSync project. It is distributed under *
-// * GNU General Public License: http://www.gnu.org/licenses/gpl-3.0 *
-// * Copyright (C) Zenju (zenju AT freefilesync DOT org) - All Rights Reserved *
-// *****************************************************************************
-
-#include "zlib_wrap.h"
- #include <zlib.h> //let's pray this is the same version wxWidgets is linking against!
-
-using namespace zen;
-
-
-size_t zen::impl::zlib_compressBound(size_t len)
-{
- return ::compressBound(static_cast<uLong>(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<uLong>(trgLen);
- const int rv = ::compress2(static_cast<Bytef*>(trg), //Bytef* dest,
- &bufferSize, //uLongf* destLen,
- static_cast<const Bytef*>(src), //const Bytef* source,
- static_cast<uLong>(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<uLong>(trgLen);
- const int rv = ::uncompress(static_cast<Bytef*>(trg), //Bytef* dest,
- &bufferSize, //uLongf* destLen,
- static_cast<const Bytef*>(src), //const Bytef* source,
- static_cast<uLong>(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;
-}
+// ***************************************************************************** +// * This file is part of the FreeFileSync project. It is distributed under * +// * GNU General Public License: http://www.gnu.org/licenses/gpl-3.0 * +// * Copyright (C) Zenju (zenju AT freefilesync DOT org) - All Rights Reserved * +// ***************************************************************************** + +#include "zlib_wrap.h" + #include <zlib.h> //let's pray this is the same version wxWidgets is linking against! + +using namespace zen; + + +size_t zen::impl::zlib_compressBound(size_t len) +{ + return ::compressBound(static_cast<uLong>(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<uLong>(trgLen); + const int rv = ::compress2(static_cast<Bytef*>(trg), //Bytef* dest, + &bufferSize, //uLongf* destLen, + static_cast<const Bytef*>(src), //const Bytef* source, + static_cast<uLong>(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<uLong>(trgLen); + const int rv = ::uncompress(static_cast<Bytef*>(trg), //Bytef* dest, + &bufferSize, //uLongf* destLen, + static_cast<const Bytef*>(src), //const Bytef* source, + static_cast<uLong>(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; +} |