replace 'const QChar &' with 'QChar ' where appropriate
as QChar is actually an ushort and there is no point in taking its address. Merge-request: 69 Change-Id: Idcc9d621e5627514ade006aa12a789a88929d48b Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
This commit is contained in:
parent
c8160ea1db
commit
432a756048
@ -393,7 +393,7 @@ public:
|
||||
};
|
||||
|
||||
inline bool getChar(QChar *ch);
|
||||
inline void ungetChar(const QChar &ch);
|
||||
inline void ungetChar(QChar ch);
|
||||
NumberParsingStatus getNumber(qulonglong *l);
|
||||
bool getReal(double *f);
|
||||
|
||||
@ -943,7 +943,7 @@ inline bool QTextStreamPrivate::getChar(QChar *ch)
|
||||
|
||||
/*! \internal
|
||||
*/
|
||||
inline void QTextStreamPrivate::ungetChar(const QChar &ch)
|
||||
inline void QTextStreamPrivate::ungetChar(QChar ch)
|
||||
{
|
||||
if (string) {
|
||||
if (stringOffset == 0)
|
||||
|
@ -1343,7 +1343,7 @@ QVariant::QVariant(const char *val)
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn QVariant::QVariant(const QChar &c)
|
||||
\fn QVariant::QVariant(QChar c)
|
||||
|
||||
Constructs a new variant with a char value, \a c.
|
||||
*/
|
||||
@ -1411,7 +1411,7 @@ QVariant::QVariant(const QBitArray &val)
|
||||
{ d.is_null = false; d.type = BitArray; v_construct<QBitArray>(&d, val); }
|
||||
QVariant::QVariant(const QString &val)
|
||||
{ d.is_null = false; d.type = String; v_construct<QString>(&d, val); }
|
||||
QVariant::QVariant(const QChar &val)
|
||||
QVariant::QVariant(QChar val)
|
||||
{ d.is_null = false; d.type = Char; v_construct<QChar>(&d, val); }
|
||||
QVariant::QVariant(const QLatin1String &val)
|
||||
{ QString str(val); d.is_null = false; d.type = String; v_construct<QString>(&d, str); }
|
||||
|
@ -218,7 +218,7 @@ class Q_CORE_EXPORT QVariant
|
||||
QVariant(const QString &string);
|
||||
QVariant(const QLatin1String &string);
|
||||
QVariant(const QStringList &stringlist);
|
||||
QVariant(const QChar &qchar);
|
||||
QVariant(QChar qchar);
|
||||
QVariant(const QDate &date);
|
||||
QVariant(const QTime &time);
|
||||
QVariant(const QDateTime &datetime);
|
||||
|
@ -2797,7 +2797,7 @@ bool QLocalePrivate::numberToCLocale(const QString &num,
|
||||
return false;
|
||||
|
||||
while (idx < l) {
|
||||
const QChar &in = uc[idx];
|
||||
const QChar in = uc[idx];
|
||||
|
||||
char out = digitToCLocale(in);
|
||||
if (out == 0) {
|
||||
|
@ -228,7 +228,7 @@ public:
|
||||
bool numberToCLocale(const QString &num,
|
||||
GroupSeparatorMode group_sep_mode,
|
||||
CharBuff *result) const;
|
||||
inline char digitToCLocale(const QChar &c) const;
|
||||
inline char digitToCLocale(QChar c) const;
|
||||
|
||||
static void updateSystemPrivate();
|
||||
|
||||
@ -282,7 +282,7 @@ public:
|
||||
|
||||
};
|
||||
|
||||
inline char QLocalePrivate::digitToCLocale(const QChar &in) const
|
||||
inline char QLocalePrivate::digitToCLocale(QChar in) const
|
||||
{
|
||||
const QChar _zero = zero();
|
||||
const QChar _group = group();
|
||||
|
@ -379,7 +379,7 @@ bool QXmlUtils::isNCName(const QStringRef &ncName)
|
||||
const int len = ncName.size();
|
||||
for(int i = 0; i < len; ++i)
|
||||
{
|
||||
const QChar &at = ncName.at(i);
|
||||
const QChar at = ncName.at(i);
|
||||
if(!QXmlUtils::isNameChar(at) || at == QLatin1Char(':'))
|
||||
return false;
|
||||
}
|
||||
|
@ -52,7 +52,7 @@
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
static inline bool isValidCharacterNoDash(const QChar &c)
|
||||
static inline bool isValidCharacterNoDash(QChar c)
|
||||
{
|
||||
register ushort u = c.unicode();
|
||||
return (u >= 'a' && u <= 'z')
|
||||
@ -61,7 +61,7 @@ static inline bool isValidCharacterNoDash(const QChar &c)
|
||||
|| (u == '_');
|
||||
}
|
||||
|
||||
static inline bool isValidCharacter(const QChar &c)
|
||||
static inline bool isValidCharacter(QChar c)
|
||||
{
|
||||
register ushort u = c.unicode();
|
||||
return (u >= 'a' && u <= 'z')
|
||||
@ -70,7 +70,7 @@ static inline bool isValidCharacter(const QChar &c)
|
||||
|| (u == '_') || (u == '-');
|
||||
}
|
||||
|
||||
static inline bool isValidNumber(const QChar &c)
|
||||
static inline bool isValidNumber(QChar c)
|
||||
{
|
||||
register ushort u = c.unicode();
|
||||
return (u >= '0' && u <= '9');
|
||||
|
@ -614,7 +614,7 @@ QList<QFontDatabase::WritingSystem> QRawFont::supportedWritingSystems() const
|
||||
|
||||
\sa supportedWritingSystems()
|
||||
*/
|
||||
bool QRawFont::supportsCharacter(const QChar &character) const
|
||||
bool QRawFont::supportsCharacter(QChar character) const
|
||||
{
|
||||
return d->isValid() && d->fontEngine->canRender(&character, 1);
|
||||
}
|
||||
|
@ -127,7 +127,7 @@ public:
|
||||
QFont::HintingPreference hintingPreference);
|
||||
|
||||
bool supportsCharacter(quint32 ucs4) const;
|
||||
bool supportsCharacter(const QChar &character) const;
|
||||
bool supportsCharacter(QChar character) const;
|
||||
QList<QFontDatabase::WritingSystem> supportedWritingSystems() const;
|
||||
|
||||
QByteArray fontTable(const char *tagName) const;
|
||||
|
@ -126,7 +126,7 @@ void QTextBlockData::invalidate() const
|
||||
layout->engine()->invalidate();
|
||||
}
|
||||
|
||||
static bool isValidBlockSeparator(const QChar &ch)
|
||||
static bool isValidBlockSeparator(QChar ch)
|
||||
{
|
||||
return ch == QChar::ParagraphSeparator
|
||||
|| ch == QTextBeginningOfFrame
|
||||
@ -393,7 +393,7 @@ int QTextDocumentPrivate::insert_block(int pos, uint strPos, int format, int blo
|
||||
return x;
|
||||
}
|
||||
|
||||
int QTextDocumentPrivate::insertBlock(const QChar &blockSeparator,
|
||||
int QTextDocumentPrivate::insertBlock(QChar blockSeparator,
|
||||
int pos, int blockFormat, int charFormat, QTextUndoCommand::Operation op)
|
||||
{
|
||||
Q_ASSERT(formats.format(blockFormat).isBlockFormat());
|
||||
|
@ -179,7 +179,7 @@ public:
|
||||
void insert(int pos, const QString &text, int format);
|
||||
void insert(int pos, int strPos, int strLength, int format);
|
||||
int insertBlock(int pos, int blockFormat, int charFormat, QTextUndoCommand::Operation = QTextUndoCommand::MoveCursor);
|
||||
int insertBlock(const QChar &blockSeparator, int pos, int blockFormat, int charFormat,
|
||||
int insertBlock(QChar blockSeparator, int pos, int blockFormat, int charFormat,
|
||||
QTextUndoCommand::Operation op = QTextUndoCommand::MoveCursor);
|
||||
|
||||
void move(int from, int to, int length, QTextUndoCommand::Operation = QTextUndoCommand::MoveCursor);
|
||||
|
@ -525,7 +525,7 @@ void QTextFrame::setLayoutData(QTextFrameLayoutData *data)
|
||||
|
||||
|
||||
|
||||
void QTextFramePrivate::fragmentAdded(const QChar &type, uint fragment)
|
||||
void QTextFramePrivate::fragmentAdded(QChar type, uint fragment)
|
||||
{
|
||||
if (type == QTextBeginningOfFrame) {
|
||||
Q_ASSERT(!fragment_start);
|
||||
@ -543,7 +543,7 @@ void QTextFramePrivate::fragmentAdded(const QChar &type, uint fragment)
|
||||
}
|
||||
}
|
||||
|
||||
void QTextFramePrivate::fragmentRemoved(const QChar &type, uint fragment)
|
||||
void QTextFramePrivate::fragmentRemoved(QChar type, uint fragment)
|
||||
{
|
||||
Q_UNUSED(fragment); // --release warning
|
||||
if (type == QTextBeginningOfFrame) {
|
||||
|
@ -97,8 +97,8 @@ public:
|
||||
: QTextObjectPrivate(doc), fragment_start(0), fragment_end(0), parentFrame(0), layoutData(0)
|
||||
{
|
||||
}
|
||||
virtual void fragmentAdded(const QChar &type, uint fragment);
|
||||
virtual void fragmentRemoved(const QChar &type, uint fragment);
|
||||
virtual void fragmentAdded(QChar type, uint fragment);
|
||||
virtual void fragmentRemoved(QChar type, uint fragment);
|
||||
void remove_me();
|
||||
|
||||
uint fragment_start;
|
||||
|
@ -397,7 +397,7 @@ int QTextTablePrivate::findCellIndex(int fragment) const
|
||||
return it - cells.begin();
|
||||
}
|
||||
|
||||
void QTextTablePrivate::fragmentAdded(const QChar &type, uint fragment)
|
||||
void QTextTablePrivate::fragmentAdded(QChar type, uint fragment)
|
||||
{
|
||||
dirty = true;
|
||||
if (blockFragmentUpdates)
|
||||
@ -415,7 +415,7 @@ void QTextTablePrivate::fragmentAdded(const QChar &type, uint fragment)
|
||||
QTextFramePrivate::fragmentAdded(type, fragment);
|
||||
}
|
||||
|
||||
void QTextTablePrivate::fragmentRemoved(const QChar &type, uint fragment)
|
||||
void QTextTablePrivate::fragmentRemoved(QChar type, uint fragment)
|
||||
{
|
||||
dirty = true;
|
||||
if (blockFragmentUpdates)
|
||||
|
@ -66,8 +66,8 @@ public:
|
||||
~QTextTablePrivate();
|
||||
|
||||
static QTextTable *createTable(QTextDocumentPrivate *, int pos, int rows, int cols, const QTextTableFormat &tableFormat);
|
||||
void fragmentAdded(const QChar &type, uint fragment);
|
||||
void fragmentRemoved(const QChar &type, uint fragment);
|
||||
void fragmentAdded(QChar type, uint fragment);
|
||||
void fragmentRemoved(QChar type, uint fragment);
|
||||
|
||||
void update() const;
|
||||
|
||||
|
@ -770,7 +770,7 @@ QT_BEGIN_NAMESPACE
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn char *QTest::toString(const QChar &character)
|
||||
\fn char *QTest::toString(QChar character)
|
||||
\overload
|
||||
|
||||
Returns a textual representation of the given \a character.
|
||||
|
@ -208,7 +208,7 @@ QString Driver::qtify(const QString &name)
|
||||
return qname;
|
||||
}
|
||||
|
||||
static bool isAnsiCCharacter(const QChar& c)
|
||||
static bool isAnsiCCharacter(QChar c)
|
||||
{
|
||||
return (c.toUpper() >= QLatin1Char('A') && c.toUpper() <= QLatin1Char('Z'))
|
||||
|| c.isDigit() || c == QLatin1Char('_');
|
||||
|
@ -1157,8 +1157,8 @@ QVariant QDoubleSpinBoxPrivate::validateAndInterpret(QString &input, int &pos,
|
||||
}
|
||||
}
|
||||
} else {
|
||||
const QChar &last = copy.at(len - 1);
|
||||
const QChar &secondLast = copy.at(len - 2);
|
||||
const QChar last = copy.at(len - 1);
|
||||
const QChar secondLast = copy.at(len - 2);
|
||||
if ((last == locale.groupSeparator() || last.isSpace())
|
||||
&& (secondLast == locale.groupSeparator() || secondLast.isSpace())) {
|
||||
state = QValidator::Invalid;
|
||||
|
@ -313,7 +313,7 @@ public:
|
||||
}
|
||||
|
||||
QChar passwordCharacter() const { return m_passwordCharacter; }
|
||||
void setPasswordCharacter(const QChar &character) { m_passwordCharacter = character; updateDisplayText(); }
|
||||
void setPasswordCharacter(QChar character) { m_passwordCharacter = character; updateDisplayText(); }
|
||||
|
||||
Qt::LayoutDirection layoutDirection() const {
|
||||
if (m_layoutDirection == Qt::LayoutDirectionAuto) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user