Add macro M_GREATER_THAN_P & M_LESS_OR_EQUAL_P (src, tests, doc)
This commit is contained in:
1 parent
e84bc9fc0d
commit
0515cfd068
3 files changed
+32
No files matched your search
@@ -5453,11 +5453,21 @@ x and y shall be within [0..M\_MAX\_NB\_ARGUMENT].
|
|||||||
Return 1 if x < y, 0 otherwise (resolution is performed at preprocessing time).
|
Return 1 if x < y, 0 otherwise (resolution is performed at preprocessing time).
|
||||||
x and y shall be within [0..M\_MAX\_NB\_ARGUMENT].x
|
x and y shall be within [0..M\_MAX\_NB\_ARGUMENT].x
|
||||||
|
|
||||||
|
##### M\_LESS_OR\_EQUAL\_P(x, y)
|
||||||
|
|
||||||
|
Return 1 if x <= y, 0 otherwise (resolution is performed at preprocessing time).
|
||||||
|
x and y shall be within [0..M\_MAX\_NB\_ARGUMENT].x
|
||||||
|
|
||||||
##### M\_GREATER_OR\_EQUAL\_P(x, y)
|
##### M\_GREATER_OR\_EQUAL\_P(x, y)
|
||||||
|
|
||||||
Return 1 if x >= y, 0 otherwise (resolution is performed at preprocessing time).
|
Return 1 if x >= y, 0 otherwise (resolution is performed at preprocessing time).
|
||||||
x and y shall be within [0..M\_MAX\_NB\_ARGUMENT].x
|
x and y shall be within [0..M\_MAX\_NB\_ARGUMENT].x
|
||||||
|
|
||||||
|
##### M\_GREATER_THAN\_P(x, y)
|
||||||
|
|
||||||
|
Return 1 if x > y, 0 otherwise (resolution is performed at preprocessing time).
|
||||||
|
x and y shall be within [0..M\_MAX\_NB\_ARGUMENT].x
|
||||||
|
|
||||||
##### M\_COMMA\_P(arglist)
|
##### M\_COMMA\_P(arglist)
|
||||||
|
|
||||||
Return 1 if there is a comma inside the argument list, 0 otherwise.
|
Return 1 if there is a comma inside the argument list, 0 otherwise.
|
||||||
|
|||||||
@@ -1745,6 +1745,14 @@ M_BEGIN_PROTECTED_CODE
|
|||||||
a and b shall be in [0..M_MAX_NB_ARGUMENT] */
|
a and b shall be in [0..M_MAX_NB_ARGUMENT] */
|
||||||
#define M_GREATER_OR_EQUAL_P(a, b) M_INV(M_LESS_THAN_P(a, b))
|
#define M_GREATER_OR_EQUAL_P(a, b) M_INV(M_LESS_THAN_P(a, b))
|
||||||
|
|
||||||
|
/* Return 1 if a <= b, 0 otherwise
|
||||||
|
a and b shall be in [0..M_MAX_NB_ARGUMENT] */
|
||||||
|
#define M_LESS_OR_EQUAL_P(a, b) M_GREATER_OR_EQUAL_P(b, a)
|
||||||
|
|
||||||
|
/* Return 1 if a > b, 0 otherwise
|
||||||
|
a and b shall be in [0..M_MAX_NB_ARGUMENT] */
|
||||||
|
#define M_GREATER_THAN_P(a, b) M_LESS_THAN_P(b,a)
|
||||||
|
|
||||||
/* Revert the list given as parameter
|
/* Revert the list given as parameter
|
||||||
Example: M_REVERSE(a,b,c) --> c,b,a */
|
Example: M_REVERSE(a,b,c) --> c,b,a */
|
||||||
/* Generated by:
|
/* Generated by:
|
||||||
|
|||||||
@@ -135,6 +135,20 @@ static void test_incdec(void)
|
|||||||
assert(!M_GREATER_OR_EQUAL_P(4, 6));
|
assert(!M_GREATER_OR_EQUAL_P(4, 6));
|
||||||
assert(!M_GREATER_OR_EQUAL_P(4, 7));
|
assert(!M_GREATER_OR_EQUAL_P(4, 7));
|
||||||
|
|
||||||
|
assert(M_GREATER_THAN_P(4, 2));
|
||||||
|
assert(M_GREATER_THAN_P(4, 3));
|
||||||
|
assert(!M_GREATER_THAN_P(4, 4));
|
||||||
|
assert(!M_GREATER_THAN_P(4, 5));
|
||||||
|
assert(!M_GREATER_THAN_P(4, 6));
|
||||||
|
assert(!M_GREATER_THAN_P(4, 7));
|
||||||
|
|
||||||
|
assert(!M_LESS_OR_EQUAL_P(4, 2));
|
||||||
|
assert(!M_LESS_OR_EQUAL_P(4, 3));
|
||||||
|
assert(M_LESS_OR_EQUAL_P(4, 4));
|
||||||
|
assert(M_LESS_OR_EQUAL_P(4, 5));
|
||||||
|
assert(M_LESS_OR_EQUAL_P(4, 6));
|
||||||
|
assert(M_LESS_OR_EQUAL_P(4, 7));
|
||||||
|
|
||||||
assert(!M_KEYWORD_P(M_UNDERFLOW, M_SUB(1, 1)));
|
assert(!M_KEYWORD_P(M_UNDERFLOW, M_SUB(1, 1)));
|
||||||
assert(M_KEYWORD_P(M_UNDERFLOW, M_SUB(1, 2)));
|
assert(M_KEYWORD_P(M_UNDERFLOW, M_SUB(1, 2)));
|
||||||
assert(M_KEYWORD_P(M_UNDERFLOW, M_SUB(1, 6)));
|
assert(M_KEYWORD_P(M_UNDERFLOW, M_SUB(1, 6)));
|
||||||
|
|||||||
Reference in new issue
Block a user