D
Dave
hello...
I wrote a marco for saturation.
#define clip(x) (char)(x)<0?0(x)>255?255x));
and use this marco in the program like this...
char tmp=(char)clip((unsigned_int_16)(tmp1+tmp2));
which unsigned_int_16 will cast the (tmp1+tmp2) to 16 bit
unsigned int.
Each time when I compile this program, the gcc warning me the
"comparison is always false due to limited range of data type"
Where leads this problem?
Please tell me! Thanx~~~
Dave.
I wrote a marco for saturation.
#define clip(x) (char)(x)<0?0(x)>255?255x));
and use this marco in the program like this...
char tmp=(char)clip((unsigned_int_16)(tmp1+tmp2));
which unsigned_int_16 will cast the (tmp1+tmp2) to 16 bit
unsigned int.
Each time when I compile this program, the gcc warning me the
"comparison is always false due to limited range of data type"
Where leads this problem?
Please tell me! Thanx~~~
Dave.