macros.h
changeset 3812 d9b3041ee3d0
parent 3352 49d580a11385
child 3941 34116fc17887
equal deleted inserted replaced
3811:7324eb563ae0 3812:d9b3041ee3d0
   115 	} else {
   115 	} else {
   116 		return value & (KILL_FIRST_BIT(GB(value, 0, 6)) | 0x3F00);
   116 		return value & (KILL_FIRST_BIT(GB(value, 0, 6)) | 0x3F00);
   117 	}
   117 	}
   118 }
   118 }
   119 
   119 
       
   120 /** returns true if value a has only one bit set to 1 */
       
   121 #define HAS_SINGLE_BIT(a) ( ((a) & ((a) - 1)) == 0)
       
   122 
   120 /* [min,max), strictly less than */
   123 /* [min,max), strictly less than */
   121 #define IS_BYTE_INSIDE(a,min,max) ((byte)((a)-(min)) < (byte)((max)-(min)))
   124 #define IS_BYTE_INSIDE(a,min,max) ((byte)((a)-(min)) < (byte)((max)-(min)))
   122 #define IS_INT_INSIDE(a,min,max) ((uint)((a)-(min)) < (uint)((max)-(min)))
   125 #define IS_INT_INSIDE(a,min,max) ((uint)((a)-(min)) < (uint)((max)-(min)))
   123 
   126 
   124 
   127