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

Side by Side Diff: third_party/woff2/src/port.h

Issue 1873123002: Update woff2 to 4e698b8 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: assert.h Created 4 years, 8 months 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/woff2/src/glyph.cc ('k') | third_party/woff2/src/store_bytes.h » ('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 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and 12 // See the License for the specific language governing permissions and
13 // limitations under the License. 13 // limitations under the License.
14 // 14 //
15 // Helper function for bit twiddling and macros for branch prediction. 15 // Helper function for bit twiddling and macros for branch prediction.
16 16
17 #ifndef WOFF2_PORT_H_ 17 #ifndef WOFF2_PORT_H_
18 #define WOFF2_PORT_H_ 18 #define WOFF2_PORT_H_
19 19
20 #include <assert.h>
Takashi Toyoshima 2016/04/12 07:22:22 This is a local patch.
21
20 namespace woff2 { 22 namespace woff2 {
21 23
22 typedef unsigned int uint32; 24 typedef unsigned int uint32;
23 25
24 inline int Log2Floor(uint32 n) { 26 inline int Log2Floor(uint32 n) {
25 #if defined(__GNUC__) 27 #if defined(__GNUC__)
26 return n == 0 ? -1 : 31 ^ __builtin_clz(n); 28 return n == 0 ? -1 : 31 ^ __builtin_clz(n);
27 #else 29 #else
28 if (n == 0) 30 if (n == 0)
29 return -1; 31 return -1;
(...skipping 22 matching lines...) Expand all
52 #if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ > 95) || \ 54 #if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ > 95) || \
53 (defined(__llvm__) && __has_builtin(__builtin_expect)) 55 (defined(__llvm__) && __has_builtin(__builtin_expect))
54 #define PREDICT_FALSE(x) (__builtin_expect(x, 0)) 56 #define PREDICT_FALSE(x) (__builtin_expect(x, 0))
55 #define PREDICT_TRUE(x) (__builtin_expect(!!(x), 1)) 57 #define PREDICT_TRUE(x) (__builtin_expect(!!(x), 1))
56 #else 58 #else
57 #define PREDICT_FALSE(x) (x) 59 #define PREDICT_FALSE(x) (x)
58 #define PREDICT_TRUE(x) (x) 60 #define PREDICT_TRUE(x) (x)
59 #endif 61 #endif
60 62
61 #endif // WOFF2_PORT_H_ 63 #endif // WOFF2_PORT_H_
OLDNEW
« no previous file with comments | « third_party/woff2/src/glyph.cc ('k') | third_party/woff2/src/store_bytes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698