Mercurial > emacs
changeset 40606:d590ec395dcd
(four_corners_best): Reindent.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Thu, 01 Nov 2001 10:38:27 +0000 |
parents | 9c8c502c1713 |
children | 657c6d2b13a2 |
files | src/xfns.c |
diffstat | 1 files changed, 22 insertions(+), 22 deletions(-) [+] |
line wrap: on
line diff
--- a/src/xfns.c Thu Nov 01 10:23:52 2001 +0000 +++ b/src/xfns.c Thu Nov 01 10:38:27 2001 +0000 @@ -5778,29 +5778,29 @@ XImage *ximg; unsigned long width, height; { - unsigned long corners[4], best; - int i, best_count; - - /* Get the colors at the corners of ximg. */ - corners[0] = XGetPixel (ximg, 0, 0); - corners[1] = XGetPixel (ximg, width - 1, 0); - corners[2] = XGetPixel (ximg, width - 1, height - 1); - corners[3] = XGetPixel (ximg, 0, height - 1); - - /* Choose the most frequently found color as background. */ - for (i = best_count = 0; i < 4; ++i) - { - int j, n; + unsigned long corners[4], best; + int i, best_count; + + /* Get the colors at the corners of ximg. */ + corners[0] = XGetPixel (ximg, 0, 0); + corners[1] = XGetPixel (ximg, width - 1, 0); + corners[2] = XGetPixel (ximg, width - 1, height - 1); + corners[3] = XGetPixel (ximg, 0, height - 1); + + /* Choose the most frequently found color as background. */ + for (i = best_count = 0; i < 4; ++i) + { + int j, n; - for (j = n = 0; j < 4; ++j) - if (corners[i] == corners[j]) - ++n; - - if (n > best_count) - best = corners[i], best_count = n; - } - - return best; + for (j = n = 0; j < 4; ++j) + if (corners[i] == corners[j]) + ++n; + + if (n > best_count) + best = corners[i], best_count = n; + } + + return best; } /* Return the `background' field of IMG. If IMG doesn't have one yet,