View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0012570VTK(No Category)public2011-09-02 17:572013-04-05 20:28
ReporterAlfredo Morales 
Assigned ToDavid Partyka 
PriorityhighSeverityminorReproducibilityhave not tried
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0012570: Compilation Error vtk release 5.6.1 in Fedora 15
DescriptionTrying 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.
TagsNo tags attached.
ProjectKitware
Typecrash
Attached Files

 Relationships

  Notes
(0027452)
David Partyka (developer)
2011-09-02 18:04

Please try vtk 5.8.0 and let us know if there is still an issue.

 Issue History
Date Modified Username Field Change
2011-09-02 17:57 Alfredo Morales New Issue
2011-09-02 18:04 David Partyka Note Added: 0027452
2011-09-02 18:07 David Partyka Assigned To => David Partyka
2011-09-02 18:07 David Partyka Status backlog => todo
2011-09-02 18:07 David Partyka Status todo => active development
2011-09-02 18:07 David Partyka Status active development => gatekeeper review
2011-09-02 18:07 David Partyka Status gatekeeper review => customer review
2013-04-05 20:28 Berk Geveci Status customer review => closed
2013-04-05 20:28 Berk Geveci Resolution open => fixed


Copyright © 2000 - 2018 MantisBT Team