CLAMP_T

Section: Driver Basics (9)
Updated: February 2011
Index Return to Main Contents
 

NAME

clamp_t - return a value clamped to a given range using a given type  

SYNOPSIS

clamp_t(type, val, min, max);
 

ARGUMENTS

type

the type of variable to use

val

current value

min

minimum allowable value

max

maximum allowable value
 

DESCRIPTION

This macro does no typechecking and uses temporary variables of type 'type' to make all the comparisons.  

COPYRIGHT