diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-12-01 16:23:16 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-12-02 08:02:28 +0100 |
commit | 06e32106cc4c0886c228b4dbfe7301222a96a231 (patch) | |
tree | 01c1a185800e40a030eff74b0f9758dd220db2bf /fpicker | |
parent | fea70bfb0624e4aa57bb8e4f1c229188b061f5d2 (diff) |
Avoid clang-cl -Werror,-Wbitfield-constant-conversion
...when (non-negative) QueryOp enumerators LESS/GREATER_EQUAL are crammed into
a 2-bit meOp bitfield, where enums are implictly signed for MSVC, so the values
actually storable in the bitfield range from -2 to +1.
The clang-cl warning would go away when fixing the underlying type of QueryOp as
unsigned, but then GCC would start to emit "error:
‘ScLookupCache::QueryCriteria::meOp’ is too small to hold all values of ‘enum
ScLookupCache::QueryOp’ [-Werror]."
So don't bother with bitfields at all: For QueryCritera, for one there's a
union member with a double and a pointer, so sizeof (QueryCriteria) will be
twice the size of double anyway; and for another, MSVC doesn't combine bitfields
of different type, so the bool members were separated from meOp anyway. For
QueryKey the reason for a bitfield is even less clear cut, and it might only
have been there so that comparing (negative!) values read out of
QueryCritera::meOp compare equal to values read out of QueryKey::meOp under
MSVC.
Change-Id: I69fb068bea914c00a29001155218cb9f1b8f8a9a
Diffstat (limited to 'fpicker')
0 files changed, 0 insertions, 0 deletions