[vtk-developers] [VTK 0012570]: Compilation Error vtk release 5.6.1 in Fedora 15
Mantis Bug Tracker
mantis at public.kitware.com
Fri Sep 2 17:57:39 EDT 2011
The following issue has been SUBMITTED.
======================================================================
http://vtk.org/Bug/view.php?id=12570
======================================================================
Reported By: Alfredo Morales
Assigned To:
======================================================================
Project: VTK
Issue ID: 12570
Category: (No Category)
Reproducibility: have not tried
Severity: minor
Priority: high
Status: backlog
Project: Kitware
Type: crash
======================================================================
Date Submitted: 2011-09-02 17:57 EDT
Last Modified: 2011-09-02 17:57 EDT
======================================================================
Summary: Compilation Error vtk release 5.6.1 in Fedora 15
Description:
Trying to compile the release 5.6.1 in Fedora 15 I got an error. In the class
VTK/Utilities/vtkmetaio/metaUtils.cxx the compiler doesn't recognize the
variable ptrdiff_t and it recommended to change it to std::ptrdiff_t.
I did the change and I got vtk compiled.
The method that I modified was "bool MET_StringToWordArray(const char *s, int
*n, char ***val)" and the final result is:
bool MET_StringToWordArray(const char *s, int *n, char ***val)
{
std::ptrdiff_t l = strlen(s);
std::ptrdiff_t p = 0;
while(p<l && s[p] == ' ')
{
p++;
}
*n = 0;
std::ptrdiff_t pp = p;
bool space = false;
while(pp<l)
{
if(s[pp] == ' ' && !space)
{
(*n)++;
space = true;
}
else
{
space = false;
}
pp++;
}
pp=l-1;
if(s[pp] == ' ')
{
while(pp>=0 && s[pp] == ' ')
{
(*n)--;
pp--;
}
}
else
{
(*n)++;
}
*val = new char *[*n];
std::ptrdiff_t i, j;
for(i=0; i<*n; i++)
{
if(p == l)
{
return false;
}
(*val)[i] = new char [80];
while(p<l && s[p] == ' ')
{
p++;
}
j = 0;
while(p<l && s[p] != ' ')
{
(*val)[i][j++] = s[p++];
}
(*val)[i][j] = '\0';
}
return true;
}
I hope this will help the development of future releases.
Alfredo Morales Pinzón.
======================================================================
Issue History
Date Modified Username Field Change
======================================================================
2011-09-02 17:57 Alfredo MoralesNew Issue
======================================================================
More information about the vtk-developers
mailing list