Mercurial > public > mercurial-scm > hg
comparison contrib/python-zstandard/zstd/common/error_private.c @ 42070:675775c33ab6
zstandard: vendor python-zstandard 0.11
The upstream source distribution from PyPI was extracted. Unwanted
files were removed.
The clang-format ignore list was updated to reflect the new source
of files.
The project contains a vendored copy of zstandard 1.3.8. The old
version was 1.3.6. This should result in some minor performance wins.
test-check-py3-compat.t was updated to reflect now-passing tests on
Python 3.8.
Some HTTP tests were updated to reflect new zstd compression output.
# no-check-commit because 3rd party code has different style guidelines
Differential Revision: https://phab.mercurial-scm.org/D6199
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Thu, 04 Apr 2019 17:34:43 -0700 |
parents | b1fb341d8a61 |
children |
comparison
equal
deleted
inserted
replaced
42069:668eff08387f | 42070:675775c33ab6 |
---|---|
12 | 12 |
13 #include "error_private.h" | 13 #include "error_private.h" |
14 | 14 |
15 const char* ERR_getErrorString(ERR_enum code) | 15 const char* ERR_getErrorString(ERR_enum code) |
16 { | 16 { |
17 #ifdef ZSTD_STRIP_ERROR_STRINGS | |
18 (void)code; | |
19 return "Error strings stripped"; | |
20 #else | |
17 static const char* const notErrorCode = "Unspecified error code"; | 21 static const char* const notErrorCode = "Unspecified error code"; |
18 switch( code ) | 22 switch( code ) |
19 { | 23 { |
20 case PREFIX(no_error): return "No error detected"; | 24 case PREFIX(no_error): return "No error detected"; |
21 case PREFIX(GENERIC): return "Error (generic)"; | 25 case PREFIX(GENERIC): return "Error (generic)"; |
37 case PREFIX(dictionary_corrupted): return "Dictionary is corrupted"; | 41 case PREFIX(dictionary_corrupted): return "Dictionary is corrupted"; |
38 case PREFIX(dictionary_wrong): return "Dictionary mismatch"; | 42 case PREFIX(dictionary_wrong): return "Dictionary mismatch"; |
39 case PREFIX(dictionaryCreation_failed): return "Cannot create Dictionary from provided samples"; | 43 case PREFIX(dictionaryCreation_failed): return "Cannot create Dictionary from provided samples"; |
40 case PREFIX(dstSize_tooSmall): return "Destination buffer is too small"; | 44 case PREFIX(dstSize_tooSmall): return "Destination buffer is too small"; |
41 case PREFIX(srcSize_wrong): return "Src size is incorrect"; | 45 case PREFIX(srcSize_wrong): return "Src size is incorrect"; |
46 case PREFIX(dstBuffer_null): return "Operation on NULL destination buffer"; | |
42 /* following error codes are not stable and may be removed or changed in a future version */ | 47 /* following error codes are not stable and may be removed or changed in a future version */ |
43 case PREFIX(frameIndex_tooLarge): return "Frame index is too large"; | 48 case PREFIX(frameIndex_tooLarge): return "Frame index is too large"; |
44 case PREFIX(seekableIO): return "An I/O error occurred when reading/seeking"; | 49 case PREFIX(seekableIO): return "An I/O error occurred when reading/seeking"; |
45 case PREFIX(maxCode): | 50 case PREFIX(maxCode): |
46 default: return notErrorCode; | 51 default: return notErrorCode; |
47 } | 52 } |
53 #endif | |
48 } | 54 } |