Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5642 in orxonox.OLD for trunk/src/lib/util


Ignore:
Timestamp:
Nov 19, 2005, 12:16:12 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: valgrind sweep

Location:
trunk/src/lib/util
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/util/executor/executor.h

    r5641 r5642  
    4444    /** @returns the Type of this Function (either static or objective) */
    4545    inline Executor_Type getType() const { return this->functorType; };
     46    /** @returns the Count of Parameters this Executor takes */
     47    inline unsigned int getParamCount() const { return this->paramCount; };
    4648
    4749    static void debug();
     
    5456
    5557  protected:
    56     Executor_Type                    functorType;                          //!< The type of Function we've got (either static or objective).
    57     unsigned int                     paramCount;                           //!< the count of parameters.
    58     MultiType*                       defaultValue;                         //!< Default Values.
     58    Executor_Type                    functorType;      //!< The type of Function we've got (either static or objective).
     59    unsigned int                     paramCount;       //!< the count of parameters.
     60    MultiType*                       defaultValue;     //!< Default Values.
    5961};
    6062
  • trunk/src/lib/util/multi_type.cc

    r5641 r5642  
    9696 * @returns a Copy of itself. (strings inside are copied as well)
    9797 */
    98 MultiType MultiType::operator= (const MultiType& mt)
    99 {
    100   this->type = mt.type;
    101   this->value = mt.value;
    102 
    103   if (mt.type == MT_STRING && mt.storedString != NULL)
    104   {
    105     this->storedString = new char[strlen (mt.storedString)+1];
    106     strcpy(this->storedString, mt.storedString);
    107     this->value.String = this->storedString;
    108   }
    109   else
    110     this->storedString = NULL;
    111 }
     98// MultiType MultiType::operator= (const MultiType& mt)
     99// {
     100//   this->type = mt.type;
     101//   this->value = mt.value;
     102//
     103//   if (mt.type == MT_STRING && mt.storedString != NULL)
     104//   {
     105//     this->storedString = new char[strlen (mt.storedString)+1];
     106//     strcpy(this->storedString, mt.storedString);
     107//     this->value.String = this->storedString;
     108//   }
     109//   else
     110//     this->storedString = NULL;
     111//   return *this;
     112// }
    112113
    113114/**
     
    126127  this->type = (MT_Type)type;
    127128
     129  if (this->type != type)
     130  {
     131    if (this->type == MT_NULL)
     132      this->setString("");
     133
     134  }
    128135  /// @todo check if this works...
    129136
     
    158165  this->type = MT_FLOAT;
    159166  this->value.Float = value;
    160 
    161167}
    162168
     
    308314    {
    309315      sprintf(tmpString, "%d", this->value.Int);
    310       this->storedString = new char[strlen (tmpString)+1];
     316      this->storedString = new char[strlen(tmpString)+1];
    311317      strcpy (this->storedString, tmpString);
    312318      return this->storedString;
  • trunk/src/lib/util/multi_type.h

    r5633 r5642  
    4242    virtual ~MultiType();
    4343
    44     MultiType operator= (const MultiType& mt);
     44//    MultiType operator= (const MultiType& mt);
    4545
    4646    void setType(int type);
Note: See TracChangeset for help on using the changeset viewer.