inline typename enable_if<import::is_arithmetic<Tp>, Tp>::type check_square(Tp x) { Tp zero = Tp(); // get 0 if (x != zero) { Tp abs = check_abs(x); if (((std::numeric_limits<Tp>::max)() / abs) < abs) { std::stringstream out; out << "square(" << x << ") caused overflow"; throw arithmetic_error(out.str()); } return x * x; } return zero; }
static inline int classify(int x1,int y1,int w,int h,int x,int y,int *a,int *b,int *c) { int rv; if(y<y1) return EOB; #ifndef AVOID_DELTA if((rv=check_delta(x1,y1,w,h,x,y,a,b,c))!=NOPE) { return rv; } #endif if((rv=check_rle(x1,y1,w,h,x,y,a,b,c))!=NOPE) { return rv; } if((rv=check_abs(x1,y1,w,h,x,y,a,b,c))!=NOPE) { return rv; } return NOPE; }