diff options
author | Po Lu <luangruo@yahoo.com> | 2024-01-06 15:28:14 +0800 |
---|---|---|
committer | Po Lu <luangruo@yahoo.com> | 2024-01-06 15:28:14 +0800 |
commit | 657275529e31226bbc6c92eb7f7af887474a0bb8 (patch) | |
tree | 1a2091dfb27b9932c6e17a18f458f52b4c1ecc4d /src/dispnew.c | |
parent | 2f59052602e71fb818dd5d671be119793864e712 (diff) | |
download | emacs-657275529e31226bbc6c92eb7f7af887474a0bb8.tar.gz |
Revert "Add new `swap` macro and use it"
typeof is an extension which does not exist in Standard C, so macros
using it are unsuitable for inclusion in Emacs.
This reverts commit 37889523278fe65733938fb11c3701898309961c.
Diffstat (limited to 'src/dispnew.c')
-rw-r--r-- | src/dispnew.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/dispnew.c b/src/dispnew.c index 78ec3537a35..d0f259eef6c 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -649,7 +649,14 @@ reverse_rows (struct glyph_matrix *matrix, int start, int end) 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; + } } @@ -959,7 +966,9 @@ increment_row_positions (struct glyph_row *row, 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]); @@ -975,7 +984,12 @@ swap_glyphs_in_rows (struct glyph_row *a, struct glyph_row *b) 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; } |