Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(208)

Side by Side Diff: third_party/brotli/enc/utf8_util.h

Issue 2537133002: Update brotli to v1.0.0-snapshot. (Closed)
Patch Set: Fixed typo Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/brotli/enc/types.h ('k') | third_party/brotli/enc/utf8_util.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* Copyright 2013 Google Inc. All Rights Reserved. 1 /* Copyright 2013 Google Inc. All Rights Reserved.
2 2
3 Distributed under MIT license. 3 Distributed under MIT license.
4 See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 4 See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
5 */ 5 */
6 6
7 // Heuristics for deciding about the UTF8-ness of strings. 7 /* Heuristics for deciding about the UTF8-ness of strings. */
8 8
9 #ifndef BROTLI_ENC_UTF8_UTIL_H_ 9 #ifndef BROTLI_ENC_UTF8_UTIL_H_
10 #define BROTLI_ENC_UTF8_UTIL_H_ 10 #define BROTLI_ENC_UTF8_UTIL_H_
11 11
12 #include "./types.h" 12 #include <brotli/types.h>
13 #include "./port.h"
13 14
14 namespace brotli { 15 #if defined(__cplusplus) || defined(c_plusplus)
16 extern "C" {
17 #endif
15 18
16 static const double kMinUTF8Ratio = 0.75; 19 static const double kMinUTF8Ratio = 0.75;
17 20
18 // Returns true if at least min_fraction of the bytes between pos and 21 /* Returns 1 if at least min_fraction of the bytes between pos and
19 // pos + length in the (data, mask) ringbuffer is UTF8-encoded. 22 pos + length in the (data, mask) ring-buffer is UTF8-encoded, otherwise
20 bool IsMostlyUTF8(const uint8_t* data, const size_t pos, const size_t mask, 23 returns 0. */
21 const size_t length, const double min_fraction); 24 BROTLI_INTERNAL BROTLI_BOOL BrotliIsMostlyUTF8(
25 const uint8_t* data, const size_t pos, const size_t mask,
26 const size_t length, const double min_fraction);
22 27
23 } // namespace brotli 28 #if defined(__cplusplus) || defined(c_plusplus)
29 } /* extern "C" */
30 #endif
24 31
25 #endif // BROTLI_ENC_UTF8_UTIL_H_ 32 #endif /* BROTLI_ENC_UTF8_UTIL_H_ */
OLDNEW
« no previous file with comments | « third_party/brotli/enc/types.h ('k') | third_party/brotli/enc/utf8_util.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698