From: Paul Eggert Date: Tue, 8 Mar 2011 00:35:37 +0000 (-0800) Subject: * charset.c: Include . X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~605^2^2~65 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=726929c43aaf671dcbac9b45f9da5b7c9168f3ef;p=emacs.git * charset.c: Include . (Fsort_charsets): Redo min/max calculation to shorten the code a bit and to avoid gcc -Wuninitialized warning. --- diff --git a/src/ChangeLog b/src/ChangeLog index ec7322cfe43..39f806283f3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -31,6 +31,9 @@ * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid shadowing. * charset.c (map_charset_for_dump, Fchar_charset): Likewise. + Include . + (Fsort_charsets): Redo min/max calculation to shorten the code a bit + and to avoid gcc -Wuninitialized warning. 2011-03-06 Chong Yidong diff --git a/src/charset.c b/src/charset.c index f2fcb5bf9d7..0ce548d5a18 100644 --- a/src/charset.c +++ b/src/charset.c @@ -29,6 +29,7 @@ along with GNU Emacs. If not, see . */ #include #include #include +#include #include #include #include "lisp.h" @@ -2250,7 +2251,7 @@ See also `charset-priority-list' and `set-charset-priority'. */) int n = XFASTINT (len), i, j, done; Lisp_Object tail, elt, attrs; struct charset_sort_data *sort_data; - int id, min_id, max_id; + int id, min_id = INT_MAX, max_id = INT_MIN; USE_SAFE_ALLOCA; if (n == 0) @@ -2262,11 +2263,9 @@ See also `charset-priority-list' and `set-charset-priority'. */) CHECK_CHARSET_GET_ATTR (elt, attrs); sort_data[i].charset = elt; sort_data[i].id = id = XINT (CHARSET_ATTR_ID (attrs)); - if (i == 0) - min_id = max_id = id; - else if (id < min_id) + if (id < min_id) min_id = id; - else if (id > max_id) + if (id > max_id) max_id = id; } for (done = 0, tail = Vcharset_ordered_list, i = 0;