From 98c6f1e36ff487925280fa0b0340af9d058632b5 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 3 Aug 2012 16:36:11 -0700 Subject: 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. --- src/callproc.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/callproc.c') diff --git a/src/callproc.c b/src/callproc.c index facca887772..5eabd689188 100644 --- a/src/callproc.c +++ b/src/callproc.c @@ -427,8 +427,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) && SREF (path, 1) == ':') path = Fsubstring (path, make_number (2), Qnil); - SAFE_ALLOCA (new_argv, const unsigned char **, - (nargs > 4 ? nargs - 2 : 2) * sizeof *new_argv); + new_argv = SAFE_ALLOCA ((nargs > 4 ? nargs - 2 : 2) * sizeof *new_argv); if (nargs > 4) { ptrdiff_t i; @@ -978,8 +977,7 @@ usage: (call-process-region START END PROGRAM &optional DELETE BUFFER DISPLAY &r Lisp_Object coding_systems; Lisp_Object val, *args2; ptrdiff_t i; - char *tempfile; - Lisp_Object tmpdir, pattern; + Lisp_Object tmpdir; if (STRINGP (Vtemporary_file_directory)) tmpdir = Vtemporary_file_directory; @@ -1003,8 +1001,8 @@ usage: (call-process-region START END PROGRAM &optional DELETE BUFFER DISPLAY &r { USE_SAFE_ALLOCA; - pattern = Fexpand_file_name (Vtemp_file_name_pattern, tmpdir); - SAFE_ALLOCA (tempfile, char *, SBYTES (pattern) + 1); + Lisp_Object pattern = Fexpand_file_name (Vtemp_file_name_pattern, tmpdir); + char *tempfile = SAFE_ALLOCA (SBYTES (pattern) + 1); memcpy (tempfile, SDATA (pattern), SBYTES (pattern) + 1); coding_systems = Qt; -- cgit v1.2.1