diff --git a/src/protobuf/qprotobufregistration.h b/src/protobuf/qprotobufregistration.h index 4ffad814..f779a8f3 100644 --- a/src/protobuf/qprotobufregistration.h +++ b/src/protobuf/qprotobufregistration.h @@ -132,7 +132,7 @@ static std::optional> intToEnumList(QList v) { QList enumList; for (const auto &intValue : v) - enumList.append(static_cast(intValue._t)); + enumList.append(static_cast(intValue.t)); return enumList; } diff --git a/src/protobuf/qprotobufserializer.cpp b/src/protobuf/qprotobufserializer.cpp index 8548adba..a8bf56bf 100644 --- a/src/protobuf/qprotobufserializer.cpp +++ b/src/protobuf/qprotobufserializer.cpp @@ -449,10 +449,10 @@ qsizetype QProtobufSerializerPrivate::skipSerializedFieldBytes(QProtobufSelfchec skipVarint(it); break; case QtProtobuf::WireTypes::Fixed32: - it += sizeof(decltype(QtProtobuf::fixed32::_t)); + it += sizeof(decltype(QtProtobuf::fixed32::t)); break; case QtProtobuf::WireTypes::Fixed64: - it += sizeof(decltype(QtProtobuf::fixed64::_t)); + it += sizeof(decltype(QtProtobuf::fixed64::t)); break; case QtProtobuf::WireTypes::LengthDelimited: skipLengthDelimited(it); diff --git a/src/protobuf/qtprotobuftypes.h b/src/protobuf/qtprotobuftypes.h index 20e21355..5bd1902e 100644 --- a/src/protobuf/qtprotobuftypes.h +++ b/src/protobuf/qtprotobuftypes.h @@ -38,26 +38,26 @@ Q_ENUM_NS(WireTypes) template struct TransparentWrapper { - TransparentWrapper(T t = T()) : _t(t) { } - T _t; - operator T &() { return _t; } - operator T() const { return _t; } - TransparentWrapper &operator=(T t) + TransparentWrapper(T t_ = T()) : t(t_) { } + T t; + operator T &() { return t; } + operator T() const { return t; } + TransparentWrapper &operator=(T t_) { - _t = t; + t = t_; return *this; } - static T toType(TransparentWrapper t) { return t._t; } - static TransparentWrapper fromType(T _t) { return TransparentWrapper(_t); } + static T toType(TransparentWrapper t) { return t.t; } + static TransparentWrapper fromType(T t) { return TransparentWrapper(t); } - static QString toString(TransparentWrapper t) { return QString::number(t._t); } + static QString toString(TransparentWrapper t) { return QString::number(t.t); } }; template constexpr TransparentWrapper qbswap(TransparentWrapper source) { - return { QT_PREPEND_NAMESPACE(qbswap)(source._t) }; + return { QT_PREPEND_NAMESPACE(qbswap)(source.t) }; } using int32 = TransparentWrapper; diff --git a/tests/auto/protobuf/converters/tst_protobuf_converter.cpp b/tests/auto/protobuf/converters/tst_protobuf_converter.cpp index 033f07c4..e8c64113 100644 --- a/tests/auto/protobuf/converters/tst_protobuf_converter.cpp +++ b/tests/auto/protobuf/converters/tst_protobuf_converter.cpp @@ -27,22 +27,22 @@ void QtProtobufConverterTest::testFromTypeConverters() QVariant testVariant; testVariant.setValue(42); - QCOMPARE(testVariant.value()._t, quint32(42)); + QCOMPARE(testVariant.value().t, quint32(42)); testVariant.setValue(43); - QCOMPARE(testVariant.value()._t, quint64(43)); + QCOMPARE(testVariant.value().t, quint64(43)); testVariant.setValue(44); - QCOMPARE(testVariant.value()._t, 44); + QCOMPARE(testVariant.value().t, 44); testVariant.setValue(45); - QCOMPARE(testVariant.value()._t, 45); + QCOMPARE(testVariant.value().t, 45); testVariant.setValue(46); - QCOMPARE(testVariant.value()._t, 46); + QCOMPARE(testVariant.value().t, 46); testVariant.setValue(47); - QCOMPARE(testVariant.value()._t, 47); + QCOMPARE(testVariant.value().t, 47); } void QtProtobufConverterTest::testToTypeConverters()