}
if (!erase_p && down_p)
- swap (top_gc, bottom_gc);
+ {
+ GC temp;
+ temp = top_gc;
+ top_gc = bottom_gc;
+ bottom_gc = temp;
+ }
/* Do draw (or erase) shadows */
points [0].x = x;
}
if (!erase_p && down_p)
- swap (top_gc, bottom_gc);
+ {
+ GC temp;
+ temp = top_gc;
+ top_gc = bottom_gc;
+ bottom_gc = temp;
+ }
points [0].x = x;
points [0].y = y + height / 2;
{
struct android_get_surrounding_text_context *request;
struct frame *f;
+ ptrdiff_t temp;
request = data;
bad input methods. */
if (request->end < request->start)
- swap (request->start, request->end);
+ {
+ temp = request->start;
+ request->start = request->end;
+ request->end = temp;
+ }
/* Retrieve the conversion region. */
CHECK_FIXNUM_COERCE_MARKER (end);
if (XFIXNUM (beg) > XFIXNUM (end))
- swap (beg, end);
+ {
+ Lisp_Object temp;
+ temp = beg; beg = end; end = temp;
+ }
ptrdiff_t obeg = clip_to_bounds (BUF_BEG (b), XFIXNUM (beg), BUF_Z (b));
ptrdiff_t oend = clip_to_bounds (obeg, XFIXNUM (end), BUF_Z (b));
modify_overlay (struct buffer *buf, ptrdiff_t start, ptrdiff_t end)
{
if (start > end)
- swap (start, end);
+ {
+ ptrdiff_t temp = start;
+ start = end;
+ end = temp;
+ }
BUF_COMPUTE_UNCHANGED (buf, start, end);
CHECK_FIXNUM_COERCE_MARKER (end);
if (XFIXNUM (beg) > XFIXNUM (end))
- swap (beg, end);
+ {
+ Lisp_Object temp;
+ temp = beg; beg = end; end = temp;
+ }
specbind (Qinhibit_quit, Qt); /* FIXME: Why? */
int i, j;
for (i = start, j = end - 1; i < j; ++i, --j)
- swap (matrix->rows[i], matrix->rows[j]);
+ {
+ /* Non-ISO HP/UX compiler doesn't like auto struct
+ initialization. */
+ struct glyph_row temp;
+ temp = matrix->rows[i];
+ matrix->rows[i] = matrix->rows[j];
+ matrix->rows[j] = temp;
+ }
}
static void
swap_glyphs_in_rows (struct glyph_row *a, struct glyph_row *b)
{
- for (int area = 0; area < LAST_AREA; ++area)
+ int area;
+
+ for (area = 0; area < LAST_AREA; ++area)
{
/* Number of glyphs to swap. */
int max_used = max (a->used[area], b->used[area]);
while (glyph_a < glyph_a_end)
{
- swap (*glyph_a, *glyph_b);
+ /* Non-ISO HP/UX compiler doesn't like auto struct
+ initialization. */
+ struct glyph temp;
+ temp = *glyph_a;
+ *glyph_a = *glyph_b;
+ *glyph_b = temp;
++glyph_a;
++glyph_b;
}
using `string-make-multibyte' or `string-make-unibyte', which see. */)
(Lisp_Object buffer, Lisp_Object start, Lisp_Object end)
{
- register EMACS_INT b, e;
+ register EMACS_INT b, e, temp;
register struct buffer *bp, *obuf;
Lisp_Object buf;
b = !NILP (start) ? fix_position (start) : BUF_BEGV (bp);
e = !NILP (end) ? fix_position (end) : BUF_ZV (bp);
if (b > e)
- swap (b, e);
+ temp = b, b = e, e = temp;
if (!(BUF_BEGV (bp) <= b && e <= BUF_ZV (bp)))
args_out_of_range (start, end);
determines whether case is significant or ignored. */)
(Lisp_Object buffer1, Lisp_Object start1, Lisp_Object end1, Lisp_Object buffer2, Lisp_Object start2, Lisp_Object end2)
{
- register EMACS_INT begp1, endp1, begp2, endp2;
+ register EMACS_INT begp1, endp1, begp2, endp2, temp;
register struct buffer *bp1, *bp2;
register Lisp_Object trt
= (!NILP (Vcase_fold_search)
begp1 = !NILP (start1) ? fix_position (start1) : BUF_BEGV (bp1);
endp1 = !NILP (end1) ? fix_position (end1) : BUF_ZV (bp1);
if (begp1 > endp1)
- swap (begp1, endp1);
+ temp = begp1, begp1 = endp1, endp1 = temp;
if (!(BUF_BEGV (bp1) <= begp1
&& begp1 <= endp1
begp2 = !NILP (start2) ? fix_position (start2) : BUF_BEGV (bp2);
endp2 = !NILP (end2) ? fix_position (end2) : BUF_ZV (bp2);
if (begp2 > endp2)
- swap (begp2, endp2);
+ temp = begp2, begp2 = endp2, endp2 = temp;
if (!(BUF_BEGV (bp2) <= begp2
&& begp2 <= endp2
static Lisp_Object
run_hook_wrapped_funcall (ptrdiff_t nargs, Lisp_Object *args)
{
- swap (args[0], args[1]);
- Lisp_Object ret = Ffuncall (nargs, args);
- swap (args[1], args[0]);
+ Lisp_Object tmp = args[0], ret;
+ args[0] = args[1];
+ args[1] = tmp;
+ ret = Ffuncall (nargs, args);
+ args[1] = args[0];
+ args[0] = tmp;
return ret;
}
b = !NILP (start) ? fix_position (start) : BEGV;
e = !NILP (end) ? fix_position (end) : ZV;
if (b > e)
- swap (b, e);
+ {
+ EMACS_INT temp = b;
+ b = e;
+ e = temp;
+ }
if (!(BEGV <= b && e <= ZV))
args_out_of_range (start, end);
#define max(a, b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) < (b) ? (a) : (b))
-/* Swap values of a and b. */
-#define swap(a, b) \
- do { typeof (a) __tmp; __tmp = (a); (a) = (b); (b) = __tmp; } while (0);
-
/* Number of elements in an array. */
#define ARRAYELTS(arr) (sizeof (arr) / sizeof (arr)[0])
while (true)
{
- re_char *newp1, *newp2;
+ re_char *newp1, *newp2, *tmp;
re_char *p_orig = p;
int offset;
/* We have to check that both destinations are safe.
Arrange for `newp1` to be the smaller of the two. */
if (newp1 > newp2)
- swap (newp1, newp2);
+ (tmp = newp1, newp1 = newp2, newp2 = tmp);
if (newp2 <= p_orig) /* Both destinations go backward! */
{
{
specpdl_ref count;
ptrdiff_t pos, pos_byte, end, end_byte, start;
- ptrdiff_t mark;
+ ptrdiff_t temp, temp1, mark;
char *buffer;
struct window *w;
if (end < pos)
{
eassert (end_byte < pos_byte);
- swap (pos_byte, end_byte);
- swap (pos, end);
+ temp = pos_byte;
+ temp1 = pos;
+ pos_byte = end_byte;
+ pos = end;
+ end = temp1;
+ end_byte = temp;
}
/* Return the string first. */
start = marker_position (BVAR (current_buffer, mark));
end = PT;
- /* Sort start and end. */
+ /* Sort start and end. start_byte is used to hold a
+ temporary value. */
+
if (start > end)
- swap (start, end);
+ {
+ start_byte = end;
+ end = start;
+ start = start_byte;
+ }
}
else
goto finish;
ptrdiff_t *end_return)
{
specpdl_ref count;
- ptrdiff_t start, end, start_byte, end_byte, mark;
+ ptrdiff_t start, end, start_byte, end_byte, mark, temp;
char *buffer;
if (!WINDOW_LIVE_P (f->old_selected_window))
/* Now sort start and end. */
if (end < start)
- swap (start, end)
+ {
+ temp = start;
+ start = end;
+ end = temp;
+ }
/* And subtract left and right. */
return NULL;
if (XFIXNUM (*begin) > XFIXNUM (*end))
- swap (*begin, *end);
+ {
+ Lisp_Object n;
+ n = *begin;
+ *begin = *end;
+ *end = n;
+ }
if (BUFFERP (object))
{
return;
if (start > end)
- swap (start, end);
+ {
+ ptrdiff_t temp = start;
+ start = end;
+ end = temp;
+ }
/* For an insert operation, check the two chars around the position. */
if (start == end)
#define OTF_INT16_VAL(TABLE, OFFSET, PTR) \
do { \
- BYTE data[2]; \
+ BYTE temp, data[2]; \
if (GetFontData (context, TABLE, OFFSET, data, 2) != 2) \
goto font_table_error; \
- swap (data[0], data[1]); \
+ temp = data[0], data[0] = data[1], data[1] = temp; \
memcpy (PTR, data, 2); \
} while (0)
/* Swap colors if face is inverse-video. */
if (EQ (attrs[LFACE_INVERSE_INDEX], Qt))
- swap (fg, bg);
+ {
+ Lisp_Object tmp;
+ tmp = fg;
+ fg = bg;
+ bg = tmp;
+ }
/* Check for support for foreground, not for background because
face_color_supported_p is smart enough to know that grays are
#define SWAPCARD32(l) \
{ \
struct { unsigned t : 32; } bit32; \
- char *tp = (char *) &bit32; \
+ char n, *tp = (char *) &bit32; \
bit32.t = l; \
- swap (tp[0], tp[3]); \
- swap (tp[1], tp[2]); \
+ n = tp[0]; tp[0] = tp[3]; tp[3] = n; \
+ n = tp[1]; tp[1] = tp[2]; tp[2] = n; \
l = bit32.t; \
}
#define SWAPCARD16(s) \
{ \
struct { unsigned t : 16; } bit16; \
- char *tp = (char *) &bit16; \
+ char n, *tp = (char *) &bit16; \
bit16.t = s; \
- swap (tp[0], tp[1]); \
+ n = tp[0]; tp[0] = tp[1]; tp[1] = n; \
s = bit16.t; \
}