aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/buffer.c b/src/buffer.c
index e1c33f4c711..838932db4df 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -2793,11 +2793,11 @@ mouse_face_overlay_overlaps (Lisp_Object overlay)
2793 Lisp_Object *v, tem; 2793 Lisp_Object *v, tem;
2794 2794
2795 size = 10; 2795 size = 10;
2796 v = (Lisp_Object *) alloca (size * sizeof *v); 2796 v = alloca (size * sizeof *v);
2797 n = overlays_in (start, end, 0, &v, &size, NULL, NULL); 2797 n = overlays_in (start, end, 0, &v, &size, NULL, NULL);
2798 if (n > size) 2798 if (n > size)
2799 { 2799 {
2800 v = (Lisp_Object *) alloca (n * sizeof *v); 2800 v = alloca (n * sizeof *v);
2801 overlays_in (start, end, 0, &v, &n, NULL, NULL); 2801 overlays_in (start, end, 0, &v, &n, NULL, NULL);
2802 } 2802 }
2803 2803
@@ -2885,8 +2885,7 @@ ptrdiff_t
2885sort_overlays (Lisp_Object *overlay_vec, ptrdiff_t noverlays, struct window *w) 2885sort_overlays (Lisp_Object *overlay_vec, ptrdiff_t noverlays, struct window *w)
2886{ 2886{
2887 ptrdiff_t i, j; 2887 ptrdiff_t i, j;
2888 struct sortvec *sortvec; 2888 struct sortvec *sortvec = alloca (noverlays * sizeof *sortvec);
2889 sortvec = (struct sortvec *) alloca (noverlays * sizeof (struct sortvec));
2890 2889
2891 /* Put the valid and relevant overlays into sortvec. */ 2890 /* Put the valid and relevant overlays into sortvec. */
2892 2891
@@ -3893,7 +3892,7 @@ DEFUN ("overlays-at", Foverlays_at, Soverlays_at, 1, 1, 0,
3893 3892
3894 len = 10; 3893 len = 10;
3895 /* We can't use alloca here because overlays_at can call xrealloc. */ 3894 /* We can't use alloca here because overlays_at can call xrealloc. */
3896 overlay_vec = xmalloc (len * sizeof (Lisp_Object)); 3895 overlay_vec = xmalloc (len * sizeof *overlay_vec);
3897 3896
3898 /* Put all the overlays we want in a vector in overlay_vec. 3897 /* Put all the overlays we want in a vector in overlay_vec.
3899 Store the length in len. */ 3898 Store the length in len. */
@@ -3924,7 +3923,7 @@ end of the buffer. */)
3924 CHECK_NUMBER_COERCE_MARKER (end); 3923 CHECK_NUMBER_COERCE_MARKER (end);
3925 3924
3926 len = 10; 3925 len = 10;
3927 overlay_vec = xmalloc (len * sizeof (Lisp_Object)); 3926 overlay_vec = xmalloc (len * sizeof *overlay_vec);
3928 3927
3929 /* Put all the overlays we want in a vector in overlay_vec. 3928 /* Put all the overlays we want in a vector in overlay_vec.
3930 Store the length in len. */ 3929 Store the length in len. */
@@ -3952,7 +3951,7 @@ the value is (point-max). */)
3952 CHECK_NUMBER_COERCE_MARKER (pos); 3951 CHECK_NUMBER_COERCE_MARKER (pos);
3953 3952
3954 len = 10; 3953 len = 10;
3955 overlay_vec = xmalloc (len * sizeof (Lisp_Object)); 3954 overlay_vec = xmalloc (len * sizeof *overlay_vec);
3956 3955
3957 /* Put all the overlays we want in a vector in overlay_vec. 3956 /* Put all the overlays we want in a vector in overlay_vec.
3958 Store the length in len. 3957 Store the length in len.
@@ -3996,7 +3995,7 @@ the value is (point-min). */)
3996 return pos; 3995 return pos;
3997 3996
3998 len = 10; 3997 len = 10;
3999 overlay_vec = xmalloc (len * sizeof (Lisp_Object)); 3998 overlay_vec = xmalloc (len * sizeof *overlay_vec);
4000 3999
4001 /* Put all the overlays we want in a vector in overlay_vec. 4000 /* Put all the overlays we want in a vector in overlay_vec.
4002 Store the length in len. 4001 Store the length in len.
@@ -4251,7 +4250,7 @@ report_overlay_modification (Lisp_Object start, Lisp_Object end, int after,
4251 First copy the vector contents, in case some of these hooks 4250 First copy the vector contents, in case some of these hooks
4252 do subsequent modification of the buffer. */ 4251 do subsequent modification of the buffer. */
4253 ptrdiff_t size = last_overlay_modification_hooks_used; 4252 ptrdiff_t size = last_overlay_modification_hooks_used;
4254 Lisp_Object *copy = (Lisp_Object *) alloca (size * sizeof (Lisp_Object)); 4253 Lisp_Object *copy = alloca (size * sizeof *copy);
4255 ptrdiff_t i; 4254 ptrdiff_t i;
4256 4255
4257 memcpy (copy, XVECTOR (last_overlay_modification_hooks)->contents, 4256 memcpy (copy, XVECTOR (last_overlay_modification_hooks)->contents,
@@ -4873,7 +4872,7 @@ init_buffer_once (void)
4873 /* If you add, remove, or reorder Lisp_Objects in a struct buffer, make 4872 /* If you add, remove, or reorder Lisp_Objects in a struct buffer, make
4874 sure that this is still correct. Otherwise, mark_vectorlike may not 4873 sure that this is still correct. Otherwise, mark_vectorlike may not
4875 trace all Lisp_Objects in buffer_defaults and buffer_local_symbols. */ 4874 trace all Lisp_Objects in buffer_defaults and buffer_local_symbols. */
4876 const int pvecsize 4875 const int pvecsize
4877 = (offsetof (struct buffer, own_text) - sizeof (struct vectorlike_header)) 4876 = (offsetof (struct buffer, own_text) - sizeof (struct vectorlike_header))
4878 / sizeof (Lisp_Object); 4877 / sizeof (Lisp_Object);
4879 4878
@@ -5089,7 +5088,7 @@ init_buffer (void)
5089 if (!(IS_DIRECTORY_SEP (pwd[len - 1]))) 5088 if (!(IS_DIRECTORY_SEP (pwd[len - 1])))
5090 { 5089 {
5091 /* Grow buffer to add directory separator and '\0'. */ 5090 /* Grow buffer to add directory separator and '\0'. */
5092 pwd = (char *) realloc (pwd, len + 2); 5091 pwd = realloc (pwd, len + 2);
5093 if (!pwd) 5092 if (!pwd)
5094 fatal ("`get_current_dir_name' failed: %s\n", strerror (errno)); 5093 fatal ("`get_current_dir_name' failed: %s\n", strerror (errno));
5095 pwd[len] = DIRECTORY_SEP; 5094 pwd[len] = DIRECTORY_SEP;