argument.
* character.c, charset.c, menu.c, process.c, window.c: Adjust all
uses.
+2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
+
+ * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
+ argument.
+ * character.c, charset.c, menu.c, process.c, window.c: Adjust all
+ uses.
+
2012-06-29 Eli Zaretskii <eliz@gnu.org>
* xdisp.c (try_window_id): Undo last change.
for (i = 0; i < n; i++)
{
- CHECK_RANGED_INTEGER (0, args[i], 255);
+ CHECK_RANGED_INTEGER (args[i], 0, 255);
*p++ = XINT (args[i]);
}
min_byte_obj = Faref (val, make_number (i * 2));
max_byte_obj = Faref (val, make_number (i * 2 + 1));
- CHECK_RANGED_INTEGER (0, min_byte_obj, 255);
+ CHECK_RANGED_INTEGER (min_byte_obj, 0, 255);
min_byte = XINT (min_byte_obj);
- CHECK_RANGED_INTEGER (min_byte, max_byte_obj, 255);
+ CHECK_RANGED_INTEGER (max_byte_obj, min_byte, 255);
max_byte = XINT (max_byte_obj);
charset.code_space[i * 4] = min_byte;
charset.code_space[i * 4 + 1] = max_byte;
charset.dimension = dimension;
else
{
- CHECK_RANGED_INTEGER (1, val, 4);
+ CHECK_RANGED_INTEGER (val, 1, 4);
charset.dimension = XINT (val);
}
charset.iso_revision = -1;
else
{
- CHECK_RANGED_INTEGER (-1, val, 63);
+ CHECK_RANGED_INTEGER (val, -1, 63);
charset.iso_revision = XINT (val);
}
#define CHECK_NATNUM(x) \
CHECK_TYPE (NATNUMP (x), Qwholenump, x)
-#define CHECK_RANGED_INTEGER(lo, x, hi) \
+#define CHECK_RANGED_INTEGER(x, lo, hi) \
do { \
CHECK_NUMBER (x); \
if (! ((lo) <= XINT (x) && XINT (x) <= (hi))) \
#define CHECK_TYPE_RANGED_INTEGER(type, x) \
do { \
if (TYPE_SIGNED (type)) \
- CHECK_RANGED_INTEGER (TYPE_MINIMUM (type), x, TYPE_MAXIMUM (type)); \
+ CHECK_RANGED_INTEGER (x, TYPE_MINIMUM (type), TYPE_MAXIMUM (type)); \
else \
- CHECK_RANGED_INTEGER (0, x, TYPE_MAXIMUM (type)); \
+ CHECK_RANGED_INTEGER (x, 0, TYPE_MAXIMUM (type)); \
} while (0)
#define CHECK_MARKER(x) \
but I don't want to make one now. */
CHECK_WINDOW (window);
- CHECK_RANGED_INTEGER ((xpos < INT_MIN - MOST_NEGATIVE_FIXNUM
+ CHECK_RANGED_INTEGER (x,
+ (xpos < INT_MIN - MOST_NEGATIVE_FIXNUM
? (EMACS_INT) INT_MIN - xpos
: MOST_NEGATIVE_FIXNUM),
- x, INT_MAX - xpos);
- CHECK_RANGED_INTEGER ((ypos < INT_MIN - MOST_NEGATIVE_FIXNUM
+ INT_MAX - xpos);
+ CHECK_RANGED_INTEGER (y,
+ (ypos < INT_MIN - MOST_NEGATIVE_FIXNUM
? (EMACS_INT) INT_MIN - ypos
: MOST_NEGATIVE_FIXNUM),
- y, INT_MAX - ypos);
+ INT_MAX - ypos);
xpos += XINT (x);
ypos += XINT (y);
(register Lisp_Object process, Lisp_Object height, Lisp_Object width)
{
CHECK_PROCESS (process);
- CHECK_RANGED_INTEGER (0, height, INT_MAX);
- CHECK_RANGED_INTEGER (0, width, INT_MAX);
+ CHECK_RANGED_INTEGER (height, 0, INT_MAX);
+ CHECK_RANGED_INTEGER (width, 0, INT_MAX);
if (XPROCESS (process)->infd < 0
|| set_window_size (XPROCESS (process)->infd,
if (!NILP (width))
{
- CHECK_RANGED_INTEGER (0, width, INT_MAX);
+ CHECK_RANGED_INTEGER (width, 0, INT_MAX);
if (XINT (width) == 0)
vertical_type = Qnil;