Chromium Code Reviews| Index: src/utils.h |
| diff --git a/src/utils.h b/src/utils.h |
| index 1c9e3a682446beed63760035f1c9673f35bc96ae..5c7afbec20e494808c7531789e0818638bdf9954 100644 |
| --- a/src/utils.h |
| +++ b/src/utils.h |
| @@ -208,7 +208,7 @@ class BitFieldBase { |
| static const U kNext = kShift + kSize; |
| // Value for the field with all bits set. |
| - static const T kMax = static_cast<T>((1U << size) - 1); |
| + static const T kMax = static_cast<T>((kOne << size) - 1); |
|
Benedikt Meurer
2015/02/23 18:33:49
The looks a lot like undefined behavior for signed
dcarney
2015/02/23 18:56:08
this doesn't change the current behaviour, just ma
|
| // Tells whether the provided value fits into the bit field. |
| static bool is_valid(T value) { |