forked from qt-creator/qt-creator
Utils: Modernize
modernize-use-auto modernize-use-nullptr modernize-use-override modernize-use-using modernize-use-default-member-init modernize-use-equals-default Change-Id: I8d44d9405011a1878353baf9325f7af90b89db02 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -69,7 +69,7 @@ QDebug operator<<(QDebug d, const TextFileFormat &format)
|
||||
*/
|
||||
|
||||
TextFileFormat::TextFileFormat() :
|
||||
lineTerminationMode(NativeLineTerminator), hasUtf8Bom(false), codec(0)
|
||||
lineTerminationMode(NativeLineTerminator), hasUtf8Bom(false), codec(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ TextFileFormat TextFileFormat::detect(const QByteArray &data)
|
||||
if (data.isEmpty())
|
||||
return result;
|
||||
const int bytesRead = data.size();
|
||||
const unsigned char *buf = reinterpret_cast<const unsigned char *>(data.constData());
|
||||
const auto buf = reinterpret_cast<const unsigned char *>(data.constData());
|
||||
// code taken from qtextstream
|
||||
if (bytesRead >= 4 && ((buf[0] == 0xff && buf[1] == 0xfe && buf[2] == 0 && buf[3] == 0)
|
||||
|| (buf[0] == 0 && buf[1] == 0 && buf[2] == 0xfe && buf[3] == 0xff))) {
|
||||
@@ -202,7 +202,7 @@ bool TextFileFormat::decode(const QByteArray &data, QStringList *target) const
|
||||
template <class Target>
|
||||
TextFileFormat::ReadResult readTextFile(const QString &fileName, const QTextCodec *defaultCodec,
|
||||
Target *target, TextFileFormat *format, QString *errorString,
|
||||
QByteArray *decodingErrorSampleIn = 0)
|
||||
QByteArray *decodingErrorSampleIn = nullptr)
|
||||
{
|
||||
if (decodingErrorSampleIn)
|
||||
decodingErrorSampleIn->clear();
|
||||
|
||||
Reference in New Issue
Block a user