diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2022-06-21 10:40:20 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2022-06-22 13:03:17 -0700 |
commit | 9959cf60d360a43c87c77f44a7d17e2fae25a303 (patch) | |
tree | bbfdd08b358b777849c7d2d7c01ca27fffc2effb /src/tools/moc | |
parent | dda9c9e2bc4fd2efe9e3fb0e451a8c3512f9a4d2 (diff) |
moc: replace offsetof with sizeof
It's the same thing since we have exactly one field in this structure
before stringdata0. But there's a far smaller chance of producing a
warning in user code.
Pick-to: 6.2 6.3 6.4
Change-Id: Id0fb9ab0089845ee8843fffd16f9cdceec33017d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/tools/moc')
-rw-r--r-- | src/tools/moc/generator.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp index b0a3ff37a4..b80e013ba4 100644 --- a/src/tools/moc/generator.cpp +++ b/src/tools/moc/generator.cpp @@ -254,7 +254,7 @@ void Generator::generateCode() // Macro that simplifies the string data listing. The offset is calculated // from the top of the stringdata object (i.e., past the uints). fprintf(out, "#define QT_MOC_LITERAL(ofs, len) \\\n" - " uint(offsetof(qt_meta_stringdata_%s_t, stringdata0) + ofs), len \n", + " uint(sizeof(qt_meta_stringdata_%s_t::offsetsAndSizes) + ofs), len \n", qualifiedClassNameIdentifier.constData()); fprintf(out, "static const qt_meta_stringdata_%s_t qt_meta_stringdata_%s = {\n", |