Bug 57371 - filebuffer.cpp eqSign.m_idx-1 FileBuffer::getValues QChar effectOperator
Summary: filebuffer.cpp eqSign.m_idx-1 FileBuffer::getValues QChar effectOperator
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Build tools: QMake (show other bugs)
Version: 3.0.0a3
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: KDevelop Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-04-17 14:09 UTC by Michael Back
Modified: 2003-09-30 04:41 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Back 2003-04-17 14:09:53 UTC
Version:           3.0a3 (using KDE KDE 3.0.5b)
Installed from:    Compiled From Sources
Compiler:          gcc3.2 
OS:          Linux

If you use a 64-Bit CPU and operationingsystem then is a long not a int.Therefore in the file: parts/trollproject/filebuffer.cppin function: FileBuffer::getValuethe line: QChar effectOperator = line[eqSign.m_idx-1]; is wrong.The variable eqSign.m_idx should be a int type and not a long. A cast likeQChar effectOperator = line[static_cast<int>(eqSign.m_idx-1)]; works, but maybe only on a 64-bit system.
Comment 1 Andreas Koepfle 2003-09-30 04:41:08 UTC
Subject: kdevelop/parts/trollproject

CVS commit by koepfle: 

fix BR 57371: distinguish between long and int for 64bit machines 
(however I doubt that this is the only place where kdevelop fails on 64bit
- and I don't have a 64bit machine around for tests)
CCMAIL: 57371-done@bugs.kde.org


  M +2 -2      caret.h   1.7
  M +4 -4      filebuffer.cpp   1.30


--- kdevelop/parts/trollproject/caret.h  #1.6:1.7
@@ -17,6 +17,6 @@ class Caret
 {
   public:
-  long      m_row;
-  long      m_idx;
+  int      m_row;
+  int      m_idx;
             Caret();
             Caret(const int row, const int idx);

--- kdevelop/parts/trollproject/filebuffer.cpp  #1.29:1.30
@@ -217,5 +217,5 @@ bool FileBuffer::getValues(const QString
     else
       valueString = valueString + " ";
-    long lineNum=eqSign.m_row;
+    int lineNum=eqSign.m_row;
     line = line.mid(eqSign.m_idx+1,line.length()-eqSign.m_idx);
     while (line!="")
@@ -266,5 +266,5 @@ bool FileBuffer::getValues(const QString
     QString line=m_buffer[eqSign.m_row];
     QChar effectOperator = line[eqSign.m_idx-1];
-    long lineNum=eqSign.m_row;
+    int lineNum=eqSign.m_row;
     curValues.clear();
     curValuesIgnore.clear();
@@ -353,5 +353,5 @@ void FileBuffer::getVariableValueSetMode
     QString line=m_buffer[eqSign.m_row];
     QChar effectOperator = line[eqSign.m_idx-1];
-    long lineNum=eqSign.m_row;
+    int lineNum=eqSign.m_row;
     line = line.mid(eqSign.m_idx+1,line.length()-eqSign.m_idx);
     while (!line.isEmpty())
@@ -555,5 +555,5 @@ QStringList FileBuffer::popBlock(const C
 {
   QStringList result = copyBlock(blockStart,blockEnd);
-  long poprow;
+  int poprow;
   if (blockStart.m_idx==0)
   {