Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3860 in orxonox.OLD for orxonox/trunk/src/lib/coord


Ignore:
Timestamp:
Apr 17, 2005, 6:20:02 PM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: moved likely to compiler.h in defs
also reset all the UNLIKELY_IF functions to how they should look.

the old approach is still valid, but depricated.

@patrick: i hope this is ok for you, for it is LINUX-standard.
and i think windows is also able to handle likely/unlikely because it is a compiler issue not a system issue

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/coord/p_node.cc

    r3832 r3860  
    2222#include "p_node.h"
    2323#include "stdincl.h"
     24#include "compiler.h"
    2425
    2526#include "error.h"
     
    6162  *this->absCoordinate = absCoordinate;
    6263
    63   __LIKELY_IF(parent != NULL)
     64  if (likely(parent != NULL))
    6465  {
    6566    *this->relCoordinate = *this->absCoordinate - parent->getAbsCoor ();
     
    208209{
    209210
    210   __UNLIKELY_IF( this->bAbsCoorChanged)
     211  if( unlikely(this->bAbsCoorChanged))
    211212    {
    212213      *this->absCoordinate = *this->absCoordinate + shift;
     
    316317void PNode::addChild (PNode* pNode, int parentingMode)
    317318{
    318   __LIKELY_IF( pNode->parent != NULL)
     319  if( likely(pNode->parent != NULL))
    319320    {
    320321      PRINTF(3)("PNode::addChild() - reparenting node: removing it and adding it again\n");
     
    436437
    437438
    438   __LIKELY_IF( this->mode & PNODE_MOVEMENT)
     439  if( likely(this->mode & PNODE_MOVEMENT))
    439440    {
    440       __UNLIKELY_IF(this->bAbsCoorChanged /*&& this->timeStamp != DataTank::timeStamp*/)
     441      if( unlikely(this->bAbsCoorChanged) /*&& this->timeStamp != DataTank::timeStamp*/)
    441442        {
    442443          /* if you have set the absolute coordinates this overrides all other changes */
    443444          *this->relCoordinate = *this->absCoordinate - parent->getAbsCoor ();
    444445        }
    445       __LIKELY_IF(this->bRelCoorChanged /*&& this->timeStamp != DataTank::timeStamp*/)
     446      if( likely(this->bRelCoorChanged) /*&& this->timeStamp != DataTank::timeStamp*/)
    446447
    447448        {
     
    449450
    450451          /*
    451           __UNLIKELY_IF( this->parent == NULL)
     452          if( unlikely(this->parent == NULL))
    452453            {
    453454              *this->absCoordinate = *this->relCoordinate;
     
    460461  if( this->mode & PNODE_LOCAL_ROTATE)
    461462    {
    462       __UNLIKELY_IF( this->bAbsDirChanged /*&& this->timeStamp != DataTank::timeStamp*/)
     463      if( unlikely(this->bAbsDirChanged) /*&& this->timeStamp != DataTank::timeStamp*/)
    463464        {
    464465          /* if you have set the absolute coordinates this overrides all other changes */
    465466          *this->relDirection = *this->absDirection - parent->getAbsDir();
    466467        }
    467       else __LIKELY_IF( this->bRelDirChanged /*&& this->timeStamp != DataTank::timeStamp*/)
     468      else if( likely(this->bRelDirChanged) /*&& this->timeStamp != DataTank::timeStamp*/)
    468469        {
    469470          /* update the current absDirection - remember * means rotation around sth.*/
     
    474475  if( this->mode & PNODE_ROTATE_MOVEMENT)
    475476    {
    476       __UNLIKELY_IF( this->bAbsCoorChanged /*&& this->timeStamp != DataTank::timeStamp*/)
     477      if( unlikely(this->bAbsCoorChanged) /*&& this->timeStamp != DataTank::timeStamp*/)
    477478        {
    478479          /* if you have set the absolute coordinates this overrides all other changes */
    479480          *this->relCoordinate = *this->absCoordinate - parent->getAbsCoor ();
    480481        }
    481       else __LIKELY_IF( this->bRelCoorChanged /*&& this->timeStamp != DataTank::timeStamp*/)
     482      else if( likely(this->bRelCoorChanged) /*&& this->timeStamp != DataTank::timeStamp*/)
    482483        {
    483484          /*this is bad style... must be deleted later - just for testing*/
     
    496497    {
    497498      /* if this node has changed, make sure, that all children are updated also */
    498       __LIKELY_IF( this->bRelCoorChanged || this->bAbsCoorChanged)
     499      if( likely(this->bRelCoorChanged || this->bAbsCoorChanged))
    499500        pn->parentCoorChanged ();
    500       __LIKELY_IF( this->bRelDirChanged || this->bAbsDirChanged)
     501      if( likely(this->bRelDirChanged || this->bAbsDirChanged))
    501502        pn->parentDirChanged ();
    502503
Note: See TracChangeset for help on using the changeset viewer.