IceUtils.cpp
Go to the documentation of this file.
1 
8 
11 // Precompiled Header
12 #include "Stdafx.h"
13 
14 using namespace IceCore;
15 
17 
25 {
26  // Returns 0 for null addresses
27  if(!address) return 0;
28 
29  // Test all bits
30  udword Align = 1;
31  for(udword i=1;i<32;i++)
32  {
33  // Returns as soon as the alignment is broken
34  if(address&Align) return Align;
35  Align<<=1;
36  }
37  // Here all bits are null, except the highest one (else the address would be null)
38  return Align;
39 }
FUNCTION ICECORE_API udword Alignment(udword address)
Definition: IceUtils.cpp:24
png_uint_32 i
Definition: png.h:2735
unsigned int udword
sizeof(udword) must be 4
Definition: IceTypes.h:65


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Sat May 8 2021 02:42:38