From 2e3b659ae1c051531c3e90a4e9d795b5701f1826 Mon Sep 17 00:00:00 2001 From: cyan4973 Date: Fri, 20 Jan 2017 14:00:41 -0800 Subject: [PATCH] fixed minor warnings (Visual, conversion, doxygen) --- lib/common/pool.c | 12 ++++++++++-- lib/compress/zstdmt_compress.c | 12 ++++++++++-- lib/compress/zstdmt_compress.h | 8 ++++++++ 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/lib/common/pool.c b/lib/common/pool.c index f40ed39d4..693217f24 100644 --- a/lib/common/pool.c +++ b/lib/common/pool.c @@ -7,13 +7,21 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -#include "pool.h" + +/* ====== Dependencies ======= */ #include /* size_t */ #include /* malloc, calloc, free */ +#include "pool.h" + +/* ====== Compiler specifics ====== */ +#if defined(_MSC_VER) +# pragma warning(disable : 4204) /* disable: C4204: non-constant aggregate initializer */ +#endif + #ifdef ZSTD_MULTITHREAD -#include +#include /* pthread adaptation */ /* A job is a function and an opaque argument */ typedef struct POOL_job_s { diff --git a/lib/compress/zstdmt_compress.c b/lib/compress/zstdmt_compress.c index 3674281a4..48717de20 100644 --- a/lib/compress/zstdmt_compress.c +++ b/lib/compress/zstdmt_compress.c @@ -1,8 +1,16 @@ +/** + * Copyright (c) 2016-present, Yann Collet, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ /* ====== Tuning parameters ====== */ #ifndef ZSTDMT_SECTION_LOGSIZE_MIN -# define ZSTDMT_SECTION_LOGSIZE_MIN 20 /*< minimum size for a full compression job (20==2^20==1 MB) */ +# define ZSTDMT_SECTION_LOGSIZE_MIN 20 /* minimum size for a full compression job (20==2^20==1 MB) */ #endif @@ -444,7 +452,7 @@ size_t ZSTDMT_initCStream_advanced(ZSTDMT_CCtx* zcs, const void* dict, size_t di zcs->dictSize = dictSize; zcs->frameContentSize = pledgedSrcSize; zcs->targetSectionSize = (size_t)1 << MAX(ZSTDMT_SECTION_LOGSIZE_MIN, (zcs->params.cParams.windowLog + 2)); - zcs->inBuffSize = zcs->targetSectionSize + (1 << zcs->params.cParams.windowLog); + zcs->inBuffSize = zcs->targetSectionSize + ((size_t)1 << zcs->params.cParams.windowLog); zcs->inBuff.buffer = ZSTDMT_getBuffer(zcs->buffPool, zcs->inBuffSize); if (zcs->inBuff.buffer.start == NULL) return ERROR(memory_allocation); zcs->inBuff.filled = 0; diff --git a/lib/compress/zstdmt_compress.h b/lib/compress/zstdmt_compress.h index 759906db1..7d336db06 100644 --- a/lib/compress/zstdmt_compress.h +++ b/lib/compress/zstdmt_compress.h @@ -1,3 +1,11 @@ +/** + * Copyright (c) 2016-present, Yann Collet, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ /* === Dependencies === */ #include /* size_t */