isl_inequality_negate: return modified result
[isl.git] / check_type_range_templ.c
blobba309fd06b7199c236344906e0cbef886efd5d76
1 #define xFN(TYPE,NAME) TYPE ## _ ## NAME
2 #define FN(TYPE,NAME) xFN(TYPE,NAME)
4 /* Check that there are "n" dimensions of type "type" starting at "first"
5 * in "obj".
6 */
7 isl_stat FN(TYPE,check_range)(__isl_keep TYPE *obj,
8 enum isl_dim_type type, unsigned first, unsigned n)
10 unsigned dim;
12 if (!obj)
13 return isl_stat_error;
14 dim = FN(TYPE,dim)(obj, type);
15 if (first + n > dim || first + n < first)
16 isl_die(FN(TYPE,get_ctx)(obj), isl_error_invalid,
17 "position or range out of bounds",
18 return isl_stat_error);
19 return isl_stat_ok;