Permalink
Browse files

Remove C casts

1 parent f3e81b8 commit 9d1c6b9ea083b3dd7ab8c6528d4d18aebb6a034f @Vitallium Vitallium committed Oct 1, 2016
Showing with 13 additions and 13 deletions.
  1. +1 −1 src/callback.h
  2. +2 −2 src/childprocess.cpp
  3. +1 −1 src/childprocess.h
  4. +3 −3 src/encoding.cpp
  5. +5 −5 src/filesystem.cpp
  6. +1 −1 src/terminal.cpp
View
@@ -47,7 +47,7 @@ class Callback : public QObject
QVariant returnValue() const;
void setReturnValue(const QVariant& returnValue);
-signals:
+Q_SIGNALGS:
void called(const QVariantList& arguments);
private:
@@ -92,11 +92,11 @@ qint64 ChildProcessContext::_write(const QString &chunk, const QString &encoding
QTextCodec *codec = QTextCodec::codecForName(encoding.toLatin1());
// If unavailable, attempt UTF-8 codec
- if ((QTextCodec *)NULL == codec) {
+ if (!codec) {
codec = QTextCodec::codecForName("UTF-8");
// Don't even try to write if UTF-8 codec is unavailable
- if ((QTextCodec *)NULL == codec) {
+ if (!codec) {
return -1;
}
}
View
@@ -60,7 +60,7 @@ class ChildProcessContext : public QObject
Q_INVOKABLE qint64 _write(const QString &chunk, const QString &encoding);
Q_INVOKABLE void _close();
-signals:
+Q_SINGALS:
void exit(const int code) const;
/**
View
@@ -35,7 +35,7 @@ Encoding::Encoding()
QTextCodec* codec = QTextCodec::codecForName(DEFAULT_CODEC_NAME);
// Fall back to locale codec
- if ((QTextCodec*)NULL == codec) {
+ if (!codec) {
codec = QTextCodec::codecForLocale();
}
@@ -73,7 +73,7 @@ void Encoding::setEncoding(const QString& encoding)
if (!encoding.isEmpty()) {
QTextCodec* codec = QTextCodec::codecForName(encoding.toLatin1());
- if ((QTextCodec*)NULL != codec) {
+ if (!codec) {
m_codec = codec;
}
}
@@ -86,7 +86,7 @@ QTextCodec* Encoding::getCodec() const
{
QTextCodec* codec = m_codec;
- if ((QTextCodec*)NULL == codec) {
+ if (!codec) {
codec = QTextCodec::codecForLocale();
}
View
@@ -29,11 +29,11 @@
#include "filesystem.h"
-#include <QFile>
-#include <QFileInfo>
#include <QDir>
#include <QDebug>
#include <QDateTime>
+#include <QFile>
+#include <QFileInfo>
// File
// public:
@@ -223,7 +223,7 @@ bool File::setEncoding(const QString& encoding)
}
// "Binary" mode doesn't use/need text codecs
- if ((QTextStream*)NULL == m_fileStream) {
+ if (!m_fileStream) {
// TODO: Should we switch to "text" mode?
return false;
}
@@ -232,7 +232,7 @@ bool File::setEncoding(const QString& encoding)
// "utf-8"), we need to get the codec in the system first and use its
// canonical name
QTextCodec* codec = QTextCodec::codecForName(encoding.toLatin1());
- if ((QTextCodec*)NULL == codec) {
+ if (!codec) {
return false;
}
@@ -253,7 +253,7 @@ QString File::getEncoding() const
{
QString encoding;
- if ((QTextStream*)NULL != m_fileStream) {
+ if (m_fileStream) {
encoding = QString(m_fileStream->codec()->name());
}
View
@@ -61,7 +61,7 @@ bool Terminal::setEncoding(const QString& encoding)
// "utf-8"), we need to get the codec in the system first and use its
// canonical name
QTextCodec* codec = QTextCodec::codecForName(encoding.toLatin1());
- if ((QTextCodec*)NULL == codec) {
+ if (!codec) {
return false;
}

0 comments on commit 9d1c6b9

Please sign in to comment.