]> git.lyx.org Git - features.git/commitdiff
Fix warnings in support/.
authorRichard Kimberly Heck <rikiheck@lyx.org>
Sat, 29 Feb 2020 05:00:47 +0000 (00:00 -0500)
committerRichard Kimberly Heck <rikiheck@lyx.org>
Sat, 29 Feb 2020 05:06:35 +0000 (00:06 -0500)
src/support/ForkedCalls.cpp
src/support/convert.cpp
src/support/docstream.cpp
src/support/filetools.cpp
src/support/gzstream.cpp
src/support/lassert.cpp
src/support/lyxtime.cpp

index f81c1d20a96764889df90f8a4219662543d79cdf..1318bd3ec2910156eb548e47f79c3711eb65261a 100644 (file)
@@ -374,7 +374,7 @@ int ForkedCall::generateChild()
                        argv.push_back(&*it);
                prev = *it;
        }
-       argv.push_back(0);
+       argv.push_back(nullptr);
 
        // Debug output.
        if (lyxerr.debugging(Debug::FILES)) {
index 9455643a667800f931143c8fd4dc060d1fb533a8..74b12822017ce85f0bd6a5043ef219040215df7f 100644 (file)
@@ -179,49 +179,49 @@ docstring convert<docstring>(double d)
 template<>
 int convert<int>(string const s)
 {
-       return strtol(s.c_str(), 0, 10);
+       return strtol(s.c_str(), nullptr, 10);
 }
 
 
 template<>
 int convert<int>(docstring const s)
 {
-       return strtol(to_ascii(s).c_str(), 0, 10);
+       return strtol(to_ascii(s).c_str(), nullptr, 10);
 }
 
 
 template<>
 unsigned int convert<unsigned int>(string const s)
 {
-       return strtoul(s.c_str(), 0, 10);
+       return strtoul(s.c_str(), nullptr, 10);
 }
 
 
 template<>
 unsigned long convert<unsigned long>(string const s)
 {
-       return strtoul(s.c_str(), 0, 10);
+       return strtoul(s.c_str(), nullptr, 10);
 }
 
 
 template<>
 double convert<double>(string const s)
 {
-       return strtod(s.c_str(), 0);
+       return strtod(s.c_str(), nullptr);
 }
 
 
 template<>
 int convert<int>(char const * cptr)
 {
-       return strtol(cptr, 0, 10);
+       return strtol(cptr, nullptr, 10);
 }
 
 
 template<>
 double convert<double>(char const * cptr)
 {
-       return strtod(cptr, 0);
+       return strtod(cptr, nullptr);
 }
 
 
index f8964cae6022a032b86b92f47ce0f03e1bb3b491..eef5b0361e8b2376c386ba27abb74008e2fe5933 100644 (file)
@@ -120,7 +120,7 @@ protected:
                // As a workaround, we append a nul char in order to force
                // a switch to ASCII, and then remove it from output after
                // the conversion.
-               intern_type * from_new = 0;
+               intern_type * from_new = nullptr;
                intern_type const * from_old = from;
                size_t extra = 0;
                if (*(from_end - 1) >= 0x80 && encoding_ == "ISO-2022-JP") {
index a34ee225f9a1dea000c8e692bfc4d2e98d851787..d17d04cc5e83c80707ce488712a750db8bda87a1 100644 (file)
@@ -110,7 +110,7 @@ bool isBinaryFile(FileName const & filename)
        magic_t magic_cookie = magic_open(MAGIC_MIME_ENCODING);
        if (magic_cookie) {
                bool detected = true;
-               if (magic_load(magic_cookie, NULL) != 0) {
+               if (magic_load(magic_cookie, nullptr) != 0) {
                        LYXERR(Debug::FILES, "isBinaryFile: "
                                "Could not load magic database - "
                                << magic_error(magic_cookie));
index dfad9956bdf4b5a588536263b9ef54b6b032e709..232e86bb3d5487ab7284d50c3593d7774489476c 100644 (file)
@@ -51,12 +51,12 @@ namespace GZSTREAM_NAMESPACE {
 
 gzstreambuf* gzstreambuf::open( const char* name, int open_mode) {
     if ( is_open())
-        return (gzstreambuf*)0;
+               return (gzstreambuf*)(nullptr);
     mode = open_mode;
     // no append nor read/write mode
     if ((mode & ios::ate) || (mode & ios::app)
         || ((mode & ios::in) && (mode & ios::out)))
-        return (gzstreambuf*)0;
+               return (gzstreambuf*)(nullptr);
     char  fmode[10];
     char* fmodeptr = fmode;
     if ( mode & ios::in)
@@ -66,8 +66,8 @@ gzstreambuf* gzstreambuf::open( const char* name, int open_mode) {
     *fmodeptr++ = 'b';
     *fmodeptr = '\0';
     file = gzopen( name, fmode);
-    if (file == 0)
-        return (gzstreambuf*)0;
+       if (file == nullptr)
+               return (gzstreambuf*)(nullptr);
     opened = 1;
     return this;
 }
@@ -79,7 +79,7 @@ gzstreambuf * gzstreambuf::close() {
         if ( gzclose( file) == Z_OK)
             return this;
     }
-    return (gzstreambuf*)0;
+       return (gzstreambuf*)(nullptr);
 }
 
 int gzstreambuf::underflow() { // used for input buffer only
index c690dbcee03a213a2a10c771dc5ea1c945f50d7b..26347494806954df63603a8cc271f620026dad8b 100644 (file)
@@ -111,7 +111,7 @@ docstring printCallStack()
        docstring bt;
        for (size_t i = 1; i < size && messages != NULL; i++) {
                const std::string orig(messages[i]);
-               char* mangled = 0;
+               char* mangled = nullptr;
                for (char *p = messages[i]; *p; ++p) {
                        if (*p == '(') {
                                *p = 0;
@@ -122,7 +122,8 @@ docstring printCallStack()
                        }
                }
                int status = 0;
-               const char* demangled = abi::__cxa_demangle(mangled, 0, 0, &status);
+               const char* demangled =
+                       abi::__cxa_demangle(mangled, nullptr, nullptr, &status);
                const QByteArray line = QString("(%1) %2: %3\n").arg(i, 3).arg(messages[i])
                                                                .arg(demangled ? demangled : orig.c_str()).toLocal8Bit();
                free((void*)demangled);
index f3318eb3f0e35aeea8bf98021c1fb84a1061c11e..c155ed428d531426c66e16eb21777ff72c327aa4 100644 (file)
@@ -27,7 +27,7 @@ namespace support {
 
 time_t current_time()
 {
-       return time(0);
+       return time(nullptr);
 }