aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/zstd/lib/common/zstd_common.c
diff options
context:
space:
mode:
authorRuslan Kovalev <ruslan.a.kovalev@gmail.com>2022-02-10 16:46:44 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:44 +0300
commit59e19371de37995fcb36beb16cd6ec030af960bc (patch)
treefa68e36093ebff8b805462e9e6d331fe9d348214 /contrib/libs/zstd/lib/common/zstd_common.c
parent89db6fe2fe2c32d2a832ddfeb04e8d078e301084 (diff)
downloadydb-59e19371de37995fcb36beb16cd6ec030af960bc.tar.gz
Restoring authorship annotation for Ruslan Kovalev <ruslan.a.kovalev@gmail.com>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/zstd/lib/common/zstd_common.c')
-rw-r--r--contrib/libs/zstd/lib/common/zstd_common.c70
1 files changed, 35 insertions, 35 deletions
diff --git a/contrib/libs/zstd/lib/common/zstd_common.c b/contrib/libs/zstd/lib/common/zstd_common.c
index 3d7e35b309..ff9502fcf6 100644
--- a/contrib/libs/zstd/lib/common/zstd_common.c
+++ b/contrib/libs/zstd/lib/common/zstd_common.c
@@ -7,61 +7,61 @@
* in the COPYING file in the root directory of this source tree).
* You may select, at your option, one of the above-listed licenses.
*/
-
-
-
-/*-*************************************
-* Dependencies
-***************************************/
+
+
+
+/*-*************************************
+* Dependencies
+***************************************/
#define ZSTD_DEPS_NEED_MALLOC
#include "zstd_deps.h" /* ZSTD_malloc, ZSTD_calloc, ZSTD_free, ZSTD_memset */
-#include "error_private.h"
+#include "error_private.h"
#include "zstd_internal.h"
-
-
-/*-****************************************
-* Version
-******************************************/
+
+
+/*-****************************************
+* Version
+******************************************/
unsigned ZSTD_versionNumber(void) { return ZSTD_VERSION_NUMBER; }
-
+
const char* ZSTD_versionString(void) { return ZSTD_VERSION_STRING; }
+
-
-/*-****************************************
-* ZSTD Error Management
-******************************************/
+/*-****************************************
+* ZSTD Error Management
+******************************************/
#undef ZSTD_isError /* defined within zstd_internal.h */
-/*! ZSTD_isError() :
+/*! ZSTD_isError() :
* tells if a return value is an error code
* symbol is required for external callers */
-unsigned ZSTD_isError(size_t code) { return ERR_isError(code); }
-
-/*! ZSTD_getErrorName() :
+unsigned ZSTD_isError(size_t code) { return ERR_isError(code); }
+
+/*! ZSTD_getErrorName() :
* provides error code string from function result (useful for debugging) */
-const char* ZSTD_getErrorName(size_t code) { return ERR_getErrorName(code); }
-
-/*! ZSTD_getError() :
+const char* ZSTD_getErrorName(size_t code) { return ERR_getErrorName(code); }
+
+/*! ZSTD_getError() :
* convert a `size_t` function result into a proper ZSTD_errorCode enum */
-ZSTD_ErrorCode ZSTD_getErrorCode(size_t code) { return ERR_getErrorCode(code); }
-
-/*! ZSTD_getErrorString() :
+ZSTD_ErrorCode ZSTD_getErrorCode(size_t code) { return ERR_getErrorCode(code); }
+
+/*! ZSTD_getErrorString() :
* provides error code string from enum */
const char* ZSTD_getErrorString(ZSTD_ErrorCode code) { return ERR_getErrorString(code); }
-
-
-
+
+
+
/*=**************************************************************
* Custom allocator
****************************************************************/
void* ZSTD_customMalloc(size_t size, ZSTD_customMem customMem)
-{
+{
if (customMem.customAlloc)
return customMem.customAlloc(customMem.opaque, size);
return ZSTD_malloc(size);
-}
-
+}
+
void* ZSTD_customCalloc(size_t size, ZSTD_customMem customMem)
-{
+{
if (customMem.customAlloc) {
/* calloc implemented as malloc+memset;
* not as efficient as calloc, but next best guess for custom malloc */
@@ -70,7 +70,7 @@ void* ZSTD_customCalloc(size_t size, ZSTD_customMem customMem)
return ptr;
}
return ZSTD_calloc(1, size);
-}
+}
void ZSTD_customFree(void* ptr, ZSTD_customMem customMem)
{