summaryrefslogtreecommitdiffstats
path: root/Sluift
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2016-04-01 12:36:16 (GMT)
committerTobias Markmann <tm@ayena.de>2016-04-01 15:56:34 (GMT)
commiteddd92ed76ae68cb1e202602fd3ebd11b69191a2 (patch)
tree8d396e5801d77a2f0ee4ab8e4c5093d8cf8118e6 /Sluift
parenta79db8d446e152b715f435550c2a6e10a36ee532 (diff)
downloadswift-eddd92ed76ae68cb1e202602fd3ebd11b69191a2.zip
swift-eddd92ed76ae68cb1e202602fd3ebd11b69191a2.tar.bz2
Modernize code to use C++11 nullptr using clang-tidy
Run 'clang-tidy -fix -checks=modernize-use-nullptr' on all source code files on OS X. This does not modernize platform specific code on Linux and Windows Test-Information: Code builds and unit tests pass on OS X 10.11.4. Change-Id: Ic43ffeb1b76c1a933a55af03db3c54977f5f60dd
Diffstat (limited to 'Sluift')
-rw-r--r--Sluift/EditlineTerminal.cpp4
-rw-r--r--Sluift/Lua/Check.cpp2
-rw-r--r--Sluift/SluiftClient.cpp4
-rw-r--r--Sluift/SluiftComponent.cpp4
-rw-r--r--Sluift/Terminal.cpp4
-rw-r--r--Sluift/main.cpp4
-rw-r--r--Sluift/sluift.cpp2
7 files changed, 12 insertions, 12 deletions
diff --git a/Sluift/EditlineTerminal.cpp b/Sluift/EditlineTerminal.cpp
index fc62142..206ced6 100644
--- a/Sluift/EditlineTerminal.cpp
+++ b/Sluift/EditlineTerminal.cpp
@@ -22,7 +22,7 @@
using namespace Swift;
-static EditlineTerminal* globalInstance = NULL;
+static EditlineTerminal* globalInstance = nullptr;
static int completionStart = -1;
static int completionEnd = -1;
@@ -50,7 +50,7 @@ static char* getCompletions(const char*, int state) {
}
}
if (boost::numeric_cast<size_t>(state) >= completions.size()) {
- return 0;
+ return nullptr;
}
return strdup(completions[boost::numeric_cast<size_t>(state)].c_str());
}
diff --git a/Sluift/Lua/Check.cpp b/Sluift/Lua/Check.cpp
index 74c44be..74a247a 100644
--- a/Sluift/Lua/Check.cpp
+++ b/Sluift/Lua/Check.cpp
@@ -40,7 +40,7 @@ int Lua::checkIntNumber(lua_State* L, int arg) {
}
std::string Lua::checkString(lua_State* L, int arg) {
- const char *s = lua_tolstring(L, arg, NULL);
+ const char *s = lua_tolstring(L, arg, nullptr);
if (!s) {
throw Lua::Exception(getArgTypeError(L, arg, LUA_TSTRING));
}
diff --git a/Sluift/SluiftClient.cpp b/Sluift/SluiftClient.cpp
index fea3291..8bbb530 100644
--- a/Sluift/SluiftClient.cpp
+++ b/Sluift/SluiftClient.cpp
@@ -29,7 +29,7 @@ SluiftClient::SluiftClient(
SimpleEventLoop* eventLoop) :
networkFactories(networkFactories),
eventLoop(eventLoop),
- tracer(NULL) {
+ tracer(nullptr) {
client = new Client(jid, password, networkFactories);
client->setAlwaysTrustCertificates();
client->onDisconnected.connect(boost::bind(&SluiftClient::handleDisconnected, this, _1));
@@ -64,7 +64,7 @@ void SluiftClient::setTraceEnabled(bool b) {
}
else if (!b && tracer) {
delete tracer;
- tracer = NULL;
+ tracer = nullptr;
}
}
diff --git a/Sluift/SluiftComponent.cpp b/Sluift/SluiftComponent.cpp
index c0dcd3c..6abe800 100644
--- a/Sluift/SluiftComponent.cpp
+++ b/Sluift/SluiftComponent.cpp
@@ -28,7 +28,7 @@ SluiftComponent::SluiftComponent(
SimpleEventLoop* eventLoop):
networkFactories(networkFactories),
eventLoop(eventLoop),
- tracer(NULL) {
+ tracer(nullptr) {
component = new Component(jid, password, networkFactories);
component->onError.connect(boost::bind(&SluiftComponent::handleError, this, _1));
component->onMessageReceived.connect(boost::bind(&SluiftComponent::handleIncomingMessage, this, _1));
@@ -51,7 +51,7 @@ void SluiftComponent::setTraceEnabled(bool b) {
}
else if (!b && tracer) {
delete tracer;
- tracer = NULL;
+ tracer = nullptr;
}
}
diff --git a/Sluift/Terminal.cpp b/Sluift/Terminal.cpp
index db1332a..4b54a87 100644
--- a/Sluift/Terminal.cpp
+++ b/Sluift/Terminal.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -8,7 +8,7 @@
using namespace Swift;
-Terminal::Terminal() : completer(NULL) {
+Terminal::Terminal() : completer(nullptr) {
}
Terminal::~Terminal() {
diff --git a/Sluift/main.cpp b/Sluift/main.cpp
index 6953ca6..85fa17d 100644
--- a/Sluift/main.cpp
+++ b/Sluift/main.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013-2014 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -46,7 +46,7 @@ static const luaL_Reg defaultLibraries[] = {
{LUA_MATHLIBNAME, luaopen_math},
{LUA_DBLIBNAME, luaopen_debug},
{"sluift", luaopen_sluift},
- {NULL, NULL}
+ {nullptr, nullptr}
};
static void handleInterruptSignal(int) {
diff --git a/Sluift/sluift.cpp b/Sluift/sluift.cpp
index aff4533..549ae01 100644
--- a/Sluift/sluift.cpp
+++ b/Sluift/sluift.cpp
@@ -419,7 +419,7 @@ SLUIFT_LUA_FUNCTION(iTunes, get_current_track) {
* Module registration
******************************************************************************/
-static const luaL_Reg sluift_functions[] = { {NULL, NULL} };
+static const luaL_Reg sluift_functions[] = { {nullptr, nullptr} };
SLUIFT_API int luaopen_sluift(lua_State* L) {
// Initialize & store the module table