moc: Fix -Wsign-conversion warning in the moc generated file
authorOlivier Goffart <ogoffart@woboq.com>
Tue, 14 Jan 2014 12:38:15 +0000 (13:38 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Wed, 15 Jan 2014 07:18:11 +0000 (08:18 +0100)
commit40133df06fea67ab3983b90844cc2a8f47e6e20c
treee195a33ccb6412fb87282f79cdff847f12d3e3a0
parent1cf5cd34f70bd04dd9d1850b2fdd4a99d7ba5919
moc: Fix -Wsign-conversion warning in the moc generated file

There is the warning it fixes:

moc_foo.cpp:28:9: warning: conversion to ‘qptrdiff {aka long long int}’ from ‘long unsigned int’ may change the sign of the result [-Wsign-conversion]
         - idx * sizeof(QByteArrayData) \
         ^
qarraydata.h:282:49: note: in definition of macro ‘Q_STATIC_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET’
     { Q_REFCOUNT_INITIALIZE_STATIC, size, 0, 0, offset } \
                                                 ^
moc_foo.cpp:26:5: note: in expansion of macro ‘Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET’
     Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
     ^
moc_foo.cpp:33:1: note: in expansion of macro ‘QT_MOC_LITERAL’
 QT_MOC_LITERAL(1, 23, 5),
 ^

[ChangeLog][moc][QTBUG-36128] Fixed sign conversion warning in generated file.

Task-number: QTBUG-36128
Change-Id: Ibf00974dbfb419bb53a3109d93e4cee598bb0588
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
src/tools/moc/generator.cpp