office-gobmx/external/libwps/enumarith.patch
Stephan Bergmann 053c549fdd external/libwps: operation between different enumeration types
> MSWrite.cpp:1424:63: error: invalid arithmetic between different enumeration types ('MSWriteParserInternal::BitmapFileHeaderOffset' and 'MSWriteParserInternal::BitmapInfoHeaderV2Offset')
>  1424 |         unsigned offset = MSWriteParserInternal::BM_FILE_STRUCT_SIZE + MSWriteParserInternal::BM_INFO_V2_STRUCT_SIZE + colors * unsigned(sizeof(MSWriteParserInternal::BitmapPalette));
>       |                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

etc. as reported now with --with-latest-c++ (i.e., in C++26 mode) by Clang 18
trunk since
<1cbd52f791>
"[Clang] Implement P2864R2 Remove Deprecated Arithmetic Conversion on
Enumerations (#73105)"

Change-Id: I6307978bc39e0f965144e0df3ac9a28eb817fe10
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160552
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2023-12-11 07:59:09 +01:00

20 lines
1,009 B
Diff

--- src/lib/MSWrite.cpp
+++ src/lib/MSWrite.cpp
@@ -1421,7 +1421,7 @@
break;
}
- unsigned offset = MSWriteParserInternal::BM_FILE_STRUCT_SIZE + MSWriteParserInternal::BM_INFO_V2_STRUCT_SIZE + colors * unsigned(sizeof(MSWriteParserInternal::BitmapPalette));
+ unsigned offset = +MSWriteParserInternal::BM_FILE_STRUCT_SIZE + MSWriteParserInternal::BM_INFO_V2_STRUCT_SIZE + colors * unsigned(sizeof(MSWriteParserInternal::BitmapPalette));
// File header
bmpdata.append('B');
@@ -1513,7 +1513,7 @@
bmpdata.append('M');
MSWriteParserInternal::appendU32(bmpdata, size + MSWriteParserInternal::BM_FILE_STRUCT_SIZE);
MSWriteParserInternal::appendU32(bmpdata, 0);
- MSWriteParserInternal::appendU32(bmpdata, MSWriteParserInternal::BM_FILE_STRUCT_SIZE + MSWriteParserInternal::BM_INFO_V3_STRUCT_SIZE + 4 * colors);
+ MSWriteParserInternal::appendU32(bmpdata, +MSWriteParserInternal::BM_FILE_STRUCT_SIZE + MSWriteParserInternal::BM_INFO_V3_STRUCT_SIZE + 4 * colors);
bmpdata.append(data, size);