Mercurial > hg > xemacs-beta
comparison src/fns.c @ 5471:00e79bbbe48f
Merge with trunk.
author | Mats Lidell <matsl@xemacs.org> |
---|---|
date | Mon, 14 Feb 2011 22:43:46 +0100 |
parents | 0af042a0c116 70b15ac66ee5 |
children | e79980ee5efe |
comparison
equal
deleted
inserted
replaced
5470:0af042a0c116 | 5471:00e79bbbe48f |
---|---|
7141 the length of the shortest sequence. Error if all are circular, or if any | 7141 the length of the shortest sequence. Error if all are circular, or if any |
7142 one of them is not a sequence. */ | 7142 one of them is not a sequence. */ |
7143 static Elemcount | 7143 static Elemcount |
7144 shortest_length_among_sequences (int nsequences, Lisp_Object *sequences) | 7144 shortest_length_among_sequences (int nsequences, Lisp_Object *sequences) |
7145 { | 7145 { |
7146 Elemcount len = EMACS_INT_MAX; | 7146 Elemcount len = 1 + EMACS_INT_MAX; |
7147 Lisp_Object length = Qnil; | 7147 Lisp_Object length = Qnil; |
7148 int i; | 7148 int i; |
7149 | 7149 |
7150 for (i = 0; i < nsequences; ++i) | 7150 for (i = 0; i < nsequences; ++i) |
7151 { | 7151 { |
7163 length = Flength (sequences[i]); | 7163 length = Flength (sequences[i]); |
7164 len = min (len, XINT (length)); | 7164 len = min (len, XINT (length)); |
7165 } | 7165 } |
7166 } | 7166 } |
7167 | 7167 |
7168 if (NILP (length)) | 7168 if (len == 1 + EMACS_INT_MAX) |
7169 { | 7169 { |
7170 signal_circular_list_error (sequences[0]); | 7170 signal_circular_list_error (sequences[0]); |
7171 } | 7171 } |
7172 | 7172 |
7173 return len; | 7173 return len; |