Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7201 in orxonox.OLD for trunk/src


Ignore:
Timestamp:
Mar 9, 2006, 12:51:06 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: no more segfaults

Location:
trunk/src/lib
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/shell/shell_command.cc

    r7199 r7201  
    4444  this->alias = NULL;
    4545  this->executor = executor.clone();
     46  this->executor->setName(commandName);
    4647
    4748//  this->classID = classID;
     
    6970ShellCommand* ShellCommand::registerCommand(const char* commandName, const char* className, const Executor& executor)
    7071{
    71   if (ShellCommand::isRegistered(commandName, className, executor))
     72  if (ShellCommand::isRegistered(commandName, className))
    7273    return NULL;
    7374  else
     
    114115 * @param commandName the name of the Command
    115116 * @param className the name of the Class the command should apply to.
    116  * @param paramCount how many arguments the Command takes
    117117 * @returns true, if the command is registered/false otherwise
    118118 *
     
    120120 * This is checked in the registerCommand-function.
    121121 */
    122 bool ShellCommand::isRegistered(const char* commandName, const char* className, const Executor& executor)
     122bool ShellCommand::isRegistered(const char* commandName, const char* className)
    123123{
    124124  if (ShellCommandClass::commandClassList == NULL)
     
    304304                                          const MultiType& value4)
    305305{
    306   if (this == NULL)
     306  if (this == NULL || this->executor == NULL)
    307307    return NULL;
    308308
  • trunk/src/lib/shell/shell_command.h

    r7198 r7201  
    7979    ~ShellCommand();
    8080
    81     static bool isRegistered(const char* commandName, const char* className, const Executor& executor);
     81    static bool isRegistered(const char* commandName, const char* className);
    8282    static const char* paramToString(long parameter);
    8383
  • trunk/src/lib/util/executor/executor.cc

    r7200 r7201  
    105105  value[4] = &value4;
    106106
     107  printf("%s ::: paramCount: %d\n", this->getName(), this->paramCount);
    107108  for (unsigned int i = 0; i < this->paramCount; i++)
    108109  {
    109110    if (*value[i] != MT_NULL)
    110111    {
    111      // printf("1:::: %s\n", MultiType::MultiTypeToString(this->defaultValue[i].getType()));
    112       //this->defaultValue[i].debug();
    113       this->defaultValue[i].setValueOf(*value[i]);
     112      printf("1:::: %d : %s \n",i, MultiType::MultiTypeToString(this->defaultValue[i].getType()));
     113
     114      this->defaultValue[i].debug();
     115      //this->defaultValue[i].setValueOf(*value[i]);
    114116      //printf("2::::%s\n", MultiType::MultiTypeToString(this->defaultValue[i].getType()));
    115117      //this->defaultValue[i].debug();
  • trunk/src/lib/util/loading/load_param.cc

    r7198 r7201  
    4545  // set the Executor.
    4646  this->executor = executor.clone();
     47
     48  if (this->executor)
     49    this->executor->setName(paramName);
    4750}
    4851
  • trunk/src/lib/util/multi_type.cc

    r7200 r7201  
    5050    case MT_CHAR:
    5151      this->value.Char = '\0';
     52      break;
     53    case MT_STRING:
     54      this->storedString = "";
    5255      break;
    5356  }
     
    299302  else if (this->type & MT_STRING)
    300303  {
     304    if (this->storedString == "") return 0;
    301305    char* endPtr = NULL;
    302306    int result = strtol(this->storedString.c_str(), &endPtr, 10);
Note: See TracChangeset for help on using the changeset viewer.