mirror of
https://github.com/mumble-voip/mumble.git
synced 2025-10-26 11:19:16 +00:00
Merge pull request #4336: REFAC(various): replace NULL with nullptr
This changes all remaining occurances of NULL in the source code to nullptr. fixes #3763
This commit is contained in:
commit
4afab7c67d
@ -106,12 +106,12 @@ int __stdcall WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdL
|
||||
if (lpCmdLine && (strcmp(lpCmdLine, "/detect") == 0)) {
|
||||
return 0;
|
||||
} else if (! lpCmdLine || (strcmp(lpCmdLine, "/mumble") != 0)) {
|
||||
MessageBox(NULL, L"This program is run by Mumble, and should not be started separately.", L"Nothing to see here, move along", MB_OK | MB_ICONERROR);
|
||||
MessageBox(nullptr, L"This program is run by Mumble, and should not be started separately.", L"Nothing to see here, move along", MB_OK | MB_ICONERROR);
|
||||
return 0;
|
||||
}
|
||||
|
||||
char *argvec[1];
|
||||
argvec[0] = NULL;
|
||||
argvec[0] = nullptr;
|
||||
|
||||
int argc = 0;
|
||||
char **argv = &argvec[0];
|
||||
|
||||
@ -62,9 +62,9 @@ Channel *Channel::add(int id, const QString &name) {
|
||||
QWriteLocker lock(&c_qrwlChannels);
|
||||
|
||||
if (c_qhChannels.contains(id))
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
Channel *c = new Channel(id, name, NULL);
|
||||
Channel *c = new Channel(id, name, nullptr);
|
||||
c_qhChannels.insert(id, c);
|
||||
return c;
|
||||
}
|
||||
@ -153,8 +153,8 @@ void Channel::addChannel(Channel *c) {
|
||||
}
|
||||
|
||||
void Channel::removeChannel(Channel *c) {
|
||||
c->cParent = NULL;
|
||||
c->setParent(NULL);
|
||||
c->cParent = nullptr;
|
||||
c->setParent(nullptr);
|
||||
qlChannels.removeAll(c);
|
||||
}
|
||||
|
||||
|
||||
@ -63,7 +63,7 @@ class Channel : public QObject {
|
||||
/// setting.
|
||||
unsigned int uiMaxUsers;
|
||||
|
||||
Channel(int id, const QString &name, QObject *p = NULL);
|
||||
Channel(int id, const QString &name, QObject *p = nullptr);
|
||||
~Channel();
|
||||
|
||||
#ifdef MUMBLE
|
||||
@ -92,7 +92,7 @@ class Channel : public QObject {
|
||||
|
||||
bool isLinked(Channel *c) const;
|
||||
void link(Channel *c);
|
||||
void unlink(Channel *c = NULL);
|
||||
void unlink(Channel *c = nullptr);
|
||||
|
||||
QSet<Channel *> allLinks();
|
||||
QSet<Channel *> allChildren();
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
HANDLE Connection::hQoS = NULL;
|
||||
HANDLE Connection::hQoS = nullptr;
|
||||
#endif
|
||||
|
||||
Connection::Connection(QObject *p, QSslSocket *qtsSock) : QObject(p) {
|
||||
@ -68,7 +68,7 @@ void Connection::setToS() {
|
||||
return;
|
||||
|
||||
dwFlow = 0;
|
||||
if (! QOSAddSocketToFlow(hQoS, qtsSocket->socketDescriptor(), NULL, QOSTrafficTypeAudioVideo, QOS_NON_ADAPTIVE_FLOW, reinterpret_cast<PQOS_FLOWID>(&dwFlow)))
|
||||
if (! QOSAddSocketToFlow(hQoS, qtsSocket->socketDescriptor(), nullptr, QOSTrafficTypeAudioVideo, QOS_NON_ADAPTIVE_FLOW, reinterpret_cast<PQOS_FLOWID>(&dwFlow)))
|
||||
qWarning("Connection: Failed to add flow to QOS");
|
||||
#elif defined(Q_OS_UNIX)
|
||||
int val = 0xa0;
|
||||
|
||||
@ -36,7 +36,7 @@ QString EnvUtils::getenv(QString name) {
|
||||
#else
|
||||
QByteArray name8bit = name.toLocal8Bit();
|
||||
char *val = ::getenv(name8bit.constData());
|
||||
if (val == NULL) {
|
||||
if (!val) {
|
||||
return QString();
|
||||
}
|
||||
return QString::fromLocal8Bit(val);
|
||||
|
||||
@ -67,11 +67,11 @@ Group *Group::getGroup(Channel *chan, QString name) {
|
||||
else if (g->bInheritable)
|
||||
return g;
|
||||
else
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
p = p->cParent;
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QSet<QString> Group::groupNames(Channel *chan) {
|
||||
|
||||
@ -16,7 +16,7 @@ class LogEmitter : public QObject {
|
||||
signals:
|
||||
void newLogEntry(const QString &msg);
|
||||
public:
|
||||
LogEmitter(QObject *parent = NULL);
|
||||
LogEmitter(QObject *parent = nullptr);
|
||||
void addLogEntry(const QString &msg);
|
||||
};
|
||||
|
||||
|
||||
@ -94,7 +94,7 @@ static QString win10DisplayableVersion() {
|
||||
}
|
||||
|
||||
len = sizeof(buf);
|
||||
err = RegQueryValueEx(key, L"ProductName", NULL, NULL, reinterpret_cast<LPBYTE>(&buf[0]), &len);
|
||||
err = RegQueryValueEx(key, L"ProductName", nullptr, nullptr, reinterpret_cast<LPBYTE>(&buf[0]), &len);
|
||||
if (err != ERROR_SUCCESS) {
|
||||
RegCloseKey(key);
|
||||
return QString();
|
||||
@ -102,7 +102,7 @@ static QString win10DisplayableVersion() {
|
||||
productName = regString(buf, static_cast<int>(len / sizeof(buf[0])));
|
||||
|
||||
len = sizeof(buf);
|
||||
err = RegQueryValueEx(key, L"ReleaseId", NULL, NULL, reinterpret_cast<LPBYTE>(&buf[0]), &len);
|
||||
err = RegQueryValueEx(key, L"ReleaseId", nullptr, nullptr, reinterpret_cast<LPBYTE>(&buf[0]), &len);
|
||||
if (err != ERROR_SUCCESS) {
|
||||
RegCloseKey(key);
|
||||
return QString();
|
||||
@ -110,7 +110,7 @@ static QString win10DisplayableVersion() {
|
||||
releaseId = regString(buf, static_cast<int>(len / sizeof(buf[0])));
|
||||
|
||||
len = sizeof(buf);
|
||||
err = RegQueryValueEx(key, L"CurrentBuild", NULL, NULL, reinterpret_cast<LPBYTE>(&buf[0]), &len);
|
||||
err = RegQueryValueEx(key, L"CurrentBuild", nullptr, nullptr, reinterpret_cast<LPBYTE>(&buf[0]), &len);
|
||||
if (err != ERROR_SUCCESS) {
|
||||
RegCloseKey(key);
|
||||
return QString();
|
||||
@ -118,7 +118,7 @@ static QString win10DisplayableVersion() {
|
||||
currentBuild = regString(buf, static_cast<int>(len / sizeof(buf[0])));
|
||||
|
||||
len = sizeof(dw);
|
||||
err = RegQueryValueEx(key, L"UBR", NULL, NULL, reinterpret_cast<LPBYTE>(&dw), &len);
|
||||
err = RegQueryValueEx(key, L"UBR", nullptr, nullptr, reinterpret_cast<LPBYTE>(&dw), &len);
|
||||
if (err != ERROR_SUCCESS) {
|
||||
RegCloseKey(key);
|
||||
return QString();
|
||||
@ -235,10 +235,10 @@ QString OSInfo::getOSVersion() {
|
||||
if (err != noErr)
|
||||
return QString::number(QSysInfo::MacintoshVersion, 16);
|
||||
|
||||
char *buildno = NULL;
|
||||
char *buildno = nullptr;
|
||||
char buildno_buf[32];
|
||||
size_t sz_buildno_buf = sizeof(buildno);
|
||||
int ret = sysctlbyname("kern.osversion", buildno_buf, &sz_buildno_buf, NULL, 0);
|
||||
int ret = sysctlbyname("kern.osversion", buildno_buf, &sz_buildno_buf, nullptr, 0);
|
||||
if (ret == 0) {
|
||||
buildno = &buildno_buf[0];
|
||||
}
|
||||
@ -370,7 +370,7 @@ QString OSInfo::getOSDisplayableVersion() {
|
||||
|
||||
typedef BOOL (WINAPI *PGPI)(DWORD, DWORD, DWORD, DWORD, PDWORD);
|
||||
PGPI pGetProductInfo = (PGPI) GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "GetProductInfo");
|
||||
if (pGetProductInfo == NULL) {
|
||||
if (!pGetProductInfo) {
|
||||
return QString();
|
||||
}
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@ bool PlatformCheck::IsWine() {
|
||||
#ifdef Q_OS_WIN
|
||||
// Detect if we're running under Wine.
|
||||
// For more info, see https://wiki.winehq.org/Developer_FAQ#How_can_I_detect_Wine.3F
|
||||
if (QLibrary::resolve(QLatin1String("ntdll.dll"), "wine_get_version") != NULL) {
|
||||
if (QLibrary::resolve(QLatin1String("ntdll.dll"), "wine_get_version")) {
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
16
src/SSL.cpp
16
src/SSL.cpp
@ -33,7 +33,7 @@ void MumbleSSL::initialize() {
|
||||
// If we detect that no locking callback is configured, we
|
||||
// have to set it up ourselves to allow multi-threaded use
|
||||
// of OpenSSL.
|
||||
if (CRYPTO_get_locking_callback() == NULL) {
|
||||
if (!CRYPTO_get_locking_callback()) {
|
||||
SSLLocks::initialize();
|
||||
}
|
||||
}
|
||||
@ -49,23 +49,23 @@ QString MumbleSSL::defaultOpenSSLCipherString() {
|
||||
QList<QSslCipher> MumbleSSL::ciphersFromOpenSSLCipherString(QString cipherString) {
|
||||
QList<QSslCipher> chosenCiphers;
|
||||
|
||||
SSL_CTX *ctx = NULL;
|
||||
SSL *ssl = NULL;
|
||||
const SSL_METHOD *meth = NULL;
|
||||
SSL_CTX *ctx = nullptr;
|
||||
SSL *ssl = nullptr;
|
||||
const SSL_METHOD *meth = nullptr;
|
||||
int i = 0;
|
||||
|
||||
QByteArray csbuf = cipherString.toLatin1();
|
||||
const char *ciphers = csbuf.constData();
|
||||
|
||||
meth = SSLv23_server_method();
|
||||
if (meth == NULL) {
|
||||
if (!meth) {
|
||||
qWarning("MumbleSSL: unable to get SSL method");
|
||||
goto out;
|
||||
}
|
||||
|
||||
// We use const_cast to be compatible with OpenSSL 0.9.8.
|
||||
ctx = SSL_CTX_new(const_cast<SSL_METHOD *>(meth));
|
||||
if (ctx == NULL) {
|
||||
if (!ctx) {
|
||||
qWarning("MumbleSSL: unable to allocate SSL_CTX");
|
||||
goto out;
|
||||
}
|
||||
@ -76,14 +76,14 @@ QList<QSslCipher> MumbleSSL::ciphersFromOpenSSLCipherString(QString cipherString
|
||||
}
|
||||
|
||||
ssl = SSL_new(ctx);
|
||||
if (ssl == NULL) {
|
||||
if (!ssl) {
|
||||
qWarning("MumbleSSL: unable to create SSL object in ciphersFromOpenSSLCipherString");
|
||||
goto out;
|
||||
}
|
||||
|
||||
while (1) {
|
||||
const char *name = SSL_get_cipher_list(ssl, i);
|
||||
if (name == NULL) {
|
||||
if (!name) {
|
||||
break;
|
||||
}
|
||||
#if QT_VERSION >= 0x050300
|
||||
|
||||
@ -18,5 +18,5 @@ const SSLCipherInfo *SSLCipherInfoLookupByOpenSSLName(const char *openSslCipherN
|
||||
return ci;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
|
||||
#include <openssl/crypto.h>
|
||||
|
||||
static QMutex **locks = NULL;
|
||||
static QMutex **locks = nullptr;
|
||||
|
||||
void locking_callback(int mode, int type, const char *, int) {
|
||||
if (mode & CRYPTO_LOCK) {
|
||||
@ -50,7 +50,7 @@ void SSLLocks::initialize() {
|
||||
int nlocks = CRYPTO_num_locks();
|
||||
|
||||
locks = reinterpret_cast<QMutex **>(calloc(nlocks, sizeof(QMutex *)));
|
||||
if (locks == NULL) {
|
||||
if (!locks) {
|
||||
qFatal("SSLLocks: unable to allocate locks array");
|
||||
|
||||
// This initializer is called early during program
|
||||
@ -71,12 +71,12 @@ void SSLLocks::initialize() {
|
||||
void SSLLocks::destroy() {
|
||||
// If SSLLocks was never initialized, or has been destroyed already,
|
||||
// don't try to do it again.
|
||||
if (locks == NULL) {
|
||||
if (!locks) {
|
||||
return;
|
||||
}
|
||||
|
||||
CRYPTO_set_locking_callback(NULL);
|
||||
CRYPTO_set_id_callback(NULL);
|
||||
CRYPTO_set_locking_callback(nullptr);
|
||||
CRYPTO_set_id_callback(nullptr);
|
||||
|
||||
int nlocks = CRYPTO_num_locks();
|
||||
for (int i = 0; i < nlocks; i++) {
|
||||
@ -84,5 +84,5 @@ void SSLLocks::destroy() {
|
||||
}
|
||||
|
||||
free(locks);
|
||||
locks = NULL;
|
||||
locks = nullptr;
|
||||
}
|
||||
|
||||
@ -12,10 +12,10 @@
|
||||
static int add_ext(X509 * crt, int nid, char *value) {
|
||||
X509V3_CTX ctx;
|
||||
X509V3_set_ctx_nodb(&ctx);
|
||||
X509V3_set_ctx(&ctx, crt, crt, NULL, NULL, 0);
|
||||
X509V3_set_ctx(&ctx, crt, crt, nullptr, nullptr, 0);
|
||||
|
||||
X509_EXTENSION *ex = X509V3_EXT_conf_nid(NULL, &ctx, nid, value);
|
||||
if (ex == NULL) {
|
||||
X509_EXTENSION *ex = X509V3_EXT_conf_nid(nullptr, &ctx, nid, value);
|
||||
if (!ex) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -30,14 +30,14 @@ static int add_ext(X509 * crt, int nid, char *value) {
|
||||
|
||||
bool SelfSignedCertificate::generate(CertificateType certificateType, QString clientCertName, QString clientCertEmail, QSslCertificate &qscCert, QSslKey &qskKey) {
|
||||
bool ok = true;
|
||||
X509 *x509 = NULL;
|
||||
EVP_PKEY *pkey = NULL;
|
||||
RSA *rsa = NULL;
|
||||
BIGNUM *e = NULL;
|
||||
X509_NAME *name = NULL;
|
||||
ASN1_INTEGER *serialNumber = NULL;
|
||||
ASN1_TIME *notBefore = NULL;
|
||||
ASN1_TIME *notAfter = NULL;
|
||||
X509 *x509 = nullptr;
|
||||
EVP_PKEY *pkey = nullptr;
|
||||
RSA *rsa = nullptr;
|
||||
BIGNUM *e = nullptr;
|
||||
X509_NAME *name = nullptr;
|
||||
ASN1_INTEGER *serialNumber = nullptr;
|
||||
ASN1_TIME *notBefore = nullptr;
|
||||
ASN1_TIME *notAfter = nullptr;
|
||||
QString commonName;
|
||||
bool isServerCert = certificateType == CertificateTypeServerCertificate;
|
||||
|
||||
@ -47,25 +47,25 @@ bool SelfSignedCertificate::generate(CertificateType certificateType, QString cl
|
||||
}
|
||||
|
||||
x509 = X509_new();
|
||||
if (x509 == NULL) {
|
||||
if (!x509) {
|
||||
ok = false;
|
||||
goto out;
|
||||
}
|
||||
|
||||
pkey = EVP_PKEY_new();
|
||||
if (pkey == NULL) {
|
||||
if (!pkey) {
|
||||
ok = false;
|
||||
goto out;
|
||||
}
|
||||
|
||||
rsa = RSA_new();
|
||||
if (rsa == NULL) {
|
||||
if (!rsa) {
|
||||
ok = false;
|
||||
goto out;
|
||||
}
|
||||
|
||||
e = BN_new();
|
||||
if (e == NULL) {
|
||||
if (!e) {
|
||||
ok = false;
|
||||
goto out;
|
||||
}
|
||||
@ -74,7 +74,7 @@ bool SelfSignedCertificate::generate(CertificateType certificateType, QString cl
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (RSA_generate_key_ex(rsa, 2048, e, NULL) == 0) {
|
||||
if (RSA_generate_key_ex(rsa, 2048, e, nullptr) == 0) {
|
||||
ok = false;
|
||||
goto out;
|
||||
}
|
||||
@ -90,7 +90,7 @@ bool SelfSignedCertificate::generate(CertificateType certificateType, QString cl
|
||||
}
|
||||
|
||||
serialNumber = X509_get_serialNumber(x509);
|
||||
if (serialNumber == NULL) {
|
||||
if (!serialNumber) {
|
||||
ok = false;
|
||||
goto out;
|
||||
}
|
||||
@ -100,21 +100,21 @@ bool SelfSignedCertificate::generate(CertificateType certificateType, QString cl
|
||||
}
|
||||
|
||||
notBefore = X509_get_notBefore(x509);
|
||||
if (notBefore == NULL) {
|
||||
if (!notBefore) {
|
||||
ok = false;
|
||||
goto out;
|
||||
}
|
||||
if (X509_gmtime_adj(notBefore, 0) == NULL) {
|
||||
if (!X509_gmtime_adj(notBefore, 0)) {
|
||||
ok = false;
|
||||
goto out;
|
||||
}
|
||||
|
||||
notAfter = X509_get_notAfter(x509);
|
||||
if (notAfter == NULL) {
|
||||
if (!notAfter) {
|
||||
ok = false;
|
||||
goto out;
|
||||
}
|
||||
if (X509_gmtime_adj(notAfter, 60*60*24*365*20) == NULL) {
|
||||
if (!X509_gmtime_adj(notAfter, 60*60*24*365*20)) {
|
||||
ok = false;
|
||||
goto out;
|
||||
}
|
||||
@ -125,7 +125,7 @@ bool SelfSignedCertificate::generate(CertificateType certificateType, QString cl
|
||||
}
|
||||
|
||||
name = X509_get_subject_name(x509);
|
||||
if (name == NULL) {
|
||||
if (!name) {
|
||||
ok = false;
|
||||
goto out;
|
||||
}
|
||||
@ -200,7 +200,7 @@ bool SelfSignedCertificate::generate(CertificateType certificateType, QString cl
|
||||
|
||||
{
|
||||
QByteArray crt;
|
||||
int len = i2d_X509(x509, NULL);
|
||||
int len = i2d_X509(x509, nullptr);
|
||||
if (len <= 0) {
|
||||
ok = false;
|
||||
goto out;
|
||||
@ -222,7 +222,7 @@ bool SelfSignedCertificate::generate(CertificateType certificateType, QString cl
|
||||
|
||||
{
|
||||
QByteArray key;
|
||||
int len = i2d_PrivateKey(pkey, NULL);
|
||||
int len = i2d_PrivateKey(pkey, nullptr);
|
||||
if (len <= 0) {
|
||||
ok = false;
|
||||
goto out;
|
||||
|
||||
@ -20,7 +20,7 @@ class ServerResolver : public QObject {
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(ServerResolver)
|
||||
public:
|
||||
ServerResolver(QObject *parent = NULL);
|
||||
ServerResolver(QObject *parent = nullptr);
|
||||
|
||||
QString hostname();
|
||||
quint16 port();
|
||||
|
||||
@ -111,7 +111,7 @@ quint64 Timer::now() {
|
||||
# else
|
||||
quint64 Timer::now() {
|
||||
struct timeval tv;
|
||||
gettimeofday(&tv, NULL);
|
||||
gettimeofday(&tv, nullptr);
|
||||
quint64 e= tv.tv_sec * 1000000LL;
|
||||
e += tv.tv_usec;
|
||||
return e;
|
||||
|
||||
@ -30,30 +30,30 @@ class CryptographicHashPrivate {
|
||||
CryptographicHashPrivate();
|
||||
|
||||
/// If m_mdctx is set, cleanupMdctx will destroy
|
||||
/// the EVP_MD_CTX object and set m_mdctx to NULL.
|
||||
/// the EVP_MD_CTX object and set m_mdctx to nullptr.
|
||||
void cleanupMdctx();
|
||||
};
|
||||
|
||||
CryptographicHashPrivate::CryptographicHashPrivate()
|
||||
: m_mdctx(NULL) {
|
||||
: m_mdctx(nullptr) {
|
||||
}
|
||||
|
||||
void CryptographicHashPrivate::cleanupMdctx() {
|
||||
if (m_mdctx) {
|
||||
EVP_MD_CTX_destroy(m_mdctx);
|
||||
m_mdctx = NULL;
|
||||
m_mdctx = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
CryptographicHashPrivate::CryptographicHashPrivate(const EVP_MD *type)
|
||||
: m_mdctx(NULL) {
|
||||
: m_mdctx(nullptr) {
|
||||
|
||||
m_mdctx = EVP_MD_CTX_create();
|
||||
if (m_mdctx == NULL) {
|
||||
if (!m_mdctx) {
|
||||
return;
|
||||
}
|
||||
|
||||
int err = EVP_DigestInit_ex(m_mdctx, type, NULL);
|
||||
int err = EVP_DigestInit_ex(m_mdctx, type, nullptr);
|
||||
if (err != 1) {
|
||||
cleanupMdctx();
|
||||
return;
|
||||
@ -65,7 +65,7 @@ CryptographicHashPrivate::~CryptographicHashPrivate() {
|
||||
}
|
||||
|
||||
void CryptographicHashPrivate::addData(const QByteArray &buf) {
|
||||
if (m_mdctx == NULL) {
|
||||
if (!m_mdctx) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -86,7 +86,7 @@ void CryptographicHashPrivate::addData(const QByteArray &buf) {
|
||||
}
|
||||
|
||||
QByteArray CryptographicHashPrivate::result() {
|
||||
if (m_mdctx == NULL) {
|
||||
if (!m_mdctx) {
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
@ -98,7 +98,7 @@ QByteArray CryptographicHashPrivate::result() {
|
||||
}
|
||||
|
||||
QByteArray digest(EVP_MD_CTX_size(m_mdctx), '\0');
|
||||
int err = EVP_DigestFinal_ex(m_mdctx, reinterpret_cast<unsigned char *>(digest.data()), NULL);
|
||||
int err = EVP_DigestFinal_ex(m_mdctx, reinterpret_cast<unsigned char *>(digest.data()), nullptr);
|
||||
if (err != 1) {
|
||||
cleanupMdctx();
|
||||
return QByteArray();
|
||||
@ -136,11 +136,11 @@ QString CryptographicHash::shortAlgorithmName(CryptographicHash::Algorithm algo)
|
||||
}
|
||||
|
||||
CryptographicHash::CryptographicHash()
|
||||
: d(NULL) {
|
||||
: d(nullptr) {
|
||||
}
|
||||
|
||||
CryptographicHash::CryptographicHash(CryptographicHash::Algorithm algo)
|
||||
: d(NULL) {
|
||||
: d(nullptr) {
|
||||
|
||||
switch (algo) {
|
||||
case CryptographicHash::Sha1:
|
||||
|
||||
@ -17,7 +17,7 @@ typedef int (*DLL_DEBUG_MAIN)(int, char **);
|
||||
|
||||
// Alert shows a fatal error dialog and waits for the user to click OK.
|
||||
static void Alert(LPCWSTR title, LPCWSTR msg) {
|
||||
MessageBox(NULL, msg, title, MB_OK|MB_ICONERROR);
|
||||
MessageBox(nullptr, msg, title, MB_OK|MB_ICONERROR);
|
||||
}
|
||||
|
||||
// Get the current Mumble version built into this executable.
|
||||
@ -39,7 +39,7 @@ static const std::wstring GetMumbleVersion() {
|
||||
static const std::wstring GetExecutableDirPath() {
|
||||
wchar_t path[MAX_PATH];
|
||||
|
||||
if (GetModuleFileNameW(NULL, path, MAX_PATH) == 0)
|
||||
if (GetModuleFileNameW(nullptr, path, MAX_PATH) == 0)
|
||||
return std::wstring();
|
||||
|
||||
if (!PathRemoveFileSpecW(path))
|
||||
@ -161,7 +161,7 @@ int main(int argc, char **argv) {
|
||||
return -2;
|
||||
}
|
||||
|
||||
HMODULE dll = LoadLibraryExW(abs_dll_path.c_str(), NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
|
||||
HMODULE dll = LoadLibraryExW(abs_dll_path.c_str(), nullptr, LOAD_WITH_ALTERED_SEARCH_PATH);
|
||||
if (!dll) {
|
||||
Alert(L"Mumble Launcher Error -3", L"Failed to load mumble_app.dll.");
|
||||
return -3;
|
||||
@ -204,7 +204,7 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE prevInstance, wchar_t *cmdAr
|
||||
return -2;
|
||||
}
|
||||
|
||||
HMODULE dll = LoadLibraryExW(abs_dll_path.c_str(), NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
|
||||
HMODULE dll = LoadLibraryExW(abs_dll_path.c_str(), nullptr, LOAD_WITH_ALTERED_SEARCH_PATH);
|
||||
if (!dll) {
|
||||
Alert(L"Mumble Launcher Error -3", L"Failed to load mumble_app.dll.");
|
||||
return -3;
|
||||
@ -217,7 +217,7 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE prevInstance, wchar_t *cmdAr
|
||||
}
|
||||
|
||||
(void) cmdArg;
|
||||
int rc = entry_point(instance, prevInstance, NULL, cmdShow);
|
||||
int rc = entry_point(instance, prevInstance, nullptr, cmdShow);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
@ -8,13 +8,13 @@
|
||||
#include "BonjourServiceRegister.h"
|
||||
|
||||
BonjourServer::BonjourServer() {
|
||||
bsrRegister = NULL;
|
||||
bsrRegister = nullptr;
|
||||
#ifdef Q_OS_WIN
|
||||
static bool bDelayLoadFailed = false;
|
||||
if (bDelayLoadFailed) return;
|
||||
|
||||
HMODULE hLib = LoadLibrary(L"DNSSD.DLL");
|
||||
if (hLib == NULL) {
|
||||
if (!hLib) {
|
||||
bDelayLoadFailed = true;
|
||||
qWarning("Bonjour: Failed to load dnssd.dll");
|
||||
return;
|
||||
|
||||
@ -28,20 +28,20 @@ bool Server::isKeyForCert(const QSslKey &key, const QSslCertificate &cert) {
|
||||
QByteArray qbaKey = key.toDer();
|
||||
QByteArray qbaCert = cert.toDer();
|
||||
|
||||
X509 *x509 = NULL;
|
||||
EVP_PKEY *pkey = NULL;
|
||||
BIO *mem = NULL;
|
||||
X509 *x509 = nullptr;
|
||||
EVP_PKEY *pkey = nullptr;
|
||||
BIO *mem = nullptr;
|
||||
|
||||
mem = BIO_new_mem_buf(qbaKey.data(), qbaKey.size());
|
||||
Q_UNUSED(BIO_set_close(mem, BIO_NOCLOSE));
|
||||
pkey = d2i_PrivateKey_bio(mem, NULL);
|
||||
pkey = d2i_PrivateKey_bio(mem, nullptr);
|
||||
BIO_free(mem);
|
||||
|
||||
mem = BIO_new_mem_buf(qbaCert.data(), qbaCert.size());
|
||||
Q_UNUSED(BIO_set_close(mem, BIO_NOCLOSE));
|
||||
x509 = d2i_X509_bio(mem, NULL);
|
||||
x509 = d2i_X509_bio(mem, nullptr);
|
||||
BIO_free(mem);
|
||||
mem = NULL;
|
||||
mem = nullptr;
|
||||
|
||||
if (x509 && pkey && X509_check_private_key(x509, pkey)) {
|
||||
EVP_PKEY_free(pkey);
|
||||
|
||||
@ -169,7 +169,7 @@ void MurmurDBus::registerTypes() {
|
||||
qDBusRegisterMetaType<QList<LogEntry> >();
|
||||
}
|
||||
|
||||
QDBusConnection *MurmurDBus::qdbc = NULL;
|
||||
QDBusConnection *MurmurDBus::qdbc = nullptr;
|
||||
|
||||
MurmurDBus::MurmurDBus(Server *srv) : QDBusAbstractAdaptor(srv) {
|
||||
server = srv;
|
||||
@ -299,7 +299,7 @@ void MurmurDBus::authenticateSlot(int &res, QString &uname, int sessionId, const
|
||||
}
|
||||
}
|
||||
if (ok && (msg.arguments().count() >= 3)) {
|
||||
server->setTempGroups(uid, sessionId, NULL, msg.arguments().at(2).toStringList());
|
||||
server->setTempGroups(uid, sessionId, nullptr, msg.arguments().at(2).toStringList());
|
||||
}
|
||||
if (ok) {
|
||||
server->log(QString("DBus Authenticate success for %1: %2").arg(uname).arg(uid));
|
||||
@ -380,13 +380,13 @@ void MurmurDBus::setPlayerState(const PlayerInfo &npi, const QDBusMessage &msg)
|
||||
void MurmurDBus::sendMessage(unsigned int session, const QString &text, const QDBusMessage &msg) {
|
||||
PLAYER_SETUP;
|
||||
|
||||
server->sendTextMessage(NULL, pUser, false, text);
|
||||
server->sendTextMessage(nullptr, pUser, false, text);
|
||||
}
|
||||
|
||||
void MurmurDBus::sendMessageChannel(int id, bool tree, const QString &text, const QDBusMessage &msg) {
|
||||
CHANNEL_SETUP_VAR(id);
|
||||
|
||||
server->sendTextMessage(cChannel, NULL, tree, text);
|
||||
server->sendTextMessage(cChannel, nullptr, tree, text);
|
||||
}
|
||||
|
||||
void MurmurDBus::addChannel(const QString &name, int chanparent, const QDBusMessage &msg, int &newid) {
|
||||
@ -454,7 +454,7 @@ void MurmurDBus::getACL(int id, const QDBusMessage &msg, QList<ACLInfo> &acls, Q
|
||||
if ((p == cChannel) || (p->bInheritACL))
|
||||
p = p->cParent;
|
||||
else
|
||||
p =NULL;
|
||||
p =nullptr;
|
||||
}
|
||||
|
||||
inherit = cChannel->bInheritACL;
|
||||
@ -476,7 +476,7 @@ void MurmurDBus::getACL(int id, const QDBusMessage &msg, QList<ACLInfo> &acls, Q
|
||||
QString name;
|
||||
foreach(name, allnames) {
|
||||
Group *g = cChannel->qhGroups.value(name);
|
||||
Group *pg = p ? Group::getGroup(p, name) : NULL;
|
||||
Group *pg = p ? Group::getGroup(p, name) : nullptr;
|
||||
if (!g && ! pg)
|
||||
continue;
|
||||
GroupInfo gi(g ? g : pg);
|
||||
|
||||
@ -213,7 +213,7 @@ void Server::msgAuthenticate(ServerUser *uSource, MumbleProto::Authenticate &msg
|
||||
ok = true;
|
||||
}
|
||||
|
||||
ServerUser *uOld = NULL;
|
||||
ServerUser *uOld = nullptr;
|
||||
foreach(ServerUser *u, qhUsers) {
|
||||
if (u == uSource)
|
||||
continue;
|
||||
@ -320,7 +320,7 @@ void Server::msgAuthenticate(ServerUser *uSource, MumbleProto::Authenticate &msg
|
||||
sendMessage(uSource, mpcv);
|
||||
|
||||
if (!bOpus && uSource->bOpus && fake_celt_support) {
|
||||
sendTextMessage(NULL, uSource, false, QLatin1String("<strong>WARNING:</strong> Your client doesn't support the CELT codec, you won't be able to talk to or hear most clients. Please make sure your client was built with CELT support."));
|
||||
sendTextMessage(nullptr, uSource, false, QLatin1String("<strong>WARNING:</strong> Your client doesn't support the CELT codec, you won't be able to talk to or hear most clients. Please make sure your client was built with CELT support."));
|
||||
}
|
||||
|
||||
// Transmit channel tree
|
||||
@ -1032,8 +1032,8 @@ void Server::msgUserRemove(ServerUser *uSource, MumbleProto::UserRemove &msg) {
|
||||
void Server::msgChannelState(ServerUser *uSource, MumbleProto::ChannelState &msg) {
|
||||
MSG_SETUP(ServerUser::Authenticated);
|
||||
|
||||
Channel *c = NULL;
|
||||
Channel *p = NULL;
|
||||
Channel *c = nullptr;
|
||||
Channel *p = nullptr;
|
||||
|
||||
// If this message relates to an existing channel check if the id is really valid
|
||||
if (msg.has_channel_id()) {
|
||||
@ -1534,7 +1534,7 @@ void Server::msgACL(ServerUser *uSource, MumbleProto::ACL &msg) {
|
||||
if ((p==c) || p->bInheritACL)
|
||||
p = p->cParent;
|
||||
else
|
||||
p = NULL;
|
||||
p = nullptr;
|
||||
}
|
||||
|
||||
while (! chans.isEmpty()) {
|
||||
@ -1561,13 +1561,13 @@ void Server::msgACL(ServerUser *uSource, MumbleProto::ACL &msg) {
|
||||
QSet<QString> allnames=Group::groupNames(c);
|
||||
foreach(const QString &name, allnames) {
|
||||
Group *g = c->qhGroups.value(name);
|
||||
Group *pg = p ? Group::getGroup(p, name) : NULL;
|
||||
Group *pg = p ? Group::getGroup(p, name) : nullptr;
|
||||
|
||||
MumbleProto::ACL_ChanGroup *group = msg.add_groups();
|
||||
group->set_name(u8(name));
|
||||
group->set_inherit(g ? g->bInherit : true);
|
||||
group->set_inheritable(g ? g->bInheritable : true);
|
||||
group->set_inherited((pg != NULL) && pg->bInheritable);
|
||||
group->set_inherited(pg && pg->bInheritable);
|
||||
if (g) {
|
||||
foreach(int id, g->qsAdd) {
|
||||
qsId.insert(id);
|
||||
|
||||
@ -43,7 +43,7 @@
|
||||
MetaParams Meta::mp;
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
HANDLE Meta::hQoS = NULL;
|
||||
HANDLE Meta::hQoS = nullptr;
|
||||
#endif
|
||||
|
||||
MetaParams::MetaParams() {
|
||||
@ -104,7 +104,7 @@ MetaParams::MetaParams() {
|
||||
bLogGroupChanges = false;
|
||||
bLogACLChanges = false;
|
||||
|
||||
qsSettings = NULL;
|
||||
qsSettings = nullptr;
|
||||
}
|
||||
|
||||
MetaParams::~MetaParams() {
|
||||
@ -129,7 +129,7 @@ template <class T>
|
||||
T MetaParams::typeCheckedFromSettings(const QString &name, const T &defaultValue, QSettings *settings) {
|
||||
// Use qsSettings unless a specific QSettings instance
|
||||
// is requested.
|
||||
if (settings == NULL) {
|
||||
if (!settings) {
|
||||
settings = qsSettings;
|
||||
}
|
||||
|
||||
@ -648,10 +648,10 @@ Meta::Meta() {
|
||||
qvVer.MajorVersion = 1;
|
||||
qvVer.MinorVersion = 0;
|
||||
|
||||
hQoS = NULL;
|
||||
hQoS = nullptr;
|
||||
|
||||
HMODULE hLib = LoadLibrary(L"qWave.dll");
|
||||
if (hLib == NULL) {
|
||||
if (!hLib) {
|
||||
qWarning("Meta: Failed to load qWave.dll, no QoS available");
|
||||
} else {
|
||||
FreeLibrary(hLib);
|
||||
@ -667,7 +667,7 @@ Meta::~Meta() {
|
||||
#ifdef Q_OS_WIN
|
||||
if (hQoS) {
|
||||
QOSCloseHandle(hQoS);
|
||||
Connection::setQoS(NULL);
|
||||
Connection::setQoS(nullptr);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -162,7 +162,7 @@ public:
|
||||
|
||||
private:
|
||||
template <class T>
|
||||
T typeCheckedFromSettings(const QString &name, const T &variable, QSettings *settings = NULL);
|
||||
T typeCheckedFromSettings(const QString &name, const T &variable, QSettings *settings = nullptr);
|
||||
};
|
||||
|
||||
class Meta : public QObject {
|
||||
|
||||
@ -531,7 +531,7 @@ void MurmurRPCImpl::authenticateSlot(int &res, QString &uname, int sessionId, co
|
||||
}
|
||||
}
|
||||
if (!qsl.isEmpty()) {
|
||||
s->setTempGroups(res, sessionId, NULL, qsl);
|
||||
s->setTempGroups(res, sessionId, nullptr, qsl);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -1856,7 +1856,7 @@ void V1_ACLGet::impl(bool) {
|
||||
if ((p == channel) || p->bInheritACL) {
|
||||
p = p->cParent;
|
||||
} else {
|
||||
p = NULL;
|
||||
p = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1877,7 +1877,7 @@ void V1_ACLGet::impl(bool) {
|
||||
const QSet<QString> allnames = ::Group::groupNames(channel);
|
||||
foreach(const QString &name, allnames) {
|
||||
::Group *g = channel->qhGroups.value(name);
|
||||
::Group *pg = p ? ::Group::getGroup(p, name) : NULL;
|
||||
::Group *pg = p ? ::Group::getGroup(p, name) : nullptr;
|
||||
if (!g && ! pg) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
using namespace std;
|
||||
using namespace Murmur;
|
||||
|
||||
static MurmurIce *mi = NULL;
|
||||
static MurmurIce *mi = nullptr;
|
||||
static Ice::ObjectPtr iopServer;
|
||||
static Ice::PropertiesPtr ippProperties;
|
||||
|
||||
@ -48,7 +48,7 @@ void IceStart() {
|
||||
|
||||
void IceStop() {
|
||||
delete mi;
|
||||
mi = NULL;
|
||||
mi = nullptr;
|
||||
}
|
||||
|
||||
/// Remove all NUL bytes from |s|.
|
||||
@ -294,10 +294,10 @@ MurmurIce::~MurmurIce() {
|
||||
communicator->shutdown();
|
||||
communicator->waitForShutdown();
|
||||
communicator->destroy();
|
||||
communicator=NULL;
|
||||
communicator=nullptr;
|
||||
qWarning("MurmurIce: Shutdown complete");
|
||||
}
|
||||
iopServer = NULL;
|
||||
iopServer = nullptr;
|
||||
}
|
||||
|
||||
void MurmurIce::customEvent(QEvent *evt) {
|
||||
@ -707,7 +707,7 @@ void MurmurIce::authenticateSlot(int &res, QString &uname, int sessionId, const
|
||||
qsl << u8(str);
|
||||
}
|
||||
if (! qsl.isEmpty())
|
||||
server->setTempGroups(res, sessionId, NULL, qsl);
|
||||
server->setTempGroups(res, sessionId, nullptr, qsl);
|
||||
}
|
||||
}
|
||||
|
||||
@ -866,7 +866,7 @@ void ServerI::ice_ping(const Ice::Current ¤t) const {
|
||||
#define ACCESS_Server_isRunning_READ
|
||||
static void impl_Server_isRunning(const ::Murmur::AMD_Server_isRunningPtr cb, int server_id) {
|
||||
NEED_SERVER_EXISTS;
|
||||
cb->ice_response(server != NULL);
|
||||
cb->ice_response(server != nullptr);
|
||||
}
|
||||
|
||||
static void impl_Server_start(const ::Murmur::AMD_Server_startPtr cb, int server_id) {
|
||||
@ -1139,7 +1139,7 @@ static void impl_Server_sendMessage(const ::Murmur::AMD_Server_sendMessagePtr cb
|
||||
NEED_SERVER;
|
||||
NEED_PLAYER;
|
||||
|
||||
server->sendTextMessage(NULL, user, false, u8(text));
|
||||
server->sendTextMessage(nullptr, user, false, u8(text));
|
||||
cb->ice_response();
|
||||
}
|
||||
|
||||
@ -1250,7 +1250,7 @@ static void impl_Server_sendMessageChannel(const ::Murmur::AMD_Server_sendMessag
|
||||
NEED_SERVER;
|
||||
NEED_CHANNEL;
|
||||
|
||||
server->sendTextMessage(channel, NULL, tree, u8(text));
|
||||
server->sendTextMessage(channel, nullptr, tree, u8(text));
|
||||
cb->ice_response();
|
||||
}
|
||||
|
||||
@ -1268,7 +1268,7 @@ static void impl_Server_setChannelState(const ::Murmur::AMD_Server_setChannelSta
|
||||
int channelid = state.id;
|
||||
NEED_SERVER;
|
||||
NEED_CHANNEL;
|
||||
::Channel *np = NULL;
|
||||
::Channel *np = nullptr;
|
||||
if (channel->iId != 0) {
|
||||
NEED_CHANNEL_VAR(np, state.parent);
|
||||
}
|
||||
@ -1347,7 +1347,7 @@ static void impl_Server_getACL(const ::Murmur::AMD_Server_getACLPtr cb, int serv
|
||||
if ((p == channel) || (p->bInheritACL))
|
||||
p = p->cParent;
|
||||
else
|
||||
p = NULL;
|
||||
p = nullptr;
|
||||
}
|
||||
|
||||
bool inherit = channel->bInheritACL;
|
||||
@ -1369,7 +1369,7 @@ static void impl_Server_getACL(const ::Murmur::AMD_Server_getACLPtr cb, int serv
|
||||
const QSet<QString> allnames = ::Group::groupNames(channel);
|
||||
foreach(const QString &name, allnames) {
|
||||
::Group *g = channel->qhGroups.value(name);
|
||||
::Group *pg = p ? ::Group::getGroup(p, name) : NULL;
|
||||
::Group *pg = p ? ::Group::getGroup(p, name) : nullptr;
|
||||
if (!g && ! pg)
|
||||
continue;
|
||||
::Murmur::Group mg;
|
||||
@ -1789,7 +1789,7 @@ static void impl_Meta_getSliceChecksums(const ::Murmur::AMD_Meta_getSliceChecksu
|
||||
static void impl_Meta_getServer(const ::Murmur::AMD_Meta_getServerPtr cb, const Ice::ObjectAdapterPtr adapter, ::Ice::Int id) {
|
||||
QList<int> server_list = ServerDB::getAllServers();
|
||||
if (! server_list.contains(id))
|
||||
cb->ice_response(NULL);
|
||||
cb->ice_response(nullptr);
|
||||
else
|
||||
cb->ice_response(idToProxy(id, adapter));
|
||||
}
|
||||
|
||||
@ -98,7 +98,7 @@ QString PBKDF2::getHash(const QString &hexSalt, const QString &password, int ite
|
||||
iterationCount,
|
||||
EVP_sha384(),
|
||||
DERIVED_KEY_LENGTH, reinterpret_cast<unsigned char*>(hash.data())) == 0) {
|
||||
qFatal("PBKDF2: PKCS5_PBKDF2_HMAC failed: %s", ERR_error_string(ERR_get_error(), NULL));
|
||||
qFatal("PBKDF2: PKCS5_PBKDF2_HMAC failed: %s", ERR_error_string(ERR_get_error(), nullptr));
|
||||
return QString();
|
||||
}
|
||||
|
||||
@ -110,7 +110,7 @@ QString PBKDF2::getSalt() {
|
||||
QByteArray salt(SALT_LENGTH, 0);
|
||||
|
||||
if (RAND_bytes(reinterpret_cast<unsigned char*>(salt.data()), salt.size()) != 1) {
|
||||
qFatal("PBKDF2: RAND_bytes for salt failed: %s", ERR_error_string(ERR_get_error(), NULL));
|
||||
qFatal("PBKDF2: RAND_bytes for salt failed: %s", ERR_error_string(ERR_get_error(), nullptr));
|
||||
return QString();
|
||||
}
|
||||
|
||||
|
||||
@ -85,7 +85,7 @@ bool SslServer::hasDualStackSupport() {
|
||||
return false;
|
||||
}
|
||||
|
||||
SOCKET s = ::WSASocket(AF_INET6, SOCK_STREAM, IPPROTO_TCP, NULL, 0, WSA_FLAG_OVERLAPPED);
|
||||
SOCKET s = ::WSASocket(AF_INET6, SOCK_STREAM, IPPROTO_TCP, nullptr, 0, WSA_FLAG_OVERLAPPED);
|
||||
if (s != INVALID_SOCKET) {
|
||||
const int ipv6only = 0;
|
||||
if (setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, reinterpret_cast<const char*>(&ipv6only), sizeof(ipv6only)) == 0) {
|
||||
@ -106,7 +106,7 @@ void SslServer::incomingConnection(qintptr v) {
|
||||
|
||||
QSslSocket *SslServer::nextPendingSSLConnection() {
|
||||
if (qlSockets.isEmpty())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
return qlSockets.takeFirst();
|
||||
}
|
||||
|
||||
@ -114,14 +114,14 @@ Server::Server(int snum, QObject *p) : QThread(p) {
|
||||
bValid = true;
|
||||
iServerNum = snum;
|
||||
#ifdef USE_BONJOUR
|
||||
bsRegistration = NULL;
|
||||
bsRegistration = nullptr;
|
||||
#endif
|
||||
bUsingMetaCert = false;
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
aiNotify[0] = aiNotify[1] = -1;
|
||||
#else
|
||||
hNotify = NULL;
|
||||
hNotify = nullptr;
|
||||
#endif
|
||||
qtTimeout = new QTimer(this);
|
||||
|
||||
@ -129,7 +129,7 @@ Server::Server(int snum, QObject *p) : QThread(p) {
|
||||
bPreferAlpha = false;
|
||||
bOpus = true;
|
||||
|
||||
qnamNetwork = NULL;
|
||||
qnamNetwork = nullptr;
|
||||
|
||||
readParams();
|
||||
initialize();
|
||||
@ -176,10 +176,10 @@ Server::Server(int snum, QObject *p) : QThread(p) {
|
||||
#ifndef SIO_UDP_CONNRESET
|
||||
#define SIO_UDP_CONNRESET _WSAIOW(IOC_VENDOR,12)
|
||||
#endif
|
||||
SOCKET sock = ::WSASocket(addr.ss_family, SOCK_DGRAM, IPPROTO_UDP, NULL, 0, WSA_FLAG_OVERLAPPED);
|
||||
SOCKET sock = ::WSASocket(addr.ss_family, SOCK_DGRAM, IPPROTO_UDP, nullptr, 0, WSA_FLAG_OVERLAPPED);
|
||||
DWORD dwBytesReturned = 0;
|
||||
BOOL bNewBehaviour = FALSE;
|
||||
if (WSAIoctl(sock, SIO_UDP_CONNRESET, &bNewBehaviour, sizeof(bNewBehaviour), NULL, 0, &dwBytesReturned, NULL, NULL) == SOCKET_ERROR) {
|
||||
if (WSAIoctl(sock, SIO_UDP_CONNRESET, &bNewBehaviour, sizeof(bNewBehaviour), nullptr, 0, &dwBytesReturned, nullptr, nullptr) == SOCKET_ERROR) {
|
||||
log(QString("Failed to set SIO_UDP_CONNRESET: %1").arg(WSAGetLastError()));
|
||||
}
|
||||
#endif
|
||||
@ -241,7 +241,7 @@ Server::Server(int snum, QObject *p) : QThread(p) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
hNotify = CreateEvent(NULL, FALSE, FALSE, NULL);
|
||||
hNotify = CreateEvent(nullptr, FALSE, FALSE, nullptr);
|
||||
#endif
|
||||
|
||||
connect(this, SIGNAL(tcpTransmit(QByteArray, unsigned int)), this, SLOT(tcpTransmitData(QByteArray, unsigned int)), Qt::QueuedConnection);
|
||||
@ -642,7 +642,7 @@ void Server::initBonjour() {
|
||||
|
||||
void Server::removeBonjour() {
|
||||
delete bsRegistration;
|
||||
bsRegistration = NULL;
|
||||
bsRegistration = nullptr;
|
||||
log("Stopped announcing server via bonjour");
|
||||
}
|
||||
#endif
|
||||
@ -738,7 +738,7 @@ void Server::run() {
|
||||
STACKVAR(HANDLE, events, nfds+1);
|
||||
for (int i=0;i<nfds;++i) {
|
||||
fds[i] = qlUdpSocket.at(i);
|
||||
events[i] = CreateEvent(NULL, FALSE, FALSE, NULL);
|
||||
events[i] = CreateEvent(nullptr, FALSE, FALSE, nullptr);
|
||||
::WSAEventSelect(fds[i], events[i], FD_READ);
|
||||
}
|
||||
events[nfds] = hNotify;
|
||||
@ -875,8 +875,8 @@ void Server::run() {
|
||||
}
|
||||
qrwlVoiceThread.unlock();
|
||||
rl.relock();
|
||||
if (u != NULL && !qhUsers.contains(uiSession))
|
||||
u = NULL;
|
||||
if (u && !qhUsers.contains(uiSession))
|
||||
u = nullptr;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -916,7 +916,7 @@ void Server::run() {
|
||||
}
|
||||
#ifdef Q_OS_WIN
|
||||
for (int i=0;i<nfds-1;++i) {
|
||||
::WSAEventSelect(fds[i], NULL, 0);
|
||||
::WSAEventSelect(fds[i], nullptr, 0);
|
||||
CloseHandle(events[i]);
|
||||
}
|
||||
#endif
|
||||
@ -1512,7 +1512,7 @@ void Server::sslError(const QList<QSslError> &errors) {
|
||||
// Because abort() tears down a lot of internal state
|
||||
// of the QSslSocket, inlcuding the 'SSL *' object
|
||||
// associated with the socket, this is fatal and leads
|
||||
// to crashes, such as attempting to derefernce a NULL
|
||||
// to crashes, such as attempting to derefernce a nullptr
|
||||
// 'SSL *' object.
|
||||
//
|
||||
// To avoid this, we use a non-forceful disconnect
|
||||
@ -1609,7 +1609,7 @@ void Server::connectionClosed(QAbstractSocket::SocketError err, const QString &r
|
||||
}
|
||||
|
||||
void Server::message(unsigned int uiType, const QByteArray &qbaMsg, ServerUser *u) {
|
||||
if (u == NULL) {
|
||||
if (!u) {
|
||||
u = static_cast<ServerUser *>(sender());
|
||||
}
|
||||
|
||||
@ -1726,7 +1726,7 @@ void Server::sendProtoMessage(ServerUser *u, const ::google::protobuf::Message &
|
||||
}
|
||||
|
||||
void Server::sendProtoAll(const ::google::protobuf::Message &msg, unsigned int msgType, unsigned int version) {
|
||||
sendProtoExcept(NULL, msg, msgType, version);
|
||||
sendProtoExcept(nullptr, msg, msgType, version);
|
||||
}
|
||||
|
||||
void Server::sendProtoExcept(ServerUser *u, const ::google::protobuf::Message &msg, unsigned int msgType, unsigned int version) {
|
||||
@ -1747,12 +1747,12 @@ void Server::removeChannel(Channel *chan, Channel *dest) {
|
||||
Channel *c;
|
||||
User *p;
|
||||
|
||||
if (dest == NULL)
|
||||
if (!dest)
|
||||
dest = chan->cParent;
|
||||
|
||||
{
|
||||
QWriteLocker wl(&qrwlVoiceThread);
|
||||
chan->unlink(NULL);
|
||||
chan->unlink(nullptr);
|
||||
}
|
||||
|
||||
foreach(c, chan->qlChannels) {
|
||||
@ -1855,7 +1855,7 @@ void Server::userEnterChannel(User *p, Channel *c, MumbleProto::UserState &mpus)
|
||||
QWriteLocker wl(&qrwlVoiceThread);
|
||||
c->addUser(p);
|
||||
|
||||
bool mayspeak = ChanACL::hasPermission(static_cast<ServerUser *>(p), c, ChanACL::Speak, NULL);
|
||||
bool mayspeak = ChanACL::hasPermission(static_cast<ServerUser *>(p), c, ChanACL::Speak, nullptr);
|
||||
bool sup = p->bSuppress;
|
||||
|
||||
if (mayspeak == sup) {
|
||||
@ -2076,7 +2076,7 @@ void Server::recheckCodecVersions(ServerUser *connectingUser) {
|
||||
iCodecBeta = version;
|
||||
} else if (bOpus == enableOpus) {
|
||||
if (bOpus && connectingUser && !connectingUser->bOpus) {
|
||||
sendTextMessage(NULL, connectingUser, false, QLatin1String("<strong>WARNING:</strong> Your client doesn't support the Opus codec the server is using, you won't be able to talk or hear anyone. Please upgrade to a client with Opus support."));
|
||||
sendTextMessage(nullptr, connectingUser, false, QLatin1String("<strong>WARNING:</strong> Your client doesn't support the Opus codec the server is using, you won't be able to talk or hear anyone. Please upgrade to a client with Opus support."));
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -2096,7 +2096,7 @@ void Server::recheckCodecVersions(ServerUser *connectingUser) {
|
||||
// Only authenticated users and the currently connecting user (if recheck is called in that context) have a reliable u->bOpus.
|
||||
if((u->sState == ServerUser::Authenticated || u == connectingUser)
|
||||
&& !u->bOpus) {
|
||||
sendTextMessage(NULL, u, false, QLatin1String("<strong>WARNING:</strong> Your client doesn't support the Opus codec the server is switching to, you won't be able to talk or hear anyone. Please upgrade to a client with Opus support."));
|
||||
sendTextMessage(nullptr, u, false, QLatin1String("<strong>WARNING:</strong> Your client doesn't support the Opus codec the server is switching to, you won't be able to talk or hear anyone. Please upgrade to a client with Opus support."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -68,7 +68,7 @@ class SslServer : public QTcpServer {
|
||||
void incomingConnection(qintptr) Q_DECL_OVERRIDE;
|
||||
public:
|
||||
QSslSocket *nextPendingSSLConnection();
|
||||
SslServer(QObject *parent = NULL);
|
||||
SslServer(QObject *parent = nullptr);
|
||||
|
||||
/// Checks whether the AF_INET6 socket on this system has dual-stack support.
|
||||
static bool hasDualStackSupport();
|
||||
@ -199,7 +199,7 @@ class Server : public QThread {
|
||||
void newClient();
|
||||
void connectionClosed(QAbstractSocket::SocketError, const QString &);
|
||||
void sslError(const QList<QSslError> &);
|
||||
void message(unsigned int, const QByteArray &, ServerUser *cCon = NULL);
|
||||
void message(unsigned int, const QByteArray &, ServerUser *cCon = nullptr);
|
||||
void checkTimeout();
|
||||
void tcpTransmitData(QByteArray, unsigned int);
|
||||
void doSync(unsigned int);
|
||||
@ -296,7 +296,7 @@ class Server : public QThread {
|
||||
QFlags<ChanACL::Perm> effectivePermissions(ServerUser *p, Channel *c);
|
||||
void sendClientPermission(ServerUser *u, Channel *c, bool updatelast = false);
|
||||
void flushClientPermissionCache(ServerUser *u, MumbleProto::PermissionQuery &mpqq);
|
||||
void clearACLCache(User *p = NULL);
|
||||
void clearACLCache(User *p = nullptr);
|
||||
void clearWhisperTargetCache();
|
||||
|
||||
void sendProtoAll(const ::google::protobuf::Message &msg, unsigned int msgType, unsigned int minversion);
|
||||
@ -325,14 +325,14 @@ class Server : public QThread {
|
||||
void log(ServerUser *u, const QString &) const;
|
||||
|
||||
void removeChannel(int id);
|
||||
void removeChannel(Channel *c, Channel *dest = NULL);
|
||||
void removeChannel(Channel *c, Channel *dest = nullptr);
|
||||
void userEnterChannel(User *u, Channel *c, MumbleProto::UserState &mpus);
|
||||
bool unregisterUser(int id);
|
||||
|
||||
Server(int snum, QObject *parent = NULL);
|
||||
Server(int snum, QObject *parent = nullptr);
|
||||
~Server();
|
||||
|
||||
bool canNest(Channel *newParent, Channel *channel = NULL) const;
|
||||
bool canNest(Channel *newParent, Channel *channel = nullptr) const;
|
||||
|
||||
// RPC functions. Implementation in RPC.cpp
|
||||
void connectAuthenticator(QObject *p);
|
||||
@ -340,7 +340,7 @@ class Server : public QThread {
|
||||
void connectListener(QObject *p);
|
||||
void disconnectListener(QObject *p);
|
||||
void setTempGroups(int userid, int sessionId, Channel *cChannel, const QStringList &groups);
|
||||
void clearTempGroups(User *user, Channel *cChannel = NULL, bool recurse = true);
|
||||
void clearTempGroups(User *user, Channel *cChannel = nullptr, bool recurse = true);
|
||||
void startListeningToChannel(ServerUser *user, Channel *cChannel);
|
||||
void stopListeningToChannel(ServerUser *user, Channel *cChannel);
|
||||
signals:
|
||||
@ -403,7 +403,7 @@ class Server : public QThread {
|
||||
int authenticate(QString &name, const QString &pw, int sessionId = 0, const QStringList &emails = QStringList(), const QString &certhash = QString(), bool bStrongCert = false, const QList<QSslCertificate> & = QList<QSslCertificate>());
|
||||
Channel *addChannel(Channel *c, const QString &name, bool temporary = false, int position = 0, unsigned int maxUsers = 0);
|
||||
void removeChannelDB(const Channel *c);
|
||||
void readChannels(Channel *p = NULL);
|
||||
void readChannels(Channel *p = nullptr);
|
||||
void readLinks();
|
||||
void updateChannel(const Channel *c);
|
||||
void readChannelPrivs(Channel *c);
|
||||
|
||||
@ -62,7 +62,7 @@ class TransactionHolder {
|
||||
}
|
||||
};
|
||||
|
||||
QSqlDatabase *ServerDB::db = NULL;
|
||||
QSqlDatabase *ServerDB::db = nullptr;
|
||||
Timer ServerDB::tLogClean;
|
||||
QString ServerDB::qsUpgradeSuffix;
|
||||
|
||||
@ -692,7 +692,7 @@ ServerDB::ServerDB() {
|
||||
ServerDB::~ServerDB() {
|
||||
db->close();
|
||||
delete db;
|
||||
db = NULL;
|
||||
db = nullptr;
|
||||
}
|
||||
|
||||
bool ServerDB::prepare(QSqlQuery &query, const QString &str, bool fatal, bool warn) {
|
||||
@ -1483,7 +1483,7 @@ void ServerDB::setSUPW(int srvnum, const QString &pw) {
|
||||
}
|
||||
|
||||
void ServerDB::disableSU(int srvnum) {
|
||||
writeSUPW(srvnum, QString(), QString(), QVariant()); // NULL, NULL, NULL
|
||||
writeSUPW(srvnum, QString(), QString(), QVariant()); // nullptr, nullptr, nullptr
|
||||
}
|
||||
|
||||
QString ServerDB::getLegacySHA1Hash(const QString &password) {
|
||||
@ -2003,7 +2003,7 @@ void Server::dumpChannel(const Channel *c) {
|
||||
ChanACL *acl;
|
||||
int pid;
|
||||
|
||||
if (c == NULL) {
|
||||
if (!c) {
|
||||
c = qhChannels.value(0);
|
||||
}
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
# include "Utils.h"
|
||||
#endif
|
||||
|
||||
ServerUser::ServerUser(Server *p, QSslSocket *socket) : Connection(p, socket), User(), s(NULL), leakyBucket(p->iMessageLimit, p->iMessageBurst) {
|
||||
ServerUser::ServerUser(Server *p, QSslSocket *socket) : Connection(p, socket), User(), s(nullptr), leakyBucket(p->iMessageLimit, p->iMessageBurst) {
|
||||
sState = ServerUser::Connected;
|
||||
sUdpSocket = INVALID_SOCKET;
|
||||
|
||||
|
||||
@ -38,7 +38,7 @@ Tray::Tray(QObject *p, LogEmitter *logger) : QObject(p) {
|
||||
|
||||
// Can't construct a QMenu which decends from QObject, and qsti is a QObject.
|
||||
// Qt bug?
|
||||
qm = new QMenu(tr("Murmur"), NULL);
|
||||
qm = new QMenu(tr("Murmur"), nullptr);
|
||||
qm->addAction(qaShowLog);
|
||||
qm->addSeparator();
|
||||
qm->addAction(qaAbout);
|
||||
@ -59,13 +59,13 @@ void Tray::on_Tray_activated(QSystemTrayIcon::ActivationReason r) {
|
||||
}
|
||||
|
||||
void Tray::on_Quit_triggered() {
|
||||
if (QMessageBox::question(NULL, tr("Murmur"), tr("Are you sure you want to quit Murmur?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::Yes) {
|
||||
if (QMessageBox::question(nullptr, tr("Murmur"), tr("Are you sure you want to quit Murmur?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::Yes) {
|
||||
qApp->quit();
|
||||
}
|
||||
}
|
||||
|
||||
void Tray::on_About_triggered() {
|
||||
AboutDialog ad(NULL);
|
||||
AboutDialog ad(nullptr);
|
||||
ad.exec();
|
||||
}
|
||||
|
||||
|
||||
@ -135,21 +135,21 @@ UnixMurmur::UnixMurmur() {
|
||||
sigemptyset(&hup.sa_mask);
|
||||
hup.sa_flags = SA_RESTART;
|
||||
|
||||
if (sigaction(SIGHUP, &hup, NULL))
|
||||
if (sigaction(SIGHUP, &hup, nullptr))
|
||||
qFatal("Failed to install SIGHUP handler");
|
||||
|
||||
term.sa_handler = termSignalHandler;
|
||||
sigemptyset(&term.sa_mask);
|
||||
term.sa_flags = SA_RESTART;
|
||||
|
||||
if (sigaction(SIGTERM, &term, NULL))
|
||||
if (sigaction(SIGTERM, &term, nullptr))
|
||||
qFatal("Failed to install SIGTERM handler");
|
||||
|
||||
usr1.sa_handler = usr1SignalHandler;
|
||||
sigemptyset(&usr1.sa_mask);
|
||||
usr1.sa_flags = SA_RESTART;
|
||||
|
||||
if (sigaction(SIGUSR1, &usr1, NULL))
|
||||
if (sigaction(SIGUSR1, &usr1, nullptr))
|
||||
qFatal("Failed to install SIGUSR1 handler");
|
||||
|
||||
umask(S_IRWXO);
|
||||
@ -160,9 +160,9 @@ UnixMurmur::~UnixMurmur() {
|
||||
delete qsnTerm;
|
||||
delete qsnUsr1;
|
||||
|
||||
qsnHup = NULL;
|
||||
qsnTerm = NULL;
|
||||
qsnUsr1 = NULL;
|
||||
qsnHup = nullptr;
|
||||
qsnTerm = nullptr;
|
||||
qsnUsr1 = nullptr;
|
||||
|
||||
close(iHupFd[0]);
|
||||
close(iHupFd[1]);
|
||||
|
||||
@ -43,7 +43,7 @@
|
||||
# include <sys/syslog.h>
|
||||
#endif
|
||||
|
||||
QFile *qfLog = NULL;
|
||||
QFile *qfLog = nullptr;
|
||||
|
||||
static bool bVerbose = false;
|
||||
#ifdef QT_NO_DEBUG
|
||||
@ -53,10 +53,10 @@ static bool detach = false;
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
static UnixMurmur *unixMurmur = NULL;
|
||||
static UnixMurmur *unixMurmur = nullptr;
|
||||
#endif
|
||||
|
||||
Meta *meta = NULL;
|
||||
Meta *meta = nullptr;
|
||||
|
||||
static LogEmitter le;
|
||||
|
||||
@ -145,7 +145,7 @@ static void murmurMessageOutputQString(QtMsgType type, const QString &msg) {
|
||||
fprintf(stderr, "%s", qPrintable(m));
|
||||
}
|
||||
#else
|
||||
::MessageBoxA(NULL, qPrintable(m), "Murmur", MB_OK | MB_ICONWARNING);
|
||||
::MessageBoxA(nullptr, qPrintable(m), "Murmur", MB_OK | MB_ICONWARNING);
|
||||
#endif
|
||||
exit(1);
|
||||
}
|
||||
@ -176,7 +176,7 @@ int main(int argc, char **argv) {
|
||||
|
||||
#define MMXSSE 0x02800000
|
||||
if ((cpuinfo[3] & MMXSSE) != MMXSSE) {
|
||||
::MessageBoxA(NULL, "Mumble requires a SSE capable processor (Pentium 3 / Ahtlon-XP)", "Mumble", MB_OK | MB_ICONERROR);
|
||||
::MessageBoxA(nullptr, "Mumble requires a SSE capable processor (Pentium 3 / Ahtlon-XP)", "Mumble", MB_OK | MB_ICONERROR);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
@ -252,7 +252,7 @@ int main(int argc, char **argv) {
|
||||
qInstallMessageHandler(murmurMessageOutputWithContext);
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
Tray tray(NULL, &le);
|
||||
Tray tray(nullptr, &le);
|
||||
#endif
|
||||
|
||||
QStringList args = a.arguments();
|
||||
@ -311,7 +311,7 @@ int main(int argc, char **argv) {
|
||||
return 0;
|
||||
} else if (args.at(i) == QLatin1String("-license") || args.at(i) == QLatin1String("--license")) {
|
||||
#ifdef Q_OS_WIN
|
||||
AboutDialog ad(NULL, AboutDialogOptionsShowLicense);
|
||||
AboutDialog ad(nullptr, AboutDialogOptionsShowLicense);
|
||||
ad.exec();
|
||||
return 0;
|
||||
#else
|
||||
@ -320,7 +320,7 @@ int main(int argc, char **argv) {
|
||||
#endif
|
||||
} else if (args.at(i) == QLatin1String("-authors") || args.at(i) == QLatin1String("--authors")) {
|
||||
#ifdef Q_OS_WIN
|
||||
AboutDialog ad(NULL, AboutDialogOptionsShowAuthors);
|
||||
AboutDialog ad(nullptr, AboutDialogOptionsShowAuthors);
|
||||
ad.exec();
|
||||
return 0;
|
||||
#else
|
||||
@ -329,7 +329,7 @@ int main(int argc, char **argv) {
|
||||
#endif
|
||||
} else if (args.at(i) == QLatin1String("-third-party-licenses") || args.at(i) == QLatin1String("--third-party-licenses")) {
|
||||
#ifdef Q_OS_WIN
|
||||
AboutDialog ad(NULL, AboutDialogOptionsShowThirdPartyLicenses);
|
||||
AboutDialog ad(nullptr, AboutDialogOptionsShowThirdPartyLicenses);
|
||||
ad.exec();
|
||||
return 0;
|
||||
#else
|
||||
@ -422,7 +422,7 @@ int main(int argc, char **argv) {
|
||||
qfLog = new QFile(Meta::mp.qsLogfile);
|
||||
if (! qfLog->open(QIODevice::WriteOnly | QIODevice::Append | QIODevice::Text)) {
|
||||
delete qfLog;
|
||||
qfLog = NULL;
|
||||
qfLog = nullptr;
|
||||
#ifdef Q_OS_UNIX
|
||||
fprintf(stderr, "murmurd: failed to open logfile %s: no logging will be done\n", qPrintable(Meta::mp.qsLogfile));
|
||||
#else
|
||||
@ -463,7 +463,7 @@ int main(int argc, char **argv) {
|
||||
char *p;
|
||||
|
||||
printf("Password: ");
|
||||
fflush(NULL);
|
||||
fflush(nullptr);
|
||||
if (fgets(password, 255, stdin) != password)
|
||||
qFatal("No password provided");
|
||||
p = strchr(password, '\r');
|
||||
@ -616,7 +616,7 @@ int main(int argc, char **argv) {
|
||||
|
||||
#ifdef USE_DBUS
|
||||
delete MurmurDBus::qdbc;
|
||||
MurmurDBus::qdbc = NULL;
|
||||
MurmurDBus::qdbc = nullptr;
|
||||
#endif
|
||||
|
||||
#ifdef USE_ICE
|
||||
@ -628,11 +628,11 @@ int main(int argc, char **argv) {
|
||||
#endif
|
||||
|
||||
delete qfLog;
|
||||
qfLog = NULL;
|
||||
qfLog = nullptr;
|
||||
|
||||
delete meta;
|
||||
|
||||
qInstallMessageHandler(NULL);
|
||||
qInstallMessageHandler(nullptr);
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
if (! Meta::mp.qsPid.isEmpty()) {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
class Slotter : public QObject {
|
||||
Q_OBJECT;
|
||||
public:
|
||||
Slotter(QObject *p = NULL) : QObject(p) {};
|
||||
Slotter(QObject *p = nullptr) : QObject(p) {};
|
||||
public Q_SLOTS:
|
||||
virtual void slottest(int &res) {
|
||||
res+= 1;
|
||||
|
||||
@ -49,7 +49,7 @@ class PosixLock {
|
||||
};
|
||||
|
||||
PosixLock::PosixLock() {
|
||||
pthread_mutex_init(&m, NULL);
|
||||
pthread_mutex_init(&m, nullptr);
|
||||
}
|
||||
|
||||
void PosixLock::lock() {
|
||||
|
||||
@ -47,12 +47,12 @@ class OverlayWidget : public QWidget {
|
||||
void error(QLocalSocket::LocalSocketError);
|
||||
void update();
|
||||
public:
|
||||
OverlayWidget(QWidget *p = NULL);
|
||||
OverlayWidget(QWidget *p = nullptr);
|
||||
};
|
||||
|
||||
OverlayWidget::OverlayWidget(QWidget *p) : QWidget(p) {
|
||||
qlsSocket = NULL;
|
||||
smMem = NULL;
|
||||
qlsSocket = nullptr;
|
||||
smMem = nullptr;
|
||||
uiWidth = uiHeight = 0;
|
||||
|
||||
setFocusPolicy(Qt::StrongFocus);
|
||||
@ -123,10 +123,10 @@ void OverlayWidget::detach() {
|
||||
if (qlsSocket) {
|
||||
qlsSocket->abort();
|
||||
qlsSocket->deleteLater();
|
||||
qlsSocket = NULL;
|
||||
qlsSocket = nullptr;
|
||||
}
|
||||
if (smMem) {
|
||||
smMem = NULL;
|
||||
smMem = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@ -230,7 +230,7 @@ void OverlayWidget::readyRead() {
|
||||
if (! smMem->data()) {
|
||||
qWarning() << "SHMEM FAIL";
|
||||
delete smMem;
|
||||
smMem = NULL;
|
||||
smMem = nullptr;
|
||||
} else {
|
||||
qWarning() << "SHMEM" << smMem->size();
|
||||
}
|
||||
|
||||
@ -94,7 +94,7 @@ int main(int argc, char **argv) {
|
||||
pfOutput[i] = 0;
|
||||
|
||||
|
||||
IppsResamplingPolyphaseFixed_32f *pSpec = NULL;
|
||||
IppsResamplingPolyphaseFixed_32f *pSpec = nullptr;
|
||||
ippsResamplePolyphaseFixedInitAlloc_32f(&pSpec, iMicFreq, iSampleRate, 2*history, 0.90f, 8.0f, ippAlgHintFast);
|
||||
|
||||
t.restart();
|
||||
|
||||
@ -153,7 +153,7 @@ void TestCrypt::testvectors() {
|
||||
cs.setKey(rawkey_str, rawkey_str, rawkey_str);
|
||||
|
||||
unsigned char tag[16];
|
||||
QVERIFY(cs.ocb_encrypt(NULL, NULL, 0, rawkey, tag));
|
||||
QVERIFY(cs.ocb_encrypt(nullptr, nullptr, 0, rawkey, tag));
|
||||
|
||||
const unsigned char blanktag[AES_BLOCK_SIZE] = {0xBF,0x31,0x08,0x13,0x07,0x73,0xAD,0x5E,0xC7,0x0E,0xC6,0x9E,0x78,0x75,0xA7,0xB0};
|
||||
for (int i=0;i<AES_BLOCK_SIZE;i++)
|
||||
|
||||
@ -40,20 +40,20 @@ struct LinkedMem {
|
||||
wchar_t description[2048];
|
||||
};
|
||||
|
||||
LinkedMem *lm = NULL;
|
||||
LinkedMem *lm = nullptr;
|
||||
|
||||
|
||||
void initMumble() {
|
||||
|
||||
#ifdef WIN32
|
||||
HANDLE hMapObject = OpenFileMappingW(FILE_MAP_ALL_ACCESS, FALSE, L"MumbleLink");
|
||||
if (hMapObject == NULL)
|
||||
if (!hMapObject)
|
||||
return;
|
||||
|
||||
lm = (LinkedMem *) MapViewOfFile(hMapObject, FILE_MAP_ALL_ACCESS, 0, 0, sizeof(LinkedMem));
|
||||
if (lm == NULL) {
|
||||
if (!lm) {
|
||||
CloseHandle(hMapObject);
|
||||
hMapObject = NULL;
|
||||
hMapObject = nullptr;
|
||||
return;
|
||||
}
|
||||
#else
|
||||
@ -66,10 +66,10 @@ void initMumble() {
|
||||
return;
|
||||
}
|
||||
|
||||
lm = (LinkedMem *)(mmap(NULL, sizeof(struct LinkedMem), PROT_READ | PROT_WRITE, MAP_SHARED, shmfd,0));
|
||||
lm = (LinkedMem *)(mmap(nullptr, sizeof(struct LinkedMem), PROT_READ | PROT_WRITE, MAP_SHARED, shmfd,0));
|
||||
|
||||
if (lm == (void *)(-1)) {
|
||||
lm = NULL;
|
||||
lm = nullptr;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
@ -133,7 +133,7 @@ int main(int argc, char **argv) {
|
||||
QCoreApplication a(argc, argv);
|
||||
|
||||
initMumble();
|
||||
if (lm == NULL)
|
||||
if (!lm)
|
||||
qFatal("No Link!");
|
||||
|
||||
lm->fAvatarPosition[0];
|
||||
|
||||
Loading…
Reference in New Issue
Block a user