Commit 3b6574b8 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

GIT_SILENT: use nullptr now

parent c39bde51
......@@ -44,8 +44,8 @@ void KLdapTest::initTestCase()
The specified server should not be a production server in case we break anything here.
You have been warned!
*/
m_search = Q_NULLPTR;
m_model = Q_NULLPTR;
m_search = nullptr;
m_model = nullptr;
QString filename(QStringLiteral("testurl.txt"));
QFile file(filename);
......
......@@ -288,7 +288,7 @@ void LDAPProtocol::setHost(const QString &host, quint16 port,
mServer.setPort(port);
} else {
struct servent *pse;
if ((pse = getservbyname(mProtocol, "tcp")) == Q_NULLPTR) {
if ((pse = getservbyname(mProtocol, "tcp")) == nullptr) {
if (mProtocol == "ldaps") {
mServer.setPort(636);
} else {
......
......@@ -183,7 +183,7 @@ int Ber::printf(QString format, ...)
for (j = 0; j < v->count(); j++) {
l[j] = v->at(j).data();
}
l[j] = Q_NULLPTR;
l[j] = nullptr;
ret = ber_printf(d->mBer, fmt, l.data());
break;
}
......@@ -197,7 +197,7 @@ int Ber::printf(QString format, ...)
bvs[j].bv_len = V->at(j).size();
bv[j] = &bvs[j];
}
bv[V->count()] = Q_NULLPTR;
bv[V->count()] = nullptr;
ret = ber_printf(d->mBer, fmt, bv.data());
break;
}
......
......@@ -155,7 +155,7 @@ Qt::DropActions LdapAttributeProxyModel::supportedDropActions() const
QMimeData *LdapAttributeProxyModel::mimeData(const QModelIndexList &indexes) const
{
Q_UNUSED(indexes);
return Q_NULLPTR;
return nullptr;
}
bool LdapAttributeProxyModel::dropMimeData(const QMimeData *data, Qt::DropAction action,
......
......@@ -32,7 +32,7 @@ class KLDAP_EXPORT LdapAttributeProxyModel : public QSortFilterProxyModel
{
Q_OBJECT
public:
explicit LdapAttributeProxyModel(QObject *parent = Q_NULLPTR);
explicit LdapAttributeProxyModel(QObject *parent = nullptr);
~LdapAttributeProxyModel();
QVariant data(const QModelIndex &index, int role) const Q_DECL_OVERRIDE;
......
......@@ -43,7 +43,7 @@ class Q_DECL_HIDDEN LdapConfigWidget::Private
{
public:
Private(LdapConfigWidget *parent)
: mParent(parent), mFeatures(W_ALL), mProg(Q_NULLPTR)
: mParent(parent), mFeatures(W_ALL), mProg(nullptr)
{
mainLayout = new QGridLayout(mParent);
mainLayout->setMargin(0);
......@@ -89,12 +89,12 @@ void LdapConfigWidget::Private::initWidget()
{
QLabel *label;
mUser = mPassword = mHost = mDn = mBindDn = mRealm = mFilter = Q_NULLPTR;
mPort = mVersion = mTimeLimit = mSizeLimit = Q_NULLPTR;
mAnonymous = mSimple = mSASL = mSecNo = mSecTLS = mSecSSL = Q_NULLPTR;
mEditButton = mQueryMech = Q_NULLPTR;
mPageSize = Q_NULLPTR;
mMech = Q_NULLPTR;
mUser = mPassword = mHost = mDn = mBindDn = mRealm = mFilter = nullptr;
mPort = mVersion = mTimeLimit = mSizeLimit = nullptr;
mAnonymous = mSimple = mSASL = mSecNo = mSecTLS = mSecSSL = nullptr;
mEditButton = mQueryMech = nullptr;
mPageSize = nullptr;
mMech = nullptr;
int row = 0;
int col;
......@@ -349,7 +349,7 @@ void LdapConfigWidget::Private::sendQuery()
return;
}
if (mProg == Q_NULLPTR) {
if (mProg == nullptr) {
mProg = new QProgressDialog(mParent);
mProg->setWindowTitle(i18n("LDAP Query"));
mProg->setModal(true);
......@@ -756,7 +756,7 @@ QString LdapConfigWidget::filter() const
void LdapConfigWidget::setMech(const QString &mech)
{
if (d->mMech == Q_NULLPTR) {
if (d->mMech == nullptr) {
return;
}
if (!mech.isEmpty()) {
......
......@@ -99,9 +99,9 @@ public:
* @param parent the QWidget parent
* @param fl the window flags to set
*/
explicit LdapConfigWidget(QWidget *parent = Q_NULLPTR, Qt::WindowFlags fl = 0);
explicit LdapConfigWidget(QWidget *parent = nullptr, Qt::WindowFlags fl = 0);
/** Constructs a configuration widget */
explicit LdapConfigWidget(WinFlags flags, QWidget *parent = Q_NULLPTR,
explicit LdapConfigWidget(WinFlags flags, QWidget *parent = nullptr,
Qt::WindowFlags fl = 0);
/** Destructs a configuration widget */
virtual ~LdapConfigWidget();
......
......@@ -29,14 +29,14 @@
#ifdef SASL2_FOUND
#include <sasl/sasl.h>
static const sasl_callback_t callbacks[] = {
{ SASL_CB_ECHOPROMPT, Q_NULLPTR, Q_NULLPTR },
{ SASL_CB_NOECHOPROMPT, Q_NULLPTR, Q_NULLPTR },
{ SASL_CB_GETREALM, Q_NULLPTR, Q_NULLPTR },
{ SASL_CB_USER, Q_NULLPTR, Q_NULLPTR },
{ SASL_CB_AUTHNAME, Q_NULLPTR, Q_NULLPTR },
{ SASL_CB_PASS, Q_NULLPTR, Q_NULLPTR },
{ SASL_CB_CANON_USER, Q_NULLPTR, Q_NULLPTR },
{ SASL_CB_LIST_END, Q_NULLPTR, Q_NULLPTR }
{ SASL_CB_ECHOPROMPT, nullptr, nullptr },
{ SASL_CB_NOECHOPROMPT, nullptr, nullptr },
{ SASL_CB_GETREALM, nullptr, nullptr },
{ SASL_CB_USER, nullptr, nullptr },
{ SASL_CB_AUTHNAME, nullptr, nullptr },
{ SASL_CB_PASS, nullptr, nullptr },
{ SASL_CB_CANON_USER, nullptr, nullptr },
{ SASL_CB_LIST_END, nullptr, nullptr }
};
static bool ldapoperation_sasl_initialized = false;
......@@ -80,10 +80,10 @@ public:
LdapConnection::LdapConnectionPrivate::LdapConnectionPrivate()
{
mSASLconn = Q_NULLPTR;
mSASLconn = nullptr;
#ifdef SASL2_FOUND
if (!ldapoperation_sasl_initialized) {
sasl_client_init(Q_NULLPTR);
sasl_client_init(nullptr);
ldapoperation_sasl_initialized = true;
}
#endif
......@@ -92,20 +92,20 @@ LdapConnection::LdapConnectionPrivate::LdapConnectionPrivate()
LdapConnection::LdapConnection()
: d(new LdapConnectionPrivate)
{
d->mLDAP = Q_NULLPTR;
d->mLDAP = nullptr;
}
LdapConnection::LdapConnection(const LdapUrl &url)
: d(new LdapConnectionPrivate)
{
d->mLDAP = Q_NULLPTR;
d->mLDAP = nullptr;
setUrl(url);
}
LdapConnection::LdapConnection(const LdapServer &server)
: d(new LdapConnectionPrivate)
{
d->mLDAP = Q_NULLPTR;
d->mLDAP = nullptr;
setServer(server);
}
......@@ -299,7 +299,7 @@ int LdapConnection::connect()
if (d->mServer.security() == LdapServer::TLS) {
qCDebug(LDAP_LOG) << "start TLS";
#ifdef HAVE_LDAP_START_TLS_S
if ((ret = ldap_start_tls_s(d->mLDAP, Q_NULLPTR, Q_NULLPTR)) != LDAP_SUCCESS) {
if ((ret = ldap_start_tls_s(d->mLDAP, nullptr, nullptr)) != LDAP_SUCCESS) {
d->mConnectionError = ldapErrorString();
close();
return ret;
......@@ -334,7 +334,7 @@ int LdapConnection::connect()
#ifdef SASL2_FOUND
qCDebug(LDAP_LOG) << "initializing SASL client";
int saslresult = sasl_client_new("ldap", d->mServer.host().toLatin1(),
Q_NULLPTR, Q_NULLPTR, callbacks, 0, &d->mSASLconn);
nullptr, nullptr, callbacks, 0, &d->mSASLconn);
if (saslresult != SASL_OK) {
d->mConnectionError = i18n("Cannot initialize the SASL client.");
return KLDAP_SASL_ERROR;
......@@ -348,16 +348,16 @@ void LdapConnection::close()
{
if (d->mLDAP) {
#ifdef HAVE_LDAP_UNBIND_EXT
ldap_unbind_ext(d->mLDAP, Q_NULLPTR, Q_NULLPTR);
ldap_unbind_ext(d->mLDAP, nullptr, nullptr);
#else
ldap_unbind(d->mLDAP);
#endif
}
d->mLDAP = Q_NULLPTR;
d->mLDAP = nullptr;
#ifdef SASL2_FOUND
if (d->mSASLconn) {
sasl_dispose(&d->mSASLconn);
d->mSASLconn = Q_NULLPTR;
d->mSASLconn = nullptr;
}
#endif
qCDebug(LDAP_LOG) << "connection closed!";
......
......@@ -253,7 +253,7 @@ Qt::DropActions LdapModel::supportedDropActions() const
QMimeData *LdapModel::mimeData(const QModelIndexList &indexes) const
{
Q_UNUSED(indexes);
return Q_NULLPTR;
return nullptr;
}
bool LdapModel::dropMimeData(const QMimeData *data, Qt::DropAction action,
......
......@@ -61,7 +61,7 @@ public:
* \see setConnection()
* \see ready()
*/
explicit LdapModel(QObject *parent = Q_NULLPTR);
explicit LdapModel(QObject *parent = nullptr);
/**
* Constructs an LdapModel. Clients of this class should connect a slot to the ready()
* signal before setting this model onto a view.
......@@ -70,7 +70,7 @@ public:
* \see setConnection()
* \see ready()
*/
explicit LdapModel(LdapConnection &connection, QObject *parent = Q_NULLPTR);
explicit LdapModel(LdapConnection &connection, QObject *parent = nullptr);
virtual ~LdapModel();
/**
......
......@@ -33,7 +33,7 @@ LdapModel::LdapModelPrivate::LdapModelPrivate(LdapModel *parent)
m_searchResultObjects(),
m_baseDN(),
m_searchType(NotSearching),
m_searchItem(Q_NULLPTR)
m_searchItem(nullptr)
{
}
......@@ -44,7 +44,7 @@ LdapModel::LdapModelPrivate::LdapModelPrivate(LdapModel *parent, LdapConnection
m_searchResultObjects(),
m_baseDN(),
m_searchType(NotSearching),
m_searchItem(Q_NULLPTR)
m_searchItem(nullptr)
{
}
......@@ -147,7 +147,7 @@ void LdapModel::LdapModelPrivate::gotSearchResult(KLDAP::LdapSearch *search)
// Create items that represent objects down to the baseDN
LdapModelDNNode *parent = rootNode();
LdapModelDNNode *item = Q_NULLPTR;
LdapModelDNNode *item = nullptr;
for (int i = 0; i < depth; ++i) {
QString dn = baseDN().toString(i);
qCDebug(LDAP_LOG) << "Creating item for DN :" << dn;
......
......@@ -91,7 +91,7 @@ public:
return m_baseDN;
}
void setSearchType(SearchType t, LdapModelDNNode *item = Q_NULLPTR);
void setSearchType(SearchType t, LdapModelDNNode *item = nullptr);
SearchType searchType()
{
......
......@@ -41,7 +41,7 @@ class LdapModelDNNode;
class LdapModelNode
{
public:
explicit LdapModelNode(LdapModelDNNode *parent = Q_NULLPTR);
explicit LdapModelNode(LdapModelDNNode *parent = nullptr);
virtual ~LdapModelNode();
enum NodeType {
......@@ -78,7 +78,7 @@ private:
class LdapModelDNNode : public LdapModelNode
{
public:
explicit LdapModelDNNode(LdapModelDNNode *parent = Q_NULLPTR,
explicit LdapModelDNNode(LdapModelDNNode *parent = nullptr,
const LdapDN &dn = LdapDN());
~LdapModelDNNode();
......@@ -122,7 +122,7 @@ private:
class LdapModelAttrNode : public LdapModelNode
{
public:
explicit LdapModelAttrNode(LdapModelDNNode *parent = Q_NULLPTR,
explicit LdapModelAttrNode(LdapModelDNNode *parent = nullptr,
const QString &attrName = QString(),
const QByteArray &attrData = QByteArray());
~LdapModelAttrNode();
......
......@@ -91,7 +91,7 @@ public:
LdapOperation::LdapOperation()
: d(new LdapOperationPrivate)
{
d->mConnection = Q_NULLPTR;
d->mConnection = nullptr;
}
LdapOperation::LdapOperation(LdapConnection &conn)
......@@ -171,7 +171,7 @@ QByteArray LdapOperation::serverCred() const
}
LdapOperation::LdapOperationPrivate::LdapOperationPrivate()
: mConnection(Q_NULLPTR)
: mConnection(nullptr)
{
}
......@@ -230,7 +230,7 @@ static int kldap_sasl_interact(sasl_interact_t *interact, LdapOperation::SASL_Da
break;
}
if (value.isEmpty()) {
interact->result = Q_NULLPTR;
interact->result = nullptr;
interact->len = 0;
} else {
interact->result = strdup(value.toUtf8());
......@@ -256,10 +256,10 @@ int LdapOperation::LdapOperationPrivate::bind(const QByteArray &creds,
if (server.auth() == LdapServer::SASL) {
#if defined( SASL2_FOUND ) && !defined( HAVE_WINLDAP_H )
sasl_conn_t *saslconn = (sasl_conn_t *)mConnection->saslHandle();
sasl_interact_t *client_interact = Q_NULLPTR;
const char *out = Q_NULLPTR;
sasl_interact_t *client_interact = nullptr;
const char *out = nullptr;
uint outlen;
const char *mechusing = Q_NULLPTR;
const char *mechusing = nullptr;
struct berval ccred, *scred;
int saslresult;
QByteArray sdata = creds;
......@@ -322,7 +322,7 @@ int LdapOperation::LdapOperationPrivate::bind(const QByteArray &creds,
int msgid;
ret =
ldap_sasl_bind(ld, server.bindDn().toUtf8().data(), mech.toLatin1(),
&ccred, Q_NULLPTR, Q_NULLPTR, &msgid);
&ccred, nullptr, nullptr, &msgid);
if (ret == 0) {
ret = msgid;
}
......@@ -331,7 +331,7 @@ int LdapOperation::LdapOperationPrivate::bind(const QByteArray &creds,
qCDebug(LDAP_LOG) << "ldap_sasl_bind_s";
ret =
ldap_sasl_bind_s(ld, server.bindDn().toUtf8().data(), mech.toLatin1(),
&ccred, Q_NULLPTR, Q_NULLPTR, &scred);
&ccred, nullptr, nullptr, &scred);
qCDebug(LDAP_LOG) << "ldap_sasl_bind_s ret" << ret;
if (scred) {
sdata = QByteArray(scred->bv_val, scred->bv_len);
......@@ -360,7 +360,7 @@ int LdapOperation::LdapOperationPrivate::bind(const QByteArray &creds,
qCDebug(LDAP_LOG) << "ldap_sasl_bind (simple)";
#ifndef HAVE_WINLDAP_H
int msgid = 0;
ret = ldap_sasl_bind(ld, bindname.data(), Q_NULLPTR, &ccred, Q_NULLPTR, Q_NULLPTR, &msgid);
ret = ldap_sasl_bind(ld, bindname.data(), nullptr, &ccred, nullptr, nullptr, &msgid);
if (ret == 0) {
ret = msgid;
}
......@@ -370,7 +370,7 @@ int LdapOperation::LdapOperationPrivate::bind(const QByteArray &creds,
} else {
qCDebug(LDAP_LOG) << "ldap_sasl_bind_s (simple)";
#ifndef HAVE_WINLDAP_H
ret = ldap_sasl_bind_s(ld, bindname.data(), Q_NULLPTR, &ccred, Q_NULLPTR, Q_NULLPTR, Q_NULLPTR);
ret = ldap_sasl_bind_s(ld, bindname.data(), nullptr, &ccred, nullptr, nullptr, nullptr);
#else
ret = ldap_simple_bind_s(ld, bindname.data(), pass.data());
#endif
......@@ -401,12 +401,12 @@ int LdapOperation::LdapOperationPrivate::processResult(int rescode, LDAPMessage
// iterate over the attributes
name = ldap_first_attribute(ld, msg, &entry);
while (name != Q_NULLPTR) {
while (name != nullptr) {
// print the values
bvals = ldap_get_values_len(ld, msg, name);
LdapAttrValue values;
if (bvals) {
for (int i = 0; bvals[i] != Q_NULLPTR; i++) {
for (int i = 0; bvals[i] != nullptr; i++) {
char *val = bvals[i]->bv_val;
unsigned long len = bvals[i]->bv_len;
values.append(QByteArray(val, len));
......@@ -442,7 +442,7 @@ int LdapOperation::LdapOperationPrivate::processResult(int rescode, LDAPMessage
break;
}
case RES_BIND: {
struct berval *servercred = Q_NULLPTR;
struct berval *servercred = nullptr;
#ifndef HAVE_WINLDAP_H
// FIXME: Error handling Winldap does not have ldap_parse_sasl_bind_result
retval = ldap_parse_sasl_bind_result(ld, msg, &servercred, 0);
......@@ -464,8 +464,8 @@ int LdapOperation::LdapOperationPrivate::processResult(int rescode, LDAPMessage
break;
}
default: {
LDAPControl **serverctrls = Q_NULLPTR;
char *matcheddn = Q_NULLPTR, *errmsg = Q_NULLPTR;
LDAPControl **serverctrls = nullptr;
char *matcheddn = nullptr, *errmsg = nullptr;
char **referralsp;
int errcodep;
retval =
......@@ -510,7 +510,7 @@ int LdapOperation::LdapOperationPrivate::processResult(int rescode, LDAPMessage
}
static void addModOp(LDAPMod ***pmods, int mod_type, const QString &attr,
const QByteArray *value = Q_NULLPTR)
const QByteArray *value = nullptr)
{
// qCDebug(LDAP_LOG) << "type:" << mod_type << "attr:" << attr <<
// "value:" << QString::fromUtf8(value,value.size()) <<
......@@ -521,38 +521,38 @@ static void addModOp(LDAPMod ***pmods, int mod_type, const QString &attr,
uint i = 0;
if (mods == Q_NULLPTR) {
if (mods == nullptr) {
mods = (LDAPMod **)malloc(2 * sizeof(LDAPMod *));
mods[ 0 ] = (LDAPMod *)malloc(sizeof(LDAPMod));
mods[ 1 ] = Q_NULLPTR;
mods[ 1 ] = nullptr;
memset(mods[ 0 ], 0, sizeof(LDAPMod));
} else {
while (mods[ i ] != Q_NULLPTR &&
while (mods[ i ] != nullptr &&
(strcmp(attr.toUtf8(), mods[i]->mod_type) != 0 ||
(mods[ i ]->mod_op & ~LDAP_MOD_BVALUES) != mod_type)) {
i++;
}
if (mods[ i ] == Q_NULLPTR) {
if (mods[ i ] == nullptr) {
mods = (LDAPMod **)realloc(mods, (i + 2) * sizeof(LDAPMod *));
if (mods == Q_NULLPTR) {
if (mods == nullptr) {
qCritical() << "addModOp: realloc";
return;
}
mods[ i + 1 ] = Q_NULLPTR;
mods[ i + 1 ] = nullptr;
mods[ i ] = (LDAPMod *) malloc(sizeof(LDAPMod));
memset(mods[ i ], 0, sizeof(LDAPMod));
}
}
mods[ i ]->mod_op = mod_type | LDAP_MOD_BVALUES;
if (mods[ i ]->mod_type == Q_NULLPTR) {
if (mods[ i ]->mod_type == nullptr) {
mods[ i ]->mod_type = strdup(attr.toUtf8());
}
*pmods = mods;
if (value == Q_NULLPTR) {
if (value == nullptr) {
return;
}
......@@ -564,30 +564,30 @@ static void addModOp(LDAPMod ***pmods, int mod_type, const QString &attr,
berval -> bv_val = (char *) malloc(vallen);
memcpy(berval -> bv_val, value->data(), vallen);
} else {
berval -> bv_val = Q_NULLPTR;
berval -> bv_val = nullptr;
}
if (mods[ i ] -> mod_vals.modv_bvals == Q_NULLPTR) {
if (mods[ i ] -> mod_vals.modv_bvals == nullptr) {
mods[ i ]->mod_vals.modv_bvals =
(BerValue **) malloc(sizeof(BerValue *) * 2);
mods[ i ]->mod_vals.modv_bvals[ 0 ] = berval;
mods[ i ]->mod_vals.modv_bvals[ 1 ] = Q_NULLPTR;
mods[ i ]->mod_vals.modv_bvals[ 1 ] = nullptr;
// qCDebug(LDAP_LOG) << "new bervalue struct" << attr << value;
} else {
uint j = 0;
while (mods[ i ]->mod_vals.modv_bvals[ j ] != Q_NULLPTR) {
while (mods[ i ]->mod_vals.modv_bvals[ j ] != nullptr) {
j++;
}
mods[ i ]->mod_vals.modv_bvals =
(BerValue **)realloc(mods[ i ]->mod_vals.modv_bvals,
(j + 2) * sizeof(BerValue *));
if (mods[ i ]->mod_vals.modv_bvals == Q_NULLPTR) {
if (mods[ i ]->mod_vals.modv_bvals == nullptr) {
qCritical() << "addModOp: realloc";
free(berval);
return;
}
mods[ i ]->mod_vals.modv_bvals[ j ] = berval;
mods[ i ]->mod_vals.modv_bvals[ j + 1 ] = Q_NULLPTR;
mods[ i ]->mod_vals.modv_bvals[ j + 1 ] = nullptr;
qCDebug(LDAP_LOG) << j << ". new bervalue";
}
}
......@@ -607,22 +607,22 @@ static void addControlOp(LDAPControl ***pctrls, const QString &oid,
ctrl->ldctl_value.bv_val = (char *) malloc(vallen);
memcpy(ctrl->ldctl_value.bv_val, value.data(), vallen);
} else {
ctrl->ldctl_value.bv_val = Q_NULLPTR;
ctrl->ldctl_value.bv_val = nullptr;
}
ctrl->ldctl_iscritical = critical;
ctrl->ldctl_oid = strdup(oid.toUtf8());
uint i = 0;
if (ctrls == Q_NULLPTR) {
if (ctrls == nullptr) {
ctrls = (LDAPControl **)malloc(2 * sizeof(LDAPControl *));
ctrls[ 0 ] = Q_NULLPTR;
ctrls[ 1 ] = Q_NULLPTR;
ctrls[ 0 ] = nullptr;
ctrls[ 1 ] = nullptr;
} else {
while (ctrls[ i ] != Q_NULLPTR) {
while (ctrls[ i ] != nullptr) {
i++;
}
ctrls[ i + 1 ] = Q_NULLPTR;
ctrls[ i + 1 ] = nullptr;
ctrls =
(LDAPControl **)realloc(ctrls, (i + 2) * sizeof(LDAPControl *));
}
......@@ -670,10 +670,10 @@ int LdapOperation::search(const LdapDN &base, LdapUrl::Scope scope,
Q_ASSERT(d->mConnection);
LDAP *ld = (LDAP *) d->mConnection->handle();
char **attrs = Q_NULLPTR;
char **attrs = nullptr;
int msgid;
LDAPControl **serverctrls = Q_NULLPTR, **clientctrls = Q_NULLPTR;
LDAPControl **serverctrls = nullptr, **clientctrls = nullptr;
createControls(&serverctrls, d->mServerCtrls);
createControls(&serverctrls, d->mClientCtrls);
......@@ -683,7 +683,7 @@ int LdapOperation::search(const LdapDN &base, LdapUrl::Scope scope,
for (int i = 0; i < count; i++) {
attrs[i] = strdup(attributes.at(i).toUtf8());
}
attrs[count] = Q_NULLPTR;
attrs[count] = nullptr;
}
int lscope = LDAP_SCOPE_BASE;
......@@ -707,7 +707,7 @@ int LdapOperation::search(const LdapDN &base, LdapUrl::Scope scope,
ldap_search_ext(ld, base.toString().toUtf8().data(), lscope,
filter.isEmpty() ? QByteArray("objectClass=*").data() :
filter.toUtf8().data(),
attrs, 0, serverctrls, clientctrls, Q_NULLPTR,
attrs, 0, serverctrls, clientctrls, nullptr,
d->mConnection->sizeLimit(), &msgid);
ldap_controls_free(serverctrls);
......@@ -733,9 +733,9 @@ int LdapOperation::add(const LdapObject &object)
LDAP *ld = (LDAP *) d->mConnection->handle();
int msgid;
LDAPMod **lmod = Q_NULLPTR;
LDAPMod **lmod = nullptr;
LDAPControl **serverctrls = Q_NULLPTR, **clientctrls = Q_NULLPTR;
LDAPControl **serverctrls = nullptr, **clientctrls = nullptr;
createControls(&serverctrls, d->mServerCtrls);
createControls(&serverctrls, d->mClientCtrls);
......@@ -765,9 +765,9 @@ int LdapOperation::add_s(const LdapObject &object)
Q_ASSERT(d->mConnection);
LDAP *ld = (LDAP *) d->mConnection->handle();
LDAPMod **lmod = Q_NULLPTR;
LDAPMod **lmod = nullptr;
LDAPControl **serverctrls = Q_NULLPTR, **clientctrls = Q_NULLPTR;
LDAPControl **serverctrls = nullptr, **clientctrls = nullptr;
createControls(&serverctrls, d->mServerCtrls);
createControls(&serverctrls, d->mClientCtrls);
......@@ -795,9 +795,9 @@ int LdapOperation::add(const LdapDN &dn, const ModOps &ops)
LDAP *ld = (LDAP *) d->mConnection->handle();
int msgid;
LDAPMod **lmod = Q_NULLPTR;
LDAPMod **lmod = nullptr;
LDAPControl **serverctrls = Q_NULLPTR, **clientctrls = Q_NULLPTR;
LDAPControl **serverctrls = nullptr, **clientctrls = nullptr;
createControls(&serverctrls, d->mServerCtrls);
createControls(&serverctrls, d->mClientCtrls);
......@@ -825,9 +825,9 @@ int LdapOperation::add_s(const LdapDN &dn, const ModOps &ops)
Q_ASSERT(d->mConnection);
LDAP *ld = (LDAP *) d->mConnection->handle();
LDAPMod **lmod = Q_NULLPTR;
LDAPMod **lmod = nullptr;
LDAPControl **serverctrls = Q_NULLPTR, **clientctrls = Q_NULLPTR;
LDAPControl **serverctrls = nullptr, **clientctrls = nullptr;
createControls(&serverctrls, d->mServerCtrls);
createControls(&serverctrls, d->mClientCtrls);
......@@ -855,12 +855,12 @@ int LdapOperation::rename(const LdapDN &dn, const QString &newRdn,