[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kdb] src: Add missing initializations
From:       Jaroslaw Staniek <staniek () kde ! org>
Date:       2016-04-02 21:01:59
Message-ID: E1amSgB-00023e-Vu () scm ! kde ! org
[Download RAW message or body]

Git commit c681f8ab8396dd3b54d4208e6908a4fd130223c5 by Jaroslaw Staniek.
Committed on 31/03/2016 at 19:28.
Pushed by staniek into branch 'master'.

Add missing initializations

(thanks to clang analyzer)

M  +3    -2    src/KDb.cpp

http://commits.kde.org/kdb/c681f8ab8396dd3b54d4208e6908a4fd130223c5

diff --git a/src/KDb.cpp b/src/KDb.cpp
index 8460a05..aa8b7c2 100644
--- a/src/KDb.cpp
+++ b/src/KDb.cpp
@@ -411,7 +411,7 @@ void KDb::getHTMLErrorMesage(const KDbResultable& resultable, QString *msg, QStr
     if (!result.recentSQLString().isEmpty())
         *details += QLatin1String("<p><b>") + kdb::tr("SQL statement:")
                    + QString::fromLatin1("</b> <tt>%1</tt>").arg(result.recentSQLString().toString());
-    int serverErrorCode;
+    int serverErrorCode = 0;
     QString serverResultName;
     if (result.isError()) {
         serverErrorCode = result.serverErrorCode();
@@ -1742,7 +1742,8 @@ QVariant KDb::cstringToVariant(const char* data, KDbField::Type type, bool *ok,
         }
     }
     if (KDbField::isFPNumericType(type)) {
-        return KDb::iif(*thisOk, QVariant(QString::fromLatin1(data, length).toDouble(thisOk)));
+        const QVariant result(QString::fromLatin1(data, length).toDouble(thisOk));
+        return KDb::iif(*thisOk, result);
     }
     if (type == KDbField::BLOB) {
         *thisOk = length >= 0;

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic