From: Yann Collet Date: Fri, 5 Feb 2016 01:33:10 +0000 (+0100) Subject: changed enum type name to `ZSTD_ErrorCode` X-Git-Tag: v0.5.0~1^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=982ffc773d40c29d4a9b20c70e8d720bdd306837;p=thirdparty%2Fzstd.git changed enum type name to `ZSTD_ErrorCode` --- diff --git a/lib/error_private.h b/lib/error_private.h index 0e768643f..c0c3f4900 100644 --- a/lib/error_private.h +++ b/lib/error_private.h @@ -64,7 +64,7 @@ extern "C" { /*-**************************************** * Customization ******************************************/ -typedef ZSTD_errorCode ERR_enum; +typedef ZSTD_ErrorCode ERR_enum; #define PREFIX(name) ZSTD_error_##name diff --git a/lib/error_public.h b/lib/error_public.h index 8102f9dfa..655e28e0c 100644 --- a/lib/error_public.h +++ b/lib/error_public.h @@ -58,7 +58,7 @@ typedef enum { ZSTD_error_maxSymbolValue_tooSmall, ZSTD_error_dictionary_corrupted, ZSTD_error_maxCode -} ZSTD_errorCode; +} ZSTD_ErrorCode; /* note : functions provide error codes in reverse negative order, so compare with (size_t)(0-enum) */ diff --git a/lib/zstd.h b/lib/zstd.h index 837451ca2..ce56c6351 100644 --- a/lib/zstd.h +++ b/lib/zstd.h @@ -102,9 +102,9 @@ ZSTDLIB_API const char* ZSTD_getErrorName(size_t code); /*!< provides readab * Explicit memory management ***************************************/ /** Compression context */ -typedef struct ZSTD_CCtx_s ZSTD_CCtx; /* incomplete type */ +typedef struct ZSTD_CCtx_s ZSTD_CCtx; /*< incomplete type */ ZSTDLIB_API ZSTD_CCtx* ZSTD_createCCtx(void); -ZSTDLIB_API size_t ZSTD_freeCCtx(ZSTD_CCtx* cctx); +ZSTDLIB_API size_t ZSTD_freeCCtx(ZSTD_CCtx* cctx); /*!< @return : errorCode */ /** ZSTD_compressCCtx() : Same as ZSTD_compress(), but requires an already allocated ZSTD_CCtx (see ZSTD_createCCtx()) */ @@ -113,7 +113,7 @@ ZSTDLIB_API size_t ZSTD_compressCCtx(ZSTD_CCtx* ctx, void* dst, size_t dstCapaci /** Decompression context */ typedef struct ZSTD_DCtx_s ZSTD_DCtx; ZSTDLIB_API ZSTD_DCtx* ZSTD_createDCtx(void); -ZSTDLIB_API size_t ZSTD_freeDCtx(ZSTD_DCtx* dctx); +ZSTDLIB_API size_t ZSTD_freeDCtx(ZSTD_DCtx* dctx); /*!< @return : errorCode */ /** ZSTD_decompressDCtx() : * Same as ZSTD_decompress(), but requires an already allocated ZSTD_DCtx (see ZSTD_createDCtx()) */ diff --git a/lib/zstd_compress.c b/lib/zstd_compress.c index 47b55cfff..c774891b6 100644 --- a/lib/zstd_compress.c +++ b/lib/zstd_compress.c @@ -140,7 +140,7 @@ size_t ZSTD_freeCCtx(ZSTD_CCtx* cctx) { free(cctx->workSpace); free(cctx); - return 0; + return 0; /* reserved as a potential error code in the future */ } @@ -885,7 +885,6 @@ static size_t ZSTD_count_2segments(const BYTE* ip, const BYTE* match, const BYTE } - /*-************************************* * Hashes ***************************************/ diff --git a/lib/zstd_decompress.c b/lib/zstd_decompress.c index 1e8aa4c0c..529f1b6f2 100644 --- a/lib/zstd_decompress.c +++ b/lib/zstd_decompress.c @@ -111,7 +111,7 @@ unsigned ZSTD_isError(size_t code) { return ERR_isError(code); } /*! ZSTD_getError() : * convert a `size_t` function result into a proper ZSTD_errorCode enum */ -ZSTD_errorCode ZSTD_getError(size_t code) { return ERR_getError(code); } +ZSTD_ErrorCode ZSTD_getError(size_t code) { return ERR_getError(code); } /*! ZSTD_getErrorName() : * provides error code string (useful for debugging) */ @@ -173,7 +173,7 @@ ZSTD_DCtx* ZSTD_createDCtx(void) size_t ZSTD_freeDCtx(ZSTD_DCtx* dctx) { free(dctx); - return 0; + return 0; /* reserved as a potential error code in the future */ } void ZSTD_copyDCtx(ZSTD_DCtx* dstDCtx, const ZSTD_DCtx* srcDCtx) diff --git a/lib/zstd_static.h b/lib/zstd_static.h index ad81e25ca..7ceed8fe1 100644 --- a/lib/zstd_static.h +++ b/lib/zstd_static.h @@ -231,7 +231,7 @@ size_t ZSTD_decompressBlock(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, cons /*! ZSTD_getErrorCode() : convert a `size_t` function result into a `ZSTD_error_code` enum type, which can be used to compare directly with enum list within "error_public.h" */ -ZSTD_errorCode ZSTD_getError(size_t code); +ZSTD_ErrorCode ZSTD_getError(size_t code); #if defined (__cplusplus)