diff -r 0c4ec6a4e00b code/nel/include/nel/misc/debug.h --- a/code/nel/include/nel/misc/debug.h Mon Oct 01 10:08:52 2012 +0200 +++ b/code/nel/include/nel/misc/debug.h Tue Oct 02 00:20:51 2012 +0200 @@ -478,6 +478,26 @@ #endif // NL_NO_DEBUG +# ifdef NL_OS_UNIX + +#ifndef nllikely +# define nllikely(expr) __builtin_expect(!!(expr), true) +#endif +#ifndef nlunlikely +# define nlunlikely(expr) __builtin_expect(!!(expr), false) +#endif + +# else // NL_OS_UNIX + +#ifndef nllikely +# define nllikely(x) (x) +#endif +#ifndef nlunlikely +# define nlunlikely(x) (x) +#endif + +# endif // NL_OS_UNIX + #define nlunreferenced(identifier) (identifier) #define nlstop \ diff -r 0c4ec6a4e00b code/ryzom/client/src/interface_v3/view_radar.cpp --- a/code/ryzom/client/src/interface_v3/view_radar.cpp Mon Oct 01 10:08:52 2012 +0200 +++ b/code/ryzom/client/src/interface_v3/view_radar.cpp Tue Oct 02 00:20:51 2012 +0200 @@ -142,12 +142,13 @@ xyzRef.z = 0; mat.translate(-xyzRef); - float maxSqrRadius= (float)sqr(_WorldSize/2); + const double maxSqrRadius= sqr(_WorldSize/2); - for (sint32 i = 1; i < 256; ++i) + for (uint i = 1; i < 256; ++i) { CEntityCL *entity = EntitiesMngr.entity(i); - if (entity == NULL) continue; + if (nlunlikely(entity == NULL)) + continue; // if the entity must not be shown in radar if(!entity->getDisplayInRadar()) @@ -156,16 +157,16 @@ // get entity pos CVectorD xyz = entity->pos(); - xyz.z = 0; // if the distance is too big so do not display the entity if ((sqr(xyz.x - xyzRef.x)+sqr(xyz.y - xyzRef.y)) > maxSqrRadius) continue; + xyz.z = 0; // Transform the dot xyz = mat * xyz; // Convert to screen - sint32 x = OptFastFloor((float)xyz.x); - sint32 y = OptFastFloor((float)xyz.y); + const sint32 x = OptFastFloor((float)xyz.x); + const sint32 y = OptFastFloor((float)xyz.y); CRGBA col = entity->getColor();