diff options
| author | Paul Eggert | 2011-06-21 14:32:10 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-06-21 14:32:10 -0700 |
| commit | b081724f64cbb2bf1f12efdb4d446c1de9bf3c0c (patch) | |
| tree | 00f145722fcbfb737a464ee83fbae70be8d6a4b4 /src/editfns.c | |
| parent | 3de73e5ee550ff9715e3c6034b2575a4386cf331 (diff) | |
| download | emacs-b081724f64cbb2bf1f12efdb4d446c1de9bf3c0c.tar.gz emacs-b081724f64cbb2bf1f12efdb4d446c1de9bf3c0c.zip | |
Use ptrdiff_t, not int, for overlay counts.
* buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
* editfns.c (overlays_around, get_pos_property):
* textprop.c (get_char_property_and_overlay):
* xdisp.c (next_overlay_change, note_mouse_highlight):
* xfaces.c (face_at_buffer_position):
* buffer.c (overlays_at, sort_overlays, Foverlays_at)
(Fnext_overlay_change, Fprevious_overlay_change):
Use ptrdiff_t, not int, for sizes.
(overlays_at): Check for size-calculation overflow.
Diffstat (limited to 'src/editfns.c')
| -rw-r--r-- | src/editfns.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/editfns.c b/src/editfns.c index f0f8c9eb63f..c0c0e530265 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -331,13 +331,13 @@ If you set the marker not to point anywhere, the buffer will have no mark. */) | |||
| 331 | Return the number found, and store them in a vector in VEC | 331 | Return the number found, and store them in a vector in VEC |
| 332 | of length LEN. */ | 332 | of length LEN. */ |
| 333 | 333 | ||
| 334 | static int | 334 | static ptrdiff_t |
| 335 | overlays_around (EMACS_INT pos, Lisp_Object *vec, int len) | 335 | overlays_around (EMACS_INT pos, Lisp_Object *vec, ptrdiff_t len) |
| 336 | { | 336 | { |
| 337 | Lisp_Object overlay, start, end; | 337 | Lisp_Object overlay, start, end; |
| 338 | struct Lisp_Overlay *tail; | 338 | struct Lisp_Overlay *tail; |
| 339 | EMACS_INT startpos, endpos; | 339 | EMACS_INT startpos, endpos; |
| 340 | int idx = 0; | 340 | ptrdiff_t idx = 0; |
| 341 | 341 | ||
| 342 | for (tail = current_buffer->overlays_before; tail; tail = tail->next) | 342 | for (tail = current_buffer->overlays_before; tail; tail = tail->next) |
| 343 | { | 343 | { |
| @@ -405,7 +405,7 @@ get_pos_property (Lisp_Object position, register Lisp_Object prop, Lisp_Object o | |||
| 405 | else | 405 | else |
| 406 | { | 406 | { |
| 407 | EMACS_INT posn = XINT (position); | 407 | EMACS_INT posn = XINT (position); |
| 408 | int noverlays; | 408 | ptrdiff_t noverlays; |
| 409 | Lisp_Object *overlay_vec, tem; | 409 | Lisp_Object *overlay_vec, tem; |
| 410 | struct buffer *obuf = current_buffer; | 410 | struct buffer *obuf = current_buffer; |
| 411 | 411 | ||