[Insight-developers] error in itkSetStringMacro

Lydia Ng lng at statsci.com
Wed Aug 23 21:16:47 EDT 2000


Hi,

The macro itkSetStringMacro does not work properly.

In the code (see below), the expression
_arg != this->m_##name

should really be
_arg == this->m_##name

otherwise, the string will never update.

--Lydia


/**
 * Set character string.  Creates member Set"name"() 
 * (e.g., SetFilename(char *));
 */
#define itkSetStringMacro(name) \
  virtual void Set##name (const char* _arg) \
  { \
    if ( _arg && (_arg != this->m_##name) ) { return;} \
    if (_arg) \
      { \
      this->m_##name = _arg;\
      } \
     else \
      { \
      this->m_##name = ""; \
      } \
    this->Modified(); \
  } 






More information about the Insight-developers mailing list