diff options
| author | Paul Eggert | 2011-09-21 13:14:57 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-09-21 13:14:57 -0700 |
| commit | 45c2afd612c04eb594aad53c7292a93ebfa367be (patch) | |
| tree | 46d9cb6b574bec3d0783c4de9db5f9a15761014e | |
| parent | 12b3abd58ba9bfb6c2e8611254a2fa765dc1e492 (diff) | |
| download | emacs-45c2afd612c04eb594aad53c7292a93ebfa367be.tar.gz emacs-45c2afd612c04eb594aad53c7292a93ebfa367be.zip | |
* casetab.c (set_identity, shuffle): Use lint_assume.
| -rw-r--r-- | src/ChangeLog | 2 | ||||
| -rw-r--r-- | src/casetab.c | 12 |
2 files changed, 9 insertions, 5 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index de618a225e3..382ca0f4e25 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -67,7 +67,7 @@ | |||
| 67 | Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough. | 67 | Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough. |
| 68 | (casify_object): Avoid integer overflow when overallocating buffer. | 68 | (casify_object): Avoid integer overflow when overallocating buffer. |
| 69 | * casetab.c (set_identity, shuffle): Prefer int to unsigned when | 69 | * casetab.c (set_identity, shuffle): Prefer int to unsigned when |
| 70 | either works. | 70 | either works. Use lint_assume to convince GCC 4.6.1 that it's OK. |
| 71 | * category.c (Fchar_category_set): Don't assume fixnum fits in int. | 71 | * category.c (Fchar_category_set): Don't assume fixnum fits in int. |
| 72 | * category.h (CATEGORYP): Don't assume arg is nonnegative. | 72 | * category.h (CATEGORYP): Don't assume arg is nonnegative. |
| 73 | * ccl.c (GET_CCL_INT): Remove; no longer needed, since the | 73 | * ccl.c (GET_CCL_INT): Remove; no longer needed, since the |
diff --git a/src/casetab.c b/src/casetab.c index 6b639147b7b..64e47859d9b 100644 --- a/src/casetab.c +++ b/src/casetab.c | |||
| @@ -194,8 +194,7 @@ set_identity (Lisp_Object table, Lisp_Object c, Lisp_Object elt) | |||
| 194 | { | 194 | { |
| 195 | if (NATNUMP (elt)) | 195 | if (NATNUMP (elt)) |
| 196 | { | 196 | { |
| 197 | int from; | 197 | int from, to; |
| 198 | int to; | ||
| 199 | 198 | ||
| 200 | if (CONSP (c)) | 199 | if (CONSP (c)) |
| 201 | { | 200 | { |
| @@ -204,7 +203,10 @@ set_identity (Lisp_Object table, Lisp_Object c, Lisp_Object elt) | |||
| 204 | } | 203 | } |
| 205 | else | 204 | else |
| 206 | from = to = XINT (c); | 205 | from = to = XINT (c); |
| 207 | for (; from <= to; from++) | 206 | |
| 207 | to++; | ||
| 208 | lint_assume (to <= MAX_CHAR + 1); | ||
| 209 | for (; from < to; from++) | ||
| 208 | CHAR_TABLE_SET (table, from, make_number (from)); | 210 | CHAR_TABLE_SET (table, from, make_number (from)); |
| 209 | } | 211 | } |
| 210 | } | 212 | } |
| @@ -229,7 +231,9 @@ shuffle (Lisp_Object table, Lisp_Object c, Lisp_Object elt) | |||
| 229 | else | 231 | else |
| 230 | from = to = XINT (c); | 232 | from = to = XINT (c); |
| 231 | 233 | ||
| 232 | for (; from <= to; from++) | 234 | to++; |
| 235 | lint_assume (to <= MAX_CHAR + 1); | ||
| 236 | for (; from < to; from++) | ||
| 233 | { | 237 | { |
| 234 | Lisp_Object tem = Faref (table, elt); | 238 | Lisp_Object tem = Faref (table, elt); |
| 235 | Faset (table, elt, make_number (from)); | 239 | Faset (table, elt, make_number (from)); |