summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-12-01 16:23:16 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-12-02 08:02:28 +0100
commit06e32106cc4c0886c228b4dbfe7301222a96a231 (patch)
tree01c1a185800e40a030eff74b0f9758dd220db2bf /sc
parentfea70bfb0624e4aa57bb8e4f1c229188b061f5d2 (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 'sc')
-rw-r--r--sc/inc/lookupcache.hxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/sc/inc/lookupcache.hxx b/sc/inc/lookupcache.hxx
index 4675f0d5fc4e..9412de35ebbb 100644
--- a/sc/inc/lookupcache.hxx
+++ b/sc/inc/lookupcache.hxx
@@ -64,9 +64,9 @@ public:
double mfVal;
const OUString *mpStr;
};
- bool mbAlloc : 1;
- bool mbString : 1;
- QueryOp meOp : 2;
+ bool mbAlloc;
+ bool mbString;
+ QueryOp meOp;
void deleteString()
{
@@ -145,7 +145,7 @@ private:
{
SCROW mnRow;
SCTAB mnTab;
- QueryOp meOp : 2;
+ QueryOp meOp;
QueryKey( const ScAddress & rAddress, const QueryOp eOp ) :
mnRow( rAddress.Row()),