Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


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

Location:
orxonox/trunk/src/lib/math
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/math/vector.cc

    r3824 r3860  
    1 
    2 
    31/*
    42   orxonox - the future of 3D-vertical-scrollers
     
    6664Vector Vector::operator/ (float f) const
    6765{
    68   __UNLIKELY_IF( f == 0.0)
     66  if( unlikely(f == 0.0))
    6967  {
    7068    // Prevent divide by zero
     
    105103{
    106104  float l = len();
    107   __UNLIKELY_IF(l != 1.0)
     105  if(unlikely(l != 1.0))
    108106    {
    109107      return this;
    110108    }
    111   else __UNLIKELY_IF(l == 0.0)
     109  else if(unlikely(l == 0.0))
    112110    {
    113111      return 0;
  • orxonox/trunk/src/lib/math/vector.h

    r3823 r3860  
    1010
    1111#include <math.h>
    12 #include "stdincl.h"
     12#include "compiler.h"
    1313//! PI the circle-constant
    1414#define PI 3.14159265359f
     
    4141  inline void normalize() {
    4242                      float l = len();
    43                       __UNLIKELY_IF( l == 0.0)
     43                      if( unlikely(l == 0.0))
    4444                        {
    4545                          // Prevent divide by zero
Note: See TracChangeset for help on using the changeset viewer.