summaryrefslogtreecommitdiffstats
path: root/src/protobuf/qprotobufpropertyordering.cpp
Commit message (Collapse)AuthorAgeFilesLines
* qtprotobuf: mark security critical source filesDennis Oberst2025-06-201-0/+1
| | | | | | | | | | | | Reviewed and marked all security critical files in the qtgrpc/src/protobuf directory. More information: https://contribute.qt-project.org/quips/23 Fixes: QTBUG-135456 Pick-to: 6.10 Change-Id: I9cc05039ca5830d04816ada978ec193ece154732 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* QProtobufPropertyOrdering: remove dead code for char_data alignment checkDennis Oberst2025-04-041-12/+20
| | | | | | | | | | | | | | Coverity rightfully complained about dead code in the char_data method, as ... % alignof(char) will never be non zero. Fix this by removing the superfluous check. As a drive-by remove unused parameters - they can be added if needed. Coverity-Id: 479414 Pick-to: 6.9 6.8 Change-Id: Ie3f2b14cbf3e18c76deae491c099ccf7ec8b7716 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Add the missing include of q20utility.hAlexey Edelev2025-03-101-0/+1
| | | | | | | | Ammends 56eee95a7cbfaaac65193b993d1db3abda47bbc9 Pick-to: 6.9 6.9.0 6.8 Change-Id: I35a4cd089a066b96d1f1ef4c10f0437092f9f4fb Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
* Fix Q_ASSERT comparison on x86 Android buildRami Potinkara2025-03-061-1/+1
| | | | | | | | | | | This patch fixes Q_ASSERT comparison between unsigned integer and integer types on Android x86 build by using C++20 compare function. Fixes: QTBUG-134439 Pick-to: 6.9 6.9.0 6.8 Change-Id: I89e9a7384aad0fe908f4dd12680d3bf4770e6915 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Replace reintepret_cast with static_cast in constructMessageByNameAlexey Edelev2024-09-171-1/+1
| | | | | | | | | We may cast to 'QProtobufMessage *' from 'void *' using static_cast, no need to use costly reinterpret_cast here. Pick-to: 6.8 Change-Id: I311669240e82d101c07a2cb7bf2646ecdbeceeb1 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Cleanup includes in the QtProtobuf moduleAlexey Edelev2024-08-281-5/+5
| | | | | | | | | | | - Unify the include style. - Use forward declarations where applicable. - Remove unused includes. Pick-to: 6.8 Task-number: QTBUG-123626 Change-Id: I40b2d7428079145c5828c3579aa3f840c343390e Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
* Scope the QtProtobufPrivate::FieldFlag enumAlexey Edelev2024-08-031-0/+1
| | | | | | | | | | Covert the QtProtobufPrivate::FieldFlag enum to a enum class. This will ensure that enum values will not conflict in the future. Task-number: QTBUG-123626 Pick-to: 6.8 Change-Id: Ibd4d68ac4b27087e5e9e35ba6e4e28242b2cd893 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Remove 'get' prefixes of QProtobufPropertyOrdering methodsAlexey Edelev2024-08-021-6/+6
| | | | | | | | | | Follow the Qt style in getter naming. Pick-to: 6.8 Task-number: QTBUG-123626 Change-Id: I8518ee5095fbab88864013c95de23f287ea58c5a Reviewed-by: Dennis Oberst <dennis.oberst@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Move is_trivially_destructible_v<QProtobufPropertyOrdering> check to .cppAlexey Edelev2024-08-021-0/+3
| | | | | | | | | | | It can me checked once, but not at every header inclusion. Pick-to: 6.8 Task-number: QTBUG-123626 Change-Id: I0033bbf31a4a789e9fa6061795c19532fb81ad76 Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
* Privately introduce QProtobufPropertyOrderBuilderMårten Nordheim2024-06-271-0/+113
| | | | | | | | | | | | | I wanted to write a Builder class for this for some time now because protobuf technically supports dynamically retrieving new types using some URL scheme. But we never needed it, so it wasn't done. Now that we want to treat a Map entry as what it is - a message with two fields - we need to be able to set up a "property ordering" object for it. This is what the builder is for. Pick-to: 6.8 Change-Id: I3c8da6be98745c5ba270ca320b2898157a1b32e4 Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
* QProtobufPropertyOrdering: prepare to share code with BuilderMårten Nordheim2024-06-051-5/+17
| | | | | | | | | Add explicit overloads to get a non-const pointer to the data for writing, to be used by the Builder class. Pick-to: 6.8 Change-Id: Ib939ef70d91a83898cacb3ddc4ac381fbf46cbc8 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* QProtobufPropertyOrdering: check index before indexingMårten Nordheim2024-06-041-0/+8
| | | | | | | | | | | | | It's not a problem in our current code, we don't have any code that is calculating anything out-of-bounds, but for testing the Builder in an upcoming patch it's easier to have this check in place. The Builder patch will also serve as a general test for the layout of the Ordering class. Pick-to: 6.8 Change-Id: I9a12397a15d3e5c48e95144b385c0e148c8e8046 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* PropertyOrdering: return field flags as the QFlags typeMårten Nordheim2024-06-021-2/+2
| | | | | | | | QFlags is a nice convenience type, and it makes it more consistent with our generated code, which already uses it. Change-Id: Ic588eec4c427c6dc148e3d068b770c8665f944a6 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Move QProtobufPropertyOrdering to a separate unitAlexey Edelev2024-01-301-0/+197
Move QProtobufPropertyOrdering to a separate source/header files. Task-number: QTBUG-120931 Change-Id: I2e44ab5ed1af73821ccd63711585ce3ca9893785 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>