]> vaikene.ee Git - evaf/blobdiff - src/libs/Common/inifile.cpp
Warning fixes and copyright update.
[evaf] / src / libs / Common / inifile.cpp
index 55b9fd782a2548945fcbdd8e54cc70954d4e7618..ebdfd73affa70de1f0c75be772a31c541613d1f3 100644 (file)
@@ -3,7 +3,7 @@
  * @brief Internal implementation of the class for reading and writing parameter values in INI files.
  * @author Enar Vaikene
  *
- * Copyright (c) 2011 Enar Vaikene
+ * Copyright (c) 2011-2019 Enar Vaikene
  *
  * This file is part of the eVaf C++ cross-platform application development framework.
  *
@@ -96,7 +96,7 @@ IniFileImpl::~IniFileImpl()
     mCache.clear();
 }
 
-void IniFileImpl::updateCache(quint64 pos, qint64 diff)
+void IniFileImpl::updateCache(qint64 pos, qint64 diff)
 {
     // Walk through all the sections in the cache
     QHash<QByteArray, QExplicitlySharedDataPointer<IniFileSection> >::const_iterator it;
@@ -181,7 +181,7 @@ QExplicitlySharedDataPointer<IniFileValue> IniFileImpl::getParameter(QFile & fil
     while (mValid && !file.atEnd()) {
 
         // Current file position
-        quint64 currentPos = file.pos();
+        qint64 currentPos = file.pos();
 
         QByteArray line = file.readLine().trimmed();
 
@@ -352,7 +352,7 @@ bool IniFileImpl::setValue(QByteArray const & paramName, QVariant const & value)
             if (c.unicode() < 32 || c.unicode() >= 127)
                 valueString = QByteArray("\\0x").append(QByteArray::number(c.unicode(), 16));
             else
-                valueString = QByteArray(1, (char const)c.unicode());
+                valueString = QByteArray(1, static_cast<char const>(c.unicode()));
             break;
         }
         case QVariant::ByteArray:
@@ -399,7 +399,7 @@ bool IniFileImpl::setValue(QByteArray const & paramName, QVariant const & value)
         }
 
         // Current file position
-        quint64 currentPos = f.pos();
+        qint64 currentPos = f.pos();
 
         // Add the new section to the internal cache
         sectionObject = new IniFileSection(currentPos);
@@ -423,8 +423,8 @@ bool IniFileImpl::setValue(QByteArray const & paramName, QVariant const & value)
 
     // If the section is found, use the existing section object from the cache
     else {
-        quint64 currentPos;
-        quint64 oldPos = f.pos();
+        qint64 currentPos;
+        qint64 oldPos = f.pos();
         QString prefix; // Platform-specific prefix
 
         // Locate the parameter value