summaryrefslogtreecommitdiffstats
path: root/src/corelib/codecs/qicucodec.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-11-22 14:46:58 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2019-12-06 12:13:20 +0100
commitece0c0a5e7e0b18beb58ccd868bde54c7be64f78 (patch)
treefa4a0fdbda040d24f1a2d07a320635c76980f431 /src/corelib/codecs/qicucodec.cpp
parentb19220d17fa66de5ded41690ffff263ee2af5c63 (diff)
Tidy nullptr usage
Move away from using 0 as pointer literal. Done using clang-tidy. This is not complete as run-clang-tidy can't handle all of qtbase in one go. Change-Id: I1076a21f32aac0dab078af6f175f7508145eece0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/corelib/codecs/qicucodec.cpp')
-rw-r--r--src/corelib/codecs/qicucodec.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/corelib/codecs/qicucodec.cpp b/src/corelib/codecs/qicucodec.cpp
index 5a778c2638..f9092277b2 100644
--- a/src/corelib/codecs/qicucodec.cpp
+++ b/src/corelib/codecs/qicucodec.cpp
@@ -381,7 +381,7 @@ static QTextCodec *loadQtCodec(const char *name)
return QIsciiCodec::create(name);
#endif
- return 0;
+ return nullptr;
}
/// \threadsafe
@@ -438,7 +438,7 @@ QTextCodec *QIcuCodec::defaultCodecUnlocked()
{
QCoreGlobalData *globalData = QCoreGlobalData::instance();
if (!globalData)
- return 0;
+ return nullptr;
QTextCodec *c = globalData->codecForLocale.loadAcquire();
if (c)
return c;
@@ -523,13 +523,13 @@ QTextCodec *QIcuCodec::codecForNameUnlocked(const char *name)
return c;
if (qt_only)
- return 0;
+ return nullptr;
// check whether there is really a converter for the name available.
UConverter *conv = ucnv_open(standardName, &error);
if (!conv) {
qDebug("codecForName: ucnv_open failed %s %s", standardName, u_errorName(error));
- return 0;
+ return nullptr;
}
//qDebug() << "QIcuCodec: Standard name for " << name << "is" << standardName;
ucnv_close(conv);
@@ -552,7 +552,7 @@ QTextCodec *QIcuCodec::codecForMibUnlocked(int mib)
if (mib == 2107)
return codecForNameUnlocked("TSCII");
- return 0;
+ return nullptr;
}
@@ -567,7 +567,7 @@ QIcuCodec::~QIcuCodec()
UConverter *QIcuCodec::getConverter(QTextCodec::ConverterState *state) const
{
- UConverter *conv = 0;
+ UConverter *conv = nullptr;
if (state) {
if (!state->d) {
// first time
@@ -609,7 +609,7 @@ QString QIcuCodec::convertToUnicode(const char *chars, int length, QTextCodec::C
ucnv_toUnicode(conv,
&uc, ucEnd,
&chars, end,
- 0, false, &error);
+ nullptr, false, &error);
if (!U_SUCCESS(error) && error != U_BUFFER_OVERFLOW_ERROR) {
qDebug("convertToUnicode failed: %s", u_errorName(error));
break;
@@ -646,7 +646,7 @@ QByteArray QIcuCodec::convertFromUnicode(const QChar *unicode, int length, QText
ucnv_fromUnicode(conv,
&ch, chEnd,
&uc, end,
- 0, false, &error);
+ nullptr, false, &error);
if (!U_SUCCESS(error))
qDebug("convertFromUnicode failed: %s", u_errorName(error));
convertedChars = ch - string.data();