Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 25, 2015, 2:04:43 PM (9 years ago)
Author:
landauf
Message:

bugfix and continuation of the last commit:

  • FunctionCall::execute() now returns the correct value (was inverted accidentally)
  • FunctionCall::setCall() new calculates the correct callsize (still included the 8bits for isStatic that was removed in the previous commit)
  • static and member network functions are now treated equally throughout the whole system (only the macros make a difference)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core7/src/libraries/network/FunctionCall.cc

    r10472 r10473  
    5252  {
    5353    case 0:
    54       return !fct->call(this->objectID_);
     54      return fct->call(this->objectID_);
    5555    case 1:
    56       return !fct->call(this->objectID_, this->arguments_[0]);
     56      return fct->call(this->objectID_, this->arguments_[0]);
    5757    case 2:
    58       return !fct->call(this->objectID_, this->arguments_[0], this->arguments_[1]);
     58      return fct->call(this->objectID_, this->arguments_[0], this->arguments_[1]);
    5959    case 3:
    60       return !fct->call(this->objectID_, this->arguments_[0], this->arguments_[1], this->arguments_[2]);
     60      return fct->call(this->objectID_, this->arguments_[0], this->arguments_[1], this->arguments_[2]);
    6161    case 4:
    62       return !fct->call(this->objectID_, this->arguments_[0], this->arguments_[1], this->arguments_[2], this->arguments_[3]);
     62      return fct->call(this->objectID_, this->arguments_[0], this->arguments_[1], this->arguments_[2], this->arguments_[3]);
    6363    case 5:
    64       return !fct->call(this->objectID_, this->arguments_[0], this->arguments_[1], this->arguments_[2], this->arguments_[3], this->arguments_[4]);
     64      return fct->call(this->objectID_, this->arguments_[0], this->arguments_[1], this->arguments_[2], this->arguments_[3], this->arguments_[4]);
    6565    default:
    6666      assert(0);
     
    6969}
    7070
    71 void FunctionCall::setCallStatic( uint32_t networkID, const MultiType* mt1, const MultiType* mt2, const MultiType* mt3, const MultiType* mt4, const MultiType* mt5){
     71void FunctionCall::setCall( uint32_t networkID, uint32_t objectID, const MultiType* mt1, const MultiType* mt2, const MultiType* mt3, const MultiType* mt4, const MultiType* mt5){
    7272
    7373  // first determine the size that has to be reserved for this call
    74   uint32_t callsize = 2*sizeof(uint32_t)+sizeof(uint8_t); //size for network-function-id and nrOfArguments and for bool isStatic
    75   uint32_t nrOfArguments = 0;
    76   if(mt1)
    77   {
    78     nrOfArguments++;
    79     callsize += mt1->getNetworkSize();
    80     this->arguments_.push_back(*mt1);
    81     if(mt2)
    82     {
    83       nrOfArguments++;
    84       callsize += mt2->getNetworkSize();
    85       this->arguments_.push_back(*mt2);
    86       if(mt3)
    87       {
    88         nrOfArguments++;
    89         callsize += mt3->getNetworkSize();
    90         this->arguments_.push_back(*mt3);
    91         if(mt4)
    92         {
    93           nrOfArguments++;
    94           callsize += mt4->getNetworkSize();
    95           this->arguments_.push_back(*mt4);
    96           if(mt5)
    97           {
    98             nrOfArguments++;
    99             callsize += mt5->getNetworkSize();
    100             this->arguments_.push_back(*mt5);
    101           }
    102         }
    103       }
    104     }
    105   }
    106   this->nrOfArguments_ = nrOfArguments;
    107   this->size_ = callsize;
    108   this->functionID_ = networkID;
    109 }
    110 
    111 void FunctionCall::setCallMember( uint32_t networkID, uint32_t objectID, const MultiType* mt1, const MultiType* mt2, const MultiType* mt3, const MultiType* mt4, const MultiType* mt5){
    112 
    113   // first determine the size that has to be reserved for this call
    114   uint32_t callsize = 3*sizeof(uint32_t)+sizeof(uint8_t); //size for network-function-id and nrOfArguments and the objectID and bIsStatic
     74  uint32_t callsize = 3*sizeof(uint32_t); //size for network-function-id and nrOfArguments and the objectID
    11575  uint32_t nrOfArguments = 0;
    11676  if(mt1)
     
    146106  this->nrOfArguments_ = nrOfArguments;
    147107  this->functionID_ = networkID;
     108  this->objectID_ = objectID;
    148109  this->size_ = callsize;
    149   this->objectID_ = objectID;
    150110}
    151111
Note: See TracChangeset for help on using the changeset viewer.