summaryrefslogtreecommitdiffstats
path: root/contrib/libs/zstd/lib/common/zstd_common.c
diff options
context:
space:
mode:
authorigorsolovyev <[email protected]>2022-02-10 16:48:03 +0300
committerDaniil Cherednik <[email protected]>2022-02-10 16:48:03 +0300
commit93dc653cf53bf7a9319b52b85a7c02edfd95463d (patch)
treeb85de7682b5f10d28a798003716a65756425aa15 /contrib/libs/zstd/lib/common/zstd_common.c
parent6ab7e5f5ada0643a48d393717f443bd548706ffc (diff)
Restoring authorship annotation for <[email protected]>. 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.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/contrib/libs/zstd/lib/common/zstd_common.c b/contrib/libs/zstd/lib/common/zstd_common.c
index 3d7e35b309b..ea4e288daa9 100644
--- a/contrib/libs/zstd/lib/common/zstd_common.c
+++ b/contrib/libs/zstd/lib/common/zstd_common.c
@@ -1,11 +1,11 @@
-/*
+/*
* Copyright (c) Yann Collet, Facebook, Inc.
* All rights reserved.
*
- * This source code is licensed under both the BSD-style license (found in the
- * LICENSE file in the root directory of this source tree) and the GPLv2 (found
- * in the COPYING file in the root directory of this source tree).
- * You may select, at your option, one of the above-listed licenses.
+ * This source code is licensed under both the BSD-style license (found in the
+ * LICENSE file in the root directory of this source tree) and the GPLv2 (found
+ * in the COPYING file in the root directory of this source tree).
+ * You may select, at your option, one of the above-listed licenses.
*/
@@ -16,17 +16,17 @@
#define ZSTD_DEPS_NEED_MALLOC
#include "zstd_deps.h" /* ZSTD_malloc, ZSTD_calloc, ZSTD_free, ZSTD_memset */
#include "error_private.h"
-#include "zstd_internal.h"
+#include "zstd_internal.h"
/*-****************************************
* Version
******************************************/
-unsigned ZSTD_versionNumber(void) { return ZSTD_VERSION_NUMBER; }
-
-const char* ZSTD_versionString(void) { return ZSTD_VERSION_STRING; }
+unsigned ZSTD_versionNumber(void) { return ZSTD_VERSION_NUMBER; }
+const char* ZSTD_versionString(void) { return ZSTD_VERSION_STRING; }
+
/*-****************************************
* ZSTD Error Management
******************************************/
@@ -37,16 +37,16 @@ const char* ZSTD_versionString(void) { return ZSTD_VERSION_STRING; }
unsigned ZSTD_isError(size_t code) { return ERR_isError(code); }
/*! ZSTD_getErrorName() :
- * provides error code string from function result (useful for debugging) */
+ * provides error code string from function result (useful for debugging) */
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 */
+ * 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() :
- * provides error code string from enum */
-const char* ZSTD_getErrorString(ZSTD_ErrorCode code) { return ERR_getErrorString(code); }
+ * provides error code string from enum */
+const char* ZSTD_getErrorString(ZSTD_ErrorCode code) { return ERR_getErrorString(code); }
@@ -55,29 +55,29 @@ const char* ZSTD_getErrorString(ZSTD_ErrorCode code) { return ERR_getErrorString
****************************************************************/
void* ZSTD_customMalloc(size_t size, ZSTD_customMem customMem)
{
- if (customMem.customAlloc)
- return customMem.customAlloc(customMem.opaque, size);
+ 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 */
- void* const ptr = customMem.customAlloc(customMem.opaque, size);
+ if (customMem.customAlloc) {
+ /* calloc implemented as malloc+memset;
+ * not as efficient as calloc, but next best guess for custom malloc */
+ void* const ptr = customMem.customAlloc(customMem.opaque, size);
ZSTD_memset(ptr, 0, size);
- return ptr;
- }
+ return ptr;
+ }
return ZSTD_calloc(1, size);
}
void ZSTD_customFree(void* ptr, ZSTD_customMem customMem)
{
- if (ptr!=NULL) {
- if (customMem.customFree)
- customMem.customFree(customMem.opaque, ptr);
- else
+ if (ptr!=NULL) {
+ if (customMem.customFree)
+ customMem.customFree(customMem.opaque, ptr);
+ else
ZSTD_free(ptr);
- }
+ }
}