From 55f5c9f21b900cbc334afc9d80c84491d6f0ab81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Thu, 15 Feb 2018 17:23:44 +0100 Subject: [PATCH] Use FMT_NULL instead of 0 is a few more places. Found with GCC and -Wzero-as-null-pointer-constant --- include/fmt/core.h | 2 +- include/fmt/posix.cc | 2 +- include/fmt/posix.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/fmt/core.h b/include/fmt/core.h index 0b91e0d5..31960a8f 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -172,7 +172,7 @@ class basic_string_view { typedef Char char_type; typedef const Char *iterator; - FMT_CONSTEXPR basic_string_view() FMT_NOEXCEPT : data_(0), size_(0) {} + FMT_CONSTEXPR basic_string_view() FMT_NOEXCEPT : data_(FMT_NULL), size_(0) {} /** Constructs a string reference object from a C string and a size. */ FMT_CONSTEXPR basic_string_view(const Char *s, size_t size) FMT_NOEXCEPT diff --git a/include/fmt/posix.cc b/include/fmt/posix.cc index 67513b07..76414842 100644 --- a/include/fmt/posix.cc +++ b/include/fmt/posix.cc @@ -71,7 +71,7 @@ fmt::BufferedFile::~BufferedFile() FMT_NOEXCEPT { fmt::BufferedFile::BufferedFile( fmt::cstring_view filename, fmt::cstring_view mode) { - FMT_RETRY_VAL(file_, FMT_SYSTEM(fopen(filename.c_str(), mode.c_str())), 0); + FMT_RETRY_VAL(file_, FMT_SYSTEM(fopen(filename.c_str(), mode.c_str())), FMT_NULL); if (!file_) FMT_THROW(system_error(errno, "cannot open file {}", filename.c_str())); } diff --git a/include/fmt/posix.h b/include/fmt/posix.h index 1be9a87e..30f7b904 100644 --- a/include/fmt/posix.h +++ b/include/fmt/posix.h @@ -134,7 +134,7 @@ class BufferedFile { public: // Constructs a BufferedFile object which doesn't represent any file. - BufferedFile() FMT_NOEXCEPT : file_(0) {} + BufferedFile() FMT_NOEXCEPT : file_(FMT_NULL) {} // Destroys the object closing the file it represents if any. FMT_API ~BufferedFile() FMT_DTOR_NOEXCEPT;