]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
changed enum type name to `ZSTD_ErrorCode`
authorYann Collet <yann.collet.73@gmail.com>
Fri, 5 Feb 2016 01:33:10 +0000 (02:33 +0100)
committerYann Collet <yann.collet.73@gmail.com>
Fri, 5 Feb 2016 01:33:10 +0000 (02:33 +0100)
lib/error_private.h
lib/error_public.h
lib/zstd.h
lib/zstd_compress.c
lib/zstd_decompress.c
lib/zstd_static.h

index 0e768643f9a694e57244989ac0e22d54b34527b3..c0c3f49001f5998a6be413017848f85344702fed 100644 (file)
@@ -64,7 +64,7 @@ extern "C" {
 /*-****************************************
 *  Customization
 ******************************************/
-typedef ZSTD_errorCode ERR_enum;
+typedef ZSTD_ErrorCode ERR_enum;
 #define PREFIX(name) ZSTD_error_##name
 
 
index 8102f9dfa81c0ecd1183b12e6fdc0006b8cecc08..655e28e0c982b38ab66d13fea356f2564950a805 100644 (file)
@@ -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) */
index 837451ca2ec5f6855907d3040435f09102dcaaf2..ce56c6351571f14780f7e4f140f43a9242c24838 100644 (file)
@@ -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()) */
index 47b55cfff2f2383fc803f0853178c2d0838cd493..c774891b627a416e34b1faff4ba6ae6c7660df5f 100644 (file)
@@ -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
 ***************************************/
index 1e8aa4c0c8e79fbbb0556173665997217702f32b..529f1b6f21aa156052e4150d43c17b1f9f5e5926 100644 (file)
@@ -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)
index ad81e25ca2ec9a64896d05f40b66e95735120da5..7ceed8fe1a7f50bd18fc20387c32b975a95315db 100644 (file)
@@ -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)