aboutsummaryrefslogtreecommitdiffstats
path: root/src/editfns.c
diff options
context:
space:
mode:
authorPaul Eggert2012-08-03 16:36:11 -0700
committerPaul Eggert2012-08-03 16:36:11 -0700
commit98c6f1e36ff487925280fa0b0340af9d058632b5 (patch)
tree5601a2ac9433883b753a36f8d9c15f9d9d0b0eec /src/editfns.c
parent8834c57aab03fb7ea9d92f9e995844ff7ce64b7b (diff)
downloademacs-98c6f1e36ff487925280fa0b0340af9d058632b5.tar.gz
emacs-98c6f1e36ff487925280fa0b0340af9d058632b5.zip
Remove unnecessary casts involving pointers.
These casts are no longer needed now that we assume C89 or later, since they involve casting to or from void *. * alloc.c (make_pure_string, make_pure_c_string, pure_cons) (make_pure_float, make_pure_vector): * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): * macros.c (Fstart_kbd_macro): * menu.c (find_and_return_menu_selection): * minibuf.c (read_minibuf_noninteractive): * sysdep.c (closedir): * xdisp.c (x_produce_glyphs): * xfaces.c (compare_fonts_by_sort_order): * xfns.c (x_real_positions, select_visual): * xselect.c (x_stop_queuing_selection_requests) (x_get_window_property, x_get_window_property_as_lisp_data): * xterm.c (x_set_frame_alpha, x_find_modifier_meanings): Remove unnecessary pointer casts. * alloc.c (record_xmalloc): New function. * lisp.h (record_xmalloc): New decl. (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts more like a function. This is because the pointer cast is not needed. All uses changed. * print.c (print_string, print_error_message): Avoid length recalc.
Diffstat (limited to 'src/editfns.c')
-rw-r--r--src/editfns.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/editfns.c b/src/editfns.c
index e657b3ec532..f86b4c12f58 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -1793,7 +1793,7 @@ format_time_string (char const *format, ptrdiff_t formatlen,
1793 if (STRING_BYTES_BOUND <= len) 1793 if (STRING_BYTES_BOUND <= len)
1794 string_overflow (); 1794 string_overflow ();
1795 size = len + 1; 1795 size = len + 1;
1796 SAFE_ALLOCA (buf, char *, size); 1796 buf = SAFE_ALLOCA (size);
1797 } 1797 }
1798 1798
1799 UNBLOCK_INPUT; 1799 UNBLOCK_INPUT;
@@ -2072,7 +2072,7 @@ the data it can't find. */)
2072 int m = offset / 60; 2072 int m = offset / 60;
2073 int am = offset < 0 ? - m : m; 2073 int am = offset < 0 ? - m : m;
2074 char buf[sizeof "+00" + INT_STRLEN_BOUND (int)]; 2074 char buf[sizeof "+00" + INT_STRLEN_BOUND (int)];
2075 zone_name = make_formatted_string (buf, "%c%02d%02d", 2075 zone_name = make_formatted_string (buf, "%c%02d%02d",
2076 (offset < 0 ? '-' : '+'), 2076 (offset < 0 ? '-' : '+'),
2077 am / 60, am % 60); 2077 am / 60, am % 60);
2078 } 2078 }
@@ -3686,7 +3686,7 @@ usage: (format STRING &rest OBJECTS) */)
3686 ptrdiff_t i; 3686 ptrdiff_t i;
3687 if ((SIZE_MAX - formatlen) / sizeof (struct info) <= nargs) 3687 if ((SIZE_MAX - formatlen) / sizeof (struct info) <= nargs)
3688 memory_full (SIZE_MAX); 3688 memory_full (SIZE_MAX);
3689 SAFE_ALLOCA (info, struct info *, (nargs + 1) * sizeof *info + formatlen); 3689 info = SAFE_ALLOCA ((nargs + 1) * sizeof *info + formatlen);
3690 discarded = (char *) &info[nargs + 1]; 3690 discarded = (char *) &info[nargs + 1];
3691 for (i = 0; i < nargs + 1; i++) 3691 for (i = 0; i < nargs + 1; i++)
3692 { 3692 {
@@ -4645,7 +4645,7 @@ Transposing beyond buffer boundaries is an error. */)
4645 { 4645 {
4646 USE_SAFE_ALLOCA; 4646 USE_SAFE_ALLOCA;
4647 4647
4648 SAFE_ALLOCA (temp, unsigned char *, len2_byte); 4648 temp = SAFE_ALLOCA (len2_byte);
4649 4649
4650 /* Don't precompute these addresses. We have to compute them 4650 /* Don't precompute these addresses. We have to compute them
4651 at the last minute, because the relocating allocator might 4651 at the last minute, because the relocating allocator might
@@ -4663,7 +4663,7 @@ Transposing beyond buffer boundaries is an error. */)
4663 { 4663 {
4664 USE_SAFE_ALLOCA; 4664 USE_SAFE_ALLOCA;
4665 4665
4666 SAFE_ALLOCA (temp, unsigned char *, len1_byte); 4666 temp = SAFE_ALLOCA (len1_byte);
4667 start1_addr = BYTE_POS_ADDR (start1_byte); 4667 start1_addr = BYTE_POS_ADDR (start1_byte);
4668 start2_addr = BYTE_POS_ADDR (start2_byte); 4668 start2_addr = BYTE_POS_ADDR (start2_byte);
4669 memcpy (temp, start1_addr, len1_byte); 4669 memcpy (temp, start1_addr, len1_byte);
@@ -4703,7 +4703,7 @@ Transposing beyond buffer boundaries is an error. */)
4703 if (!NULL_INTERVAL_P (tmp_interval3)) 4703 if (!NULL_INTERVAL_P (tmp_interval3))
4704 set_text_properties_1 (startr2, endr2, Qnil, buf, tmp_interval3); 4704 set_text_properties_1 (startr2, endr2, Qnil, buf, tmp_interval3);
4705 4705
4706 SAFE_ALLOCA (temp, unsigned char *, len1_byte); 4706 temp = SAFE_ALLOCA (len1_byte);
4707 start1_addr = BYTE_POS_ADDR (start1_byte); 4707 start1_addr = BYTE_POS_ADDR (start1_byte);
4708 start2_addr = BYTE_POS_ADDR (start2_byte); 4708 start2_addr = BYTE_POS_ADDR (start2_byte);
4709 memcpy (temp, start1_addr, len1_byte); 4709 memcpy (temp, start1_addr, len1_byte);
@@ -4733,7 +4733,7 @@ Transposing beyond buffer boundaries is an error. */)
4733 set_text_properties_1 (startr1, endr2, Qnil, buf, tmp_interval3); 4733 set_text_properties_1 (startr1, endr2, Qnil, buf, tmp_interval3);
4734 4734
4735 /* holds region 2 */ 4735 /* holds region 2 */
4736 SAFE_ALLOCA (temp, unsigned char *, len2_byte); 4736 temp = SAFE_ALLOCA (len2_byte);
4737 start1_addr = BYTE_POS_ADDR (start1_byte); 4737 start1_addr = BYTE_POS_ADDR (start1_byte);
4738 start2_addr = BYTE_POS_ADDR (start2_byte); 4738 start2_addr = BYTE_POS_ADDR (start2_byte);
4739 memcpy (temp, start2_addr, len2_byte); 4739 memcpy (temp, start2_addr, len2_byte);
@@ -4766,7 +4766,7 @@ Transposing beyond buffer boundaries is an error. */)
4766 set_text_properties_1 (startr1, endr2, Qnil, buf, tmp_interval3); 4766 set_text_properties_1 (startr1, endr2, Qnil, buf, tmp_interval3);
4767 4767
4768 /* holds region 1 */ 4768 /* holds region 1 */
4769 SAFE_ALLOCA (temp, unsigned char *, len1_byte); 4769 temp = SAFE_ALLOCA (len1_byte);
4770 start1_addr = BYTE_POS_ADDR (start1_byte); 4770 start1_addr = BYTE_POS_ADDR (start1_byte);
4771 start2_addr = BYTE_POS_ADDR (start2_byte); 4771 start2_addr = BYTE_POS_ADDR (start2_byte);
4772 memcpy (temp, start1_addr, len1_byte); 4772 memcpy (temp, start1_addr, len1_byte);