summaryrefslogtreecommitdiffstats
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 /Swiften/Base
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 'Swiften/Base')
-rw-r--r--Swiften/Base/BoostRandomGenerator.cpp2
-rw-r--r--Swiften/Base/ByteArray.h4
-rw-r--r--Swiften/Base/FileSize.cpp2
3 files changed, 4 insertions, 4 deletions
diff --git a/Swiften/Base/BoostRandomGenerator.cpp b/Swiften/Base/BoostRandomGenerator.cpp
index 8db3ca6..d893d4d 100644
--- a/Swiften/Base/BoostRandomGenerator.cpp
+++ b/Swiften/Base/BoostRandomGenerator.cpp
@@ -16,7 +16,7 @@ namespace Swift {
BoostRandomGenerator::BoostRandomGenerator() {
// FIXME: Not a good seed
- generator.seed(static_cast<unsigned int>(std::time(0)));
+ generator.seed(static_cast<unsigned int>(std::time(nullptr)));
}
int BoostRandomGenerator::generateRandomInteger(int maximum) {
diff --git a/Swiften/Base/ByteArray.h b/Swiften/Base/ByteArray.h
index c0babdf..b567b5a 100644
--- a/Swiften/Base/ByteArray.h
+++ b/Swiften/Base/ByteArray.h
@@ -33,12 +33,12 @@ namespace Swift {
template<typename T, typename A>
static const T* vecptr(const std::vector<T, A>& v) {
- return v.empty() ? NULL : &v[0];
+ return v.empty() ? nullptr : &v[0];
}
template<typename T, typename A>
static T* vecptr(std::vector<T, A>& v) {
- return v.empty() ? NULL : &v[0];
+ return v.empty() ? nullptr : &v[0];
}
SWIFTEN_API std::string byteArrayToString(const ByteArray& b);
diff --git a/Swiften/Base/FileSize.cpp b/Swiften/Base/FileSize.cpp
index d9ab5ec..a335337 100644
--- a/Swiften/Base/FileSize.cpp
+++ b/Swiften/Base/FileSize.cpp
@@ -11,7 +11,7 @@
namespace Swift {
std::string formatSize(const boost::uintmax_t bytes) {
- static const char *siPrefix[] = {"k", "M", "G", "T", "P", "E", "Z", "Y", NULL};
+ static const char *siPrefix[] = {"k", "M", "G", "T", "P", "E", "Z", "Y", nullptr};
int power = 0;
double engBytes = bytes;
while (engBytes >= 1000) {