]> git.lyx.org Git - lyx.git/blobdiff - src/support/lassert.cpp
Correct comment
[lyx.git] / src / support / lassert.cpp
index fa2ffb063c8ee5446558729d7d7e37fdac348495..dcf8acd0112983019d8efa4fa028e60f1d4a71ed 100644 (file)
@@ -59,8 +59,8 @@ docstring formatHelper(docstring const & msg,
 {
        docstring const d = _("Assertion %1$s violated in\nfile: %2$s, line: %3$s");
        LYXERR0("ASSERTION " << expr << " VIOLATED IN " << file << ":" << line);
-       
-       return bformat(d, from_ascii(expr), from_ascii(file), 
+
+       return bformat(d, from_ascii(expr), from_ascii(file),
                convert<docstring>(line)) + '\n' + msg;
 }
 
@@ -70,7 +70,7 @@ void doWarnIf(char const * expr, char const * file, long line)
        docstring const d = _("It should be safe to continue, but you\nmay wish to save your work and restart LyX.");
        // comment this out if not needed
        doAssertWithCallstack(false);
-       throw ExceptionMessage(WarningException, _("Warning!"), 
+       throw ExceptionMessage(WarningException, _("Warning!"),
                formatHelper(d, expr, file, line));
 }
 
@@ -101,17 +101,17 @@ docstring printCallStack()
        return docstring();
 #else
        const int depth = 200;
-       
+
        // get void*'s for all entries on the stack
        void* array[depth];
        size_t size = backtrace(array, depth);
-       
+
        char** messages = backtrace_symbols(array, size);
-       
+
        docstring bt;
-       for (size_t i = 1; i < size && messages != NULL; i++) {
+       for (size_t i = 1; i < size && messages != nullptr; 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);