Mercurial > emacs
changeset 109428:5ba21f4a3d62
Merge from mainline.
author | Katsumi Yamaoka <yamaoka@jpl.org> |
---|---|
date | Thu, 08 Jul 2010 22:47:34 +0000 |
parents | 9d1a0d3d72be (current diff) 8cfee7d2955f (diff) |
children | 98c38f2ddca3 |
files | src/prefix-args.c |
diffstat | 145 files changed, 2681 insertions(+), 4268 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Wed Jul 07 22:09:05 2010 +0000 +++ b/ChangeLog Thu Jul 08 22:47:34 2010 +0000 @@ -1,3 +1,15 @@ +2010-07-08 Dan Nicolaescu <dann@ics.uci.edu> + + * configure.in (PRE_EDIT_LDFLAGS, POST_EDIT_LDFLAGS): Remove. + + * configure.in (UNEXEC_OBJ): Add comment about values for MSDOS + and MSWindows. + +2010-07-07 Andreas Schwab <schwab@linux-m68k.org> + + * configure.in: Don't check for bcopy, bcmp, bzero. Don't include + <strings.h> and don't define bcopy, bzero, BCMP in config.h. + 2010-07-07 Dan Nicolaescu <dann@ics.uci.edu> * configure.in (getenv): Remove K&R declaration.
--- a/admin/CPP-DEFINES Wed Jul 07 22:09:05 2010 +0000 +++ b/admin/CPP-DEFINES Thu Jul 08 22:47:34 2010 +0000 @@ -79,8 +79,6 @@ AIX AMPERSAND_FULL_NAME -BCOPY_DOWNWARD_SAFE -BCOPY_UPWARD_SAFE BITS_PER_EMACS_INT BITS_PER_LONG BITS_PER_CHAR @@ -118,7 +116,6 @@ FILE_SYSTEM_CASE FLOAT_CHECK_DOMAIN FSCALE -GAP_USE_BCOPY GC_LISP_OBJECT_ALIGNMENT GC_MARK_SECONDARY_STACK GC_MARK_STACK @@ -128,8 +125,6 @@ GNU_LINUX GNU_MALLOC HAVE_AIX_SMT_EXP -HAVE_BCMP -HAVE_BCOPY HAVE_CBRT HAVE_CLOSEDIR HAVE_DUP2 @@ -191,7 +186,6 @@ HAVE_SYS_TIME_H HAVE_TCATTR HAVE_TERMIOS_H -HAVE_TEXT_START HAVE_TIMEVAL HAVE_TM_ZONE HAVE_TZSET @@ -267,7 +261,6 @@ TAB3 TABDLY TERM -TEXT_START THIS_IS_CONFIGURE TIME_WITH_SYS_TIME TIOCSIGSEND @@ -319,10 +312,7 @@ abort access alloca -bcmp -bcopy brk -bzero calloc chdir chmod
--- a/admin/ChangeLog Wed Jul 07 22:09:05 2010 +0000 +++ b/admin/ChangeLog Thu Jul 08 22:47:34 2010 +0000 @@ -1,3 +1,13 @@ +2010-07-08 Eli Zaretskii <eliz@gnu.org> + + * MAINTAINERS: Update my responsibilities. + +2010-07-07 Andreas Schwab <schwab@linux-m68k.org> + + * CPP-DEFINES (BCOPY_DOWNWARD_SAFE, BCOPY_UPWARD_SAFE) + (GAP_USE_BCOPY, HAVE_BCMP, HAVE_BCOPY, bcmp, bcopy, bzero): + Remove. + 2010-06-12 Eli Zaretskii <eliz@gnu.org> * unidata/bidimirror.awk: New file.
--- a/admin/MAINTAINERS Wed Jul 07 22:09:05 2010 +0000 +++ b/admin/MAINTAINERS Thu Jul 08 22:47:34 2010 +0000 @@ -23,6 +23,11 @@ W32 Eli Zaretskii + + src/bidi.c + bidirectional editing support in xdisp.c and elsewhere + lisp/term/tty-colors.el + The MS-DOS (a.k.a. DJGPP) port: config.bat msdos/* @@ -35,11 +40,7 @@ lisp/dos-fns.el lisp/dos-w32.el lisp/dos-vars.el - - lisp/term/tty-colors.el - lisp/international/codepage.el - - doc/emacs/msdog.texi + doc/emacs/msdog.texi Kenichi Handa Mule @@ -91,6 +92,7 @@ info/dir src/xfaces.c + src/xdisp.c src/term.c src/frame.c src/dired.c
--- a/configure Wed Jul 07 22:09:05 2010 +0000 +++ b/configure Thu Jul 08 22:47:34 2010 +0000 @@ -600,8 +600,6 @@ MOUSE_SUPPORT LIB_GCC LINKER -POST_EDIT_LDFLAGS -PRE_EDIT_LDFLAGS LD_SWITCH_SYSTEM_TEMACS POST_ALLOC_OBJ PRE_ALLOC_OBJ @@ -5484,6 +5482,8 @@ UNEXEC_OBJ=unexelf.o case "$opsys" in + # MSDOS uses unexec.o + # MSWindows uses unexw32.o aix4-2) UNEXEC_OBJ=unexaix.o ;; @@ -11168,12 +11168,12 @@ for ac_func in gethostname getdomainname dup2 \ rename closedir mkdir rmdir sysinfo getrusage get_current_dir_name \ -random lrand48 bcopy bcmp logb frexp fmod rint cbrt ftime setsid \ +random lrand48 logb frexp fmod rint cbrt ftime setsid \ strerror fpathconf select mktime euidaccess getpagesize tzset setlocale \ utimes getrlimit setrlimit setpgid getcwd getwd shutdown getaddrinfo \ __fpending mblen mbrlen mbsinit strsignal setitimer ualarm index rindex \ sendto recvfrom getsockopt setsockopt getsockname getpeername \ -gai_strerror mkstemp getline getdelim mremap memmove fsync sync bzero \ +gai_strerror mkstemp getline getdelim mremap memmove fsync sync \ memset memcmp difftime memcpy mempcpy mblen mbrlen posix_memalign \ cfmakeraw cfsetspeed isnan copysign do : @@ -14161,8 +14161,6 @@ esac -PRE_EDIT_LDFLAGS= -POST_EDIT_LDFLAGS= if test "x$ORDINARY_LINK" = "xyes"; then LINKER="\$(CC)" @@ -14183,17 +14181,7 @@ ## searching for libraries in its internal directories, so we have to ## ask GCC explicitly where to find libgcc.a (LIB_GCC below). LINKER="\$(CC) -nostdlib" - ## GCC passes any argument prefixed with -Xlinker directly to the linker. - ## See prefix-args.c for an explanation of why we do not do this with the - ## shell''s ``for'' construct. Note that sane people do not have '.' in - ## their paths, so we must use ./prefix-args. - ## TODO either make prefix-args check ORDINARY_LINK internally, - ## or remove it altogether (bug#6184), removing the need for this hack. - PRE_EDIT_LDFLAGS='`./prefix-args -Xlinker' - POST_EDIT_LDFLAGS='`' -fi - - +fi test "x$LINKER" = "x" && LINKER=ld ## FIXME? What setting of EDIT_LDFLAGS should this have?
--- a/configure.in Wed Jul 07 22:09:05 2010 +0000 +++ b/configure.in Thu Jul 08 22:47:34 2010 +0000 @@ -890,6 +890,8 @@ UNEXEC_OBJ=unexelf.o case "$opsys" in + # MSDOS uses unexec.o + # MSWindows uses unexw32.o aix4-2) UNEXEC_OBJ=unexaix.o ;; @@ -2615,12 +2617,12 @@ AC_CHECK_FUNCS(gethostname getdomainname dup2 \ rename closedir mkdir rmdir sysinfo getrusage get_current_dir_name \ -random lrand48 bcopy bcmp logb frexp fmod rint cbrt ftime setsid \ +random lrand48 logb frexp fmod rint cbrt ftime setsid \ strerror fpathconf select mktime euidaccess getpagesize tzset setlocale \ utimes getrlimit setrlimit setpgid getcwd getwd shutdown getaddrinfo \ __fpending mblen mbrlen mbsinit strsignal setitimer ualarm index rindex \ sendto recvfrom getsockopt setsockopt getsockname getpeername \ -gai_strerror mkstemp getline getdelim mremap memmove fsync sync bzero \ +gai_strerror mkstemp getline getdelim mremap memmove fsync sync \ memset memcmp difftime memcpy mempcpy mblen mbrlen posix_memalign \ cfmakeraw cfsetspeed isnan copysign) @@ -3358,8 +3360,6 @@ esac -PRE_EDIT_LDFLAGS= -POST_EDIT_LDFLAGS= if test "x$ORDINARY_LINK" = "xyes"; then LINKER="\$(CC)" @@ -3378,17 +3378,7 @@ ## searching for libraries in its internal directories, so we have to ## ask GCC explicitly where to find libgcc.a (LIB_GCC below). LINKER="\$(CC) -nostdlib" - ## GCC passes any argument prefixed with -Xlinker directly to the linker. - ## See prefix-args.c for an explanation of why we do not do this with the - ## shell''s ``for'' construct. Note that sane people do not have '.' in - ## their paths, so we must use ./prefix-args. - ## TODO either make prefix-args check ORDINARY_LINK internally, - ## or remove it altogether (bug#6184), removing the need for this hack. - PRE_EDIT_LDFLAGS='`./prefix-args -Xlinker' - POST_EDIT_LDFLAGS='`' fi -AC_SUBST(PRE_EDIT_LDFLAGS) -AC_SUBST(POST_EDIT_LDFLAGS) test "x$LINKER" = "x" && LINKER=ld ## FIXME? What setting of EDIT_LDFLAGS should this have? @@ -3574,10 +3564,6 @@ #include <string.h> #endif -#ifdef HAVE_STRINGS_H -#include <strings.h> /* May be needed for bcopy & al. */ -#endif - #ifdef HAVE_STDLIB_H #include <stdlib.h> #endif @@ -3619,16 +3605,6 @@ # endif #endif -#ifndef HAVE_BCOPY -#define bcopy(a,b,s) memcpy (b,a,s) -#endif -#ifndef HAVE_BZERO -#define bzero(a,s) memset (a,0,s) -#endif -#ifndef HAVE_BCMP -#define BCMP memcmp -#endif - #endif /* EMACS_CONFIG_H */ /*
--- a/lib-src/ChangeLog Wed Jul 07 22:09:05 2010 +0000 +++ b/lib-src/ChangeLog Thu Jul 08 22:47:34 2010 +0000 @@ -1,3 +1,15 @@ +2010-07-08 Dan Nicolaescu <dann@ics.uci.edu> + + * update-game-score.c (P_): Remove macro. + * ebrowse.c: Remove include guards. + (P_): Remove macro. + +2010-07-07 Andreas Schwab <schwab@linux-m68k.org> + + * ebrowse.c (add_sym, make_namespace): Replace bcopy, bzero by + memcpy, memmove, memset. + * pop.c (pop_retrieve, socket_connection, pop_getline): Likewise. + 2010-07-06 Andreas Schwab <schwab@linux-m68k.org> * movemail.c: Add MAIL_USE_POP around prototypes.
--- a/lib-src/ebrowse.c Wed Jul 07 22:09:05 2010 +0000 +++ b/lib-src/ebrowse.c Thu Jul 08 22:47:34 2010 +0000 @@ -20,20 +20,14 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ -#ifdef HAVE_CONFIG_H #include <config.h> -#endif - #include <stdio.h> #ifdef HAVE_STDLIB_H #include <stdlib.h> #endif -#ifdef HAVE_STRING_H #include <string.h> -#endif - #include <ctype.h> #include <assert.h> #include "getopt.h" @@ -45,12 +39,6 @@ /* Conditionalize function prototypes. */ -#ifdef PROTOTYPES /* From config.h. */ -#define P_(x) x -#else -#define P_(x) () -#endif - /* Value is non-zero if strings X and Y compare equal. */ #define streq(X, Y) (*(X) == *(Y) && strcmp ((X) + 1, (Y) + 1) == 0) @@ -647,7 +635,7 @@ } sym = (struct sym *) xmalloc (sizeof *sym + strlen (name)); - bzero (sym, sizeof *sym); + memset (sym, 0, sizeof *sym); strcpy (sym->name, name); sym->namesp = scope; sym->next = class_table[h]; @@ -1042,7 +1030,7 @@ make_namespace (char *name, struct sym *context) { struct sym *s = (struct sym *) xmalloc (sizeof *s + strlen (name)); - bzero (s, sizeof *s); + memset (s, 0, sizeof *s); strcpy (s->name, name); s->next = all_namespaces; s->namesp = context;
--- a/lib-src/pop.c Wed Jul 07 22:09:05 2010 +0000 +++ b/lib-src/pop.c Thu Jul 08 22:47:34 2010 +0000 @@ -612,7 +612,7 @@ } ptr[cp++] = '>'; } - bcopy (fromserver, &ptr[cp], ret); + memcpy (&ptr[cp], fromserver, ret); cp += ret; ptr[cp++] = '\n'; } @@ -1020,7 +1020,7 @@ } #endif - bzero ((char *) &addr, sizeof (addr)); + memset (&addr, 0, sizeof (addr)); addr.sin_family = AF_INET; /** "kpop" service is never used: look for 20060515 to see why **/ @@ -1096,8 +1096,7 @@ if (it->ai_addrlen == sizeof (addr)) { struct sockaddr_in *in_a = (struct sockaddr_in *) it->ai_addr; - bcopy (&in_a->sin_addr, (char *) &addr.sin_addr, - sizeof (addr.sin_addr)); + memcpy (&addr.sin_addr, &in_a->sin_addr, sizeof (addr.sin_addr)); if (! connect (sock, (struct sockaddr *) &addr, sizeof (addr))) break; } @@ -1125,8 +1124,7 @@ while (*hostent->h_addr_list) { - bcopy (*hostent->h_addr_list, (char *) &addr.sin_addr, - hostent->h_length); + memcpy (&addr.sin_addr, *hostent->h_addr_list, hostent->h_length); if (! connect (sock, (struct sockaddr *) &addr, sizeof (addr))) break; hostent->h_addr_list++; @@ -1318,8 +1316,8 @@ } else { - bcopy (server->buffer + server->buffer_index, - server->buffer, server->data); + memmove (server->buffer, server->buffer + server->buffer_index, + server->data); /* Record the fact that we've searched the data already in the buffer for a CRLF, so that when we search below, we don't have to search the same data twice. There's a "-
--- a/lib-src/update-game-score.c Wed Jul 07 22:09:05 2010 +0000 +++ b/lib-src/update-game-score.c Thu Jul 08 22:47:34 2010 +0000 @@ -64,13 +64,6 @@ #define MAX_SCORES 200 #define MAX_DATA_LEN 1024 -/* Declare the prototype for a general external function. */ -#if defined (PROTOTYPES) || defined (WINDOWSNT) -#define P_(proto) proto -#else -#define P_(proto) () -#endif - #ifndef HAVE_DIFFTIME /* OK on POSIX (time_t is arithmetic type) modulo overflow in subtraction. */ #define difftime(t1, t0) (double)((t1) - (t0))
--- a/lisp/ChangeLog Wed Jul 07 22:09:05 2010 +0000 +++ b/lisp/ChangeLog Thu Jul 08 22:47:34 2010 +0000 @@ -1,3 +1,10 @@ +2010-07-08 Daiki Ueno <ueno@unixuser.org> + + * epa-file.el (epa-file-error, epa-file--find-file-not-found-function) + (epa-file-insert-file-contents): Hack to prevent + find-file from opening empty buffer when decryptin failed + (bug#6568). + 2010-07-07 AgustÃn MartÃn <agustin.martin@hispalinux.es> * ispell.el (ispell-alternate-dictionary): Use file-readable-p.
--- a/lisp/epa-file.el Wed Jul 07 22:09:05 2010 +0000 +++ b/lisp/epa-file.el Thu Jul 08 22:47:34 2010 +0000 @@ -101,6 +101,14 @@ (insert (epa-file--decode-coding-string string (or coding-system-for-read 'undecided))))) +(defvar epa-file-error nil) +(defun epa-file--find-file-not-found-function () + (let ((error epa-file-error)) + (save-window-excursion + (kill-buffer)) + (signal 'file-error + (cons "Opening input file" (cdr error))))) + (defvar last-coding-system-used) (defun epa-file-insert-file-contents (file &optional visit beg end replace) (barf-if-buffer-read-only) @@ -131,6 +139,15 @@ (error (if (setq entry (assoc file epa-file-passphrase-alist)) (setcdr entry nil)) + ;; Hack to prevent find-file from opening empty buffer + ;; when decryption failed (bug#6568). See the place + ;; where `find-file-not-found-functions' are called in + ;; `find-file-noselect-1'. + (make-local-variable 'epa-file-error) + (setq epa-file-error error) + (add-hook 'find-file-not-found-functions + 'epa-file--find-file-not-found-function + nil t) (signal 'file-error (cons "Opening input file" (cdr error))))) (make-local-variable 'epa-file-encrypt-to)
--- a/lwlib/ChangeLog Wed Jul 07 22:09:05 2010 +0000 +++ b/lwlib/ChangeLog Thu Jul 08 22:47:34 2010 +0000 @@ -1,3 +1,74 @@ +2010-07-08 Jan Djärv <jan.h.d@swipnet.se> + + * xlwmenu.c (size_menu_item): Change from K&R to prototype. + Change label_width and height to int. + (draw_arrow, draw_shadow_rectangle, draw_shadow_rhombus) + (draw_separator, display_menu, fit_to_screen, motion_event_is_in_menu) + (map_event_to_widget_value): Reformat. + (display_menu_item): Change from K&R to prototype. + + * lwlib.c (allocate_widget_info, lw_register_widget): Change from K&R + to prototype. + (lw_internal_update_other_instances, merge_widget_value): Reformat. + + * lwlib-int.h (widget_creation_function): Fix prototype. + + * lwlib-Xm.c (x_print_complete_resource_name) + (make_destroyed_instance, free_destroyed_instance, first_child) + (lw_motif_widget_p, resource_motif_string, destroy_all_children) + (xm_arm_callback, xm_update_label, xm_update_list) + (xm_update_pushbutton, xm_update_cascadebutton) + (xm_update_toggle, xm_update_radiobox, make_menu_in_widget) + (update_one_menu_entry, xm_update_menu, xm_update_text) + (xm_update_text_field, xm_update_one_widget) + (xm_update_one_value, activate_button, dialog_key_cb) + (make_dialog, mark_dead_instance_destroyed) + (find_matching_instance, recenter_widget, recycle_instance) + (xm_create_dialog, make_menubar, remove_grabs, make_popup_menu) + (make_main, xm_destroy_instance, xm_popup_menu) + (set_min_dialog_size, xm_pop_instance, do_call) + (xm_internal_update_other_instances, xm_generic_callback) + (xm_nosel_callback, xm_pull_down_callback, xm_pop_down_callback) + (xm_set_keyboard_focus, xm_set_main_areas, xm_manage_resizing): Change + from K&R to prototype. + + * lwlib-Xlw.c (x_print_complete_resource_name): Change from K&R to + prototype. + (xlw_update_one_value): Reformat. + + * lwlib-Xaw.c (xaw_generic_callback, command_reset) + (xaw_update_one_value): Reformat. + (xaw_update_one_widget): Reformat and remove dead code. + (xaw_scrollbar_scroll, xaw_scrollbar_jump, xaw_create_scrollbar) + (xaw_update_scrollbar): Remove (not used). + (make_dialog): Change from K&R to prototype. Remove dead code. + (xaw_creation_table): Remove scrollbar entry. + +2010-07-08 Dan Nicolaescu <dann@ics.uci.edu> + + * lwlib.c (allocate_widget_instance, get_widget_info) + (get_widget_instance, find_instance, set_one_value) + (update_one_widget_instance, update_all_widget_values) + (lw_modify_all_widgets, lw_get_widget, lw_make_widget) + (lw_create_widget, lw_pop_all_widgets, lw_show_busy) + (lw_refigure_widget, lw_allow_resizing): Remove alternative K&R + declarations. + * lwlib-Xlw.c (xlw_update_one_widget): + (xlw_pop_instance): Likewise. + * lwlib-Xaw.c (xaw_update_one_widget, xaw_pop_instance): + Likewise. + * lwlib-Xm.c (P_): Remove. + +2010-07-07 Andreas Schwab <schwab@linux-m68k.org> + + * lwlib.c (lwlib_memset, lwlib_bcopy): Remove. + (malloc_widget_value, free_widget_info, allocate_widget_instance) + (lw_separator_p): Replace lwlib_memset, lwlib_bcopy, bzero, bcmp by + memset, memcpy, memcmp. + * lwlib-utils.c (XtApplyToWidgets): Likewise. + * xlwmenu.c (XlwMenuInitialize): Likewise. + * lwlib.h (lwlib_bcopy): Remove declaration. + 2010-07-05 Jan Djärv <jan.h.d@swipnet.se> * xlwmenu.c (XlwMenuSetValues, XlwMenuInitialize): Correct prototype.
--- a/lwlib/lwlib-Xaw.c Wed Jul 07 22:09:05 2010 +0000 +++ b/lwlib/lwlib-Xaw.c Thu Jul 08 22:47:34 2010 +0000 @@ -71,7 +71,9 @@ #endif -static void xaw_generic_callback (Widget widget, XtPointer closure, XtPointer call_data); +static void xaw_generic_callback (Widget widget, + XtPointer closure, + XtPointer call_data); Boolean @@ -81,70 +83,6 @@ XtIsSubclass (widget, dialogWidgetClass)); } -#if 0 -static void -xaw_update_scrollbar (instance, widget, val) - widget_instance *instance; - Widget widget; - widget_value *val; -{ - if (val->scrollbar_data) - { - scrollbar_values *data = val->scrollbar_data; - Dimension height, width; - Dimension pos_x, pos_y; - int widget_shown, widget_topOfThumb; - float new_shown, new_topOfThumb; - - XtVaGetValues (widget, - XtNheight, &height, - XtNwidth, &width, - XtNx, &pos_x, - XtNy, &pos_y, - XtNtopOfThumb, &widget_topOfThumb, - XtNshown, &widget_shown, - NULL); - - /* - * First size and position the scrollbar widget. - * We need to position it to second-guess the Paned widget's notion - * of what should happen when the WMShell gets resized. - */ - if (height != data->scrollbar_height || pos_y != data->scrollbar_pos) - { - XtConfigureWidget (widget, pos_x, data->scrollbar_pos, - width, data->scrollbar_height, 0); - - XtVaSetValues (widget, - XtNlength, data->scrollbar_height, - XtNthickness, width, - NULL); - } - - /* - * Now the size the scrollbar's slider. - */ - new_shown = (float) data->slider_size / - (float) (data->maximum - data->minimum); - - new_topOfThumb = (float) (data->slider_position - data->minimum) / - (float) (data->maximum - data->minimum); - - if (new_shown > 1.0) - new_shown = 1.0; - if (new_shown < 0) - new_shown = 0; - - if (new_topOfThumb > 1.0) - new_topOfThumb = 1.0; - if (new_topOfThumb < 0) - new_topOfThumb = 0; - - if (new_shown != widget_shown || new_topOfThumb != widget_topOfThumb) - XawScrollbarSetThumb (widget, new_topOfThumb, new_shown); - } -} -#endif #ifdef HAVE_XFT static void @@ -325,9 +263,9 @@ static void command_reset (Widget widget, - XEvent* event, - String *params, - Cardinal *num_params) + XEvent* event, + String *params, + Cardinal *num_params) { struct widget_xft_data *data = find_xft_data (widget); if (data) @@ -348,23 +286,11 @@ #endif void -#ifdef PROTOTYPES -xaw_update_one_widget (widget_instance *instance, Widget widget, - widget_value *val, Boolean deep_p) -#else -xaw_update_one_widget (instance, widget, val, deep_p) - widget_instance *instance; - Widget widget; - widget_value *val; - Boolean deep_p; -#endif +xaw_update_one_widget (widget_instance *instance, + Widget widget, + widget_value *val, + Boolean deep_p) { -#if 0 - if (XtIsSubclass (widget, scrollbarWidgetClass)) - { - xaw_update_scrollbar (instance, widget, val); - } -#endif if (XtIsSubclass (widget, dialogWidgetClass)) { @@ -427,7 +353,9 @@ } void -xaw_update_one_value (widget_instance *instance, Widget widget, widget_value *val) +xaw_update_one_value (widget_instance *instance, + Widget widget, + widget_value *val) { /* This function is not used by the scrollbars and those are the only Athena widget implemented at the moment so do nothing. */ @@ -474,13 +402,7 @@ } void -#ifdef PROTOTYPES xaw_pop_instance (widget_instance *instance, Boolean up) -#else -xaw_pop_instance (instance, up) - widget_instance *instance; - Boolean up; -#endif { Widget widget = instance->widget; @@ -573,19 +495,17 @@ #endif static Widget -make_dialog (name, parent, pop_up_p, shell_title, icon_name, text_input_slot, - radio_box, list, left_buttons, right_buttons, instance) - char* name; - Widget parent; - Boolean pop_up_p; - char* shell_title; - char* icon_name; - Boolean text_input_slot; - Boolean radio_box; - Boolean list; - int left_buttons; - int right_buttons; - widget_instance *instance; +make_dialog (char* name, + Widget parent, + Boolean pop_up_p, + char* shell_title, + char* icon_name, + Boolean text_input_slot, + Boolean radio_box, + Boolean list, + int left_buttons, + int right_buttons, + widget_instance *instance) { Arg av [20]; int ac = 0; @@ -829,10 +749,6 @@ id = instance->info->id; -#if 0 - user_data = NULL; - XtVaGetValues (widget, XtNuserData, &user_data, NULL); -#else /* Damn! Athena doesn't give us a way to hang our own data on the buttons, so we have to go find it... I guess this assumes that all instances of a button have the same call data. */ @@ -848,7 +764,6 @@ if (! val) abort (); user_data = val->call_data; } -#endif if (instance->info->selection_cb) instance->info->selection_cb (widget, id, user_data); @@ -899,106 +814,6 @@ } -/* Scrollbars */ - -#if 0 -static void -xaw_scrollbar_scroll (widget, closure, call_data) - Widget widget; - XtPointer closure; - XtPointer call_data; -{ - widget_instance *instance = (widget_instance *) closure; - LWLIB_ID id; - scroll_event event_data; - - if (!instance || widget->core.being_destroyed) - return; - - id = instance->info->id; - event_data.slider_value = 0; - event_data.time = 0; - - if ((int) call_data > 0) - event_data.action = SCROLLBAR_PAGE_DOWN; - else - event_data.action = SCROLLBAR_PAGE_UP; - - if (instance->info->pre_activate_cb) - instance->info->pre_activate_cb (widget, id, (XtPointer) &event_data); -} -#endif - -#if 0 -static void -xaw_scrollbar_jump (widget, closure, call_data) - Widget widget; - XtPointer closure; - XtPointer call_data; -{ - widget_instance *instance = (widget_instance *) closure; - LWLIB_ID id; - scroll_event event_data; - scrollbar_values *val = - (scrollbar_values *) instance->info->val->scrollbar_data; - float percent; - - if (!instance || widget->core.being_destroyed) - return; - - id = instance->info->id; - - percent = * (float *) call_data; - event_data.slider_value = - (int) (percent * (float) (val->maximum - val->minimum)) + val->minimum; - - event_data.time = 0; - event_data.action = SCROLLBAR_DRAG; - - if (instance->info->pre_activate_cb) - instance->info->pre_activate_cb (widget, id, (XtPointer) &event_data); -} -#endif - -static Widget -xaw_create_scrollbar (widget_instance *instance) -{ -#if 0 - Arg av[20]; - int ac = 0; - Dimension width; - Widget scrollbar; - - XtVaGetValues (instance->parent, XtNwidth, &width, NULL); - - XtSetArg (av[ac], XtNshowGrip, 0); ac++; - XtSetArg (av[ac], XtNresizeToPreferred, 1); ac++; - XtSetArg (av[ac], XtNallowResize, True); ac++; - XtSetArg (av[ac], XtNskipAdjust, True); ac++; - XtSetArg (av[ac], XtNwidth, width); ac++; - XtSetArg (av[ac], XtNmappedWhenManaged, True); ac++; - - scrollbar = - XtCreateWidget (instance->info->name, scrollbarWidgetClass, - instance->parent, av, ac); - - /* We have to force the border width to be 0 otherwise the - geometry manager likes to start looping for awhile... */ - XtVaSetValues (scrollbar, XtNborderWidth, 0, NULL); - - XtRemoveAllCallbacks (scrollbar, "jumpProc"); - XtRemoveAllCallbacks (scrollbar, "scrollProc"); - - XtAddCallback (scrollbar, "jumpProc", xaw_scrollbar_jump, - (XtPointer) instance); - XtAddCallback (scrollbar, "scrollProc", xaw_scrollbar_scroll, - (XtPointer) instance); - - return scrollbar; -#else - return NULL; -#endif -} static Widget xaw_create_main (widget_instance *instance) @@ -1016,7 +831,6 @@ widget_creation_entry xaw_creation_table [] = { - {"scrollbar", xaw_create_scrollbar}, {"main", xaw_create_main}, {NULL, NULL} };
--- a/lwlib/lwlib-Xlw.c Wed Jul 07 22:09:05 2010 +0000 +++ b/lwlib/lwlib-Xlw.c Thu Jul 08 22:47:34 2010 +0000 @@ -43,8 +43,7 @@ This is sometimes handy to have available. */ void -x_print_complete_resource_name (widget) - Widget widget; +x_print_complete_resource_name (Widget widget) { int i; String names[100]; @@ -210,16 +209,8 @@ } void -#ifdef PROTOTYPES xlw_update_one_widget (widget_instance* instance, Widget widget, widget_value* val, Boolean deep_p) -#else -xlw_update_one_widget (instance, widget, val, deep_p) - widget_instance* instance; - Widget widget; - widget_value* val; - Boolean deep_p; -#endif { Arg al[1]; @@ -231,19 +222,15 @@ } void -xlw_update_one_value (widget_instance *instance, Widget widget, widget_value *val) +xlw_update_one_value (widget_instance *instance, + Widget widget, + widget_value *val) { return; } void -#ifdef PROTOTYPES xlw_pop_instance (widget_instance* instance, Boolean up) -#else -xlw_pop_instance (instance, up) - widget_instance* instance; - Boolean up; -#endif { }
--- a/lwlib/lwlib-Xm.c Wed Jul 07 22:09:05 2010 +0000 +++ b/lwlib/lwlib-Xm.c Thu Jul 08 22:47:34 2010 +0000 @@ -65,13 +65,6 @@ #include <Xm/DialogS.h> #include <Xm/Form.h> -#undef P_ -#if defined __STDC__ || defined PROTOTYPES -#define P_(X) X -#else -#define P_(X) () -#endif - enum do_call_type { pre_activate, selection, no_selection, post_activate }; @@ -152,8 +145,7 @@ This is sometimes handy to have available. */ void -x_print_complete_resource_name (widget) - Widget widget; +x_print_complete_resource_name (Widget widget) { int i; String names[100]; @@ -175,12 +167,11 @@ static destroyed_instance *all_destroyed_instances = NULL; static destroyed_instance* -make_destroyed_instance (name, type, widget, parent, pop_up_p) - char* name; - char* type; - Widget widget; - Widget parent; - Boolean pop_up_p; +make_destroyed_instance (char* name, + char* type, + Widget widget, + Widget parent, + Boolean pop_up_p) { destroyed_instance* instance = (destroyed_instance*)malloc (sizeof (destroyed_instance)); @@ -194,8 +185,7 @@ } static void -free_destroyed_instance (instance) - destroyed_instance* instance; +free_destroyed_instance (destroyed_instance* instance) { free (instance->name); free (instance->type); @@ -204,15 +194,13 @@ /* motif utility functions */ Widget -first_child (widget) - Widget widget; +first_child (Widget widget) { return ((CompositeWidget)widget)->composite.children [0]; } Boolean -lw_motif_widget_p (widget) - Widget widget; +lw_motif_widget_p (Widget widget) { return XtClass (widget) == xmDialogShellWidgetClass @@ -220,9 +208,8 @@ } static XmString -resource_motif_string (widget, name) - Widget widget; - char* name; +resource_motif_string (Widget widget, + char* name) { XtResource resource; XmString result = 0; @@ -244,9 +231,8 @@ starting with number FIRST_CHILD_TO_DESTROY. */ static void -destroy_all_children (widget, first_child_to_destroy) - Widget widget; - int first_child_to_destroy; +destroy_all_children (Widget widget, + int first_child_to_destroy) { Widget* children; unsigned int number; @@ -292,9 +278,7 @@ is called. */ static void -xm_arm_callback (w, client_data, call_data) - Widget w; - XtPointer client_data, call_data; +xm_arm_callback (Widget w, XtPointer client_data, XtPointer call_data) { XmPushButtonCallbackStruct *cbs = (XmPushButtonCallbackStruct *) call_data; widget_value *wv = (widget_value *) client_data; @@ -346,10 +330,9 @@ not null, and contains the label string to display. */ static void -xm_update_label (instance, widget, val) - widget_instance* instance; - Widget widget; - widget_value* val; +xm_update_label (widget_instance* instance, + Widget widget, + widget_value* val) { XmString res_string = 0; XmString built_string = 0; @@ -397,10 +380,9 @@ /* update of list */ static void -xm_update_list (instance, widget, val) - widget_instance* instance; - Widget widget; - widget_value* val; +xm_update_list (widget_instance* instance, + Widget widget, + widget_value* val) { widget_value* cur; int i; @@ -421,10 +403,9 @@ /* update of buttons */ static void -xm_update_pushbutton (instance, widget, val) - widget_instance* instance; - Widget widget; - widget_value* val; +xm_update_pushbutton (widget_instance* instance, + Widget widget, + widget_value* val) { XtVaSetValues (widget, XmNalignment, XmALIGNMENT_CENTER, NULL); XtRemoveAllCallbacks (widget, XmNactivateCallback); @@ -432,10 +413,9 @@ } static void -xm_update_cascadebutton (instance, widget, val) - widget_instance* instance; - Widget widget; - widget_value* val; +xm_update_cascadebutton (widget_instance* instance, + Widget widget, + widget_value* val) { /* Should also rebuild the menu by calling ...update_menu... */ XtRemoveAllCallbacks (widget, XmNcascadingCallback); @@ -445,10 +425,9 @@ /* update toggle and radiobox */ static void -xm_update_toggle (instance, widget, val) - widget_instance* instance; - Widget widget; - widget_value* val; +xm_update_toggle (widget_instance* instance, + Widget widget, + widget_value* val) { XtRemoveAllCallbacks (widget, XmNvalueChangedCallback); XtAddCallback (widget, XmNvalueChangedCallback, @@ -458,10 +437,9 @@ } static void -xm_update_radiobox (instance, widget, val) - widget_instance* instance; - Widget widget; - widget_value* val; +xm_update_radiobox (widget_instance* instance, + Widget widget, + widget_value* val) { Widget toggle; @@ -505,11 +483,10 @@ /* KEEP_FIRST_CHILDREN gives the number of initial children to keep. */ static void -make_menu_in_widget (instance, widget, val, keep_first_children) - widget_instance* instance; - Widget widget; - widget_value* val; - int keep_first_children; +make_menu_in_widget (widget_instance* instance, + Widget widget, + widget_value* val, + int keep_first_children) { Widget* children = 0; int num_children; @@ -662,11 +639,10 @@ } static void -update_one_menu_entry (instance, widget, val, deep_p) - widget_instance* instance; - Widget widget; - widget_value* val; - Boolean deep_p; +update_one_menu_entry (widget_instance* instance, + Widget widget, + widget_value* val, + Boolean deep_p) { Arg al [256]; int ac; @@ -764,11 +740,10 @@ } static void -xm_update_menu (instance, widget, val, deep_p) - widget_instance* instance; - Widget widget; - widget_value* val; - Boolean deep_p; +xm_update_menu (widget_instance* instance, + Widget widget, + widget_value* val, + Boolean deep_p) { Widget* children; unsigned int num_children; @@ -839,10 +814,9 @@ /* update text widgets */ static void -xm_update_text (instance, widget, val) - widget_instance* instance; - Widget widget; - widget_value* val; +xm_update_text (widget_instance* instance, + Widget widget, + widget_value* val) { XmTextSetString (widget, val->value ? val->value : ""); XtRemoveAllCallbacks (widget, XmNactivateCallback); @@ -853,10 +827,9 @@ } static void -xm_update_text_field (instance, widget, val) - widget_instance* instance; - Widget widget; - widget_value* val; +xm_update_text_field (widget_instance* instance, + Widget widget, + widget_value* val) { XmTextFieldSetString (widget, val->value ? val->value : ""); XtRemoveAllCallbacks (widget, XmNactivateCallback); @@ -870,11 +843,10 @@ /* update a motif widget */ void -xm_update_one_widget (instance, widget, val, deep_p) - widget_instance* instance; - Widget widget; - widget_value* val; - Boolean deep_p; +xm_update_one_widget (widget_instance* instance, + Widget widget, + widget_value* val, + Boolean deep_p) { WidgetClass class; @@ -935,10 +907,9 @@ /* getting the value back */ void -xm_update_one_value (instance, widget, val) - widget_instance* instance; - Widget widget; - widget_value* val; +xm_update_one_value (widget_instance* instance, + Widget widget, + widget_value* val) { WidgetClass class = XtClass (widget); widget_value *old_wv; @@ -1031,10 +1002,9 @@ I could not find a way to do that with accelerators. */ static void -activate_button (widget, closure, call_data) - Widget widget; - XtPointer closure; - XtPointer call_data; +activate_button (Widget widget, + XtPointer closure, + XtPointer call_data) { Widget button = (Widget)closure; XtCallCallbacks (button, XmNactivateCallback, NULL); @@ -1044,11 +1014,10 @@ /* Called for key press in dialogs. Used to pop down dialog on ESC. */ static void -dialog_key_cb (widget, closure, event, continue_to_dispatch) - Widget widget; - XtPointer closure; - XEvent *event; - Boolean *continue_to_dispatch; +dialog_key_cb (Widget widget, + XtPointer closure, + XEvent *event, + Boolean *continue_to_dispatch) { KeySym sym = 0; Modifiers modif_ret; @@ -1071,18 +1040,16 @@ /* dialogs */ static Widget -make_dialog (name, parent, pop_up_p, shell_title, icon_name, text_input_slot, - radio_box, list, left_buttons, right_buttons) - char* name; - Widget parent; - Boolean pop_up_p; - char* shell_title; - char* icon_name; - Boolean text_input_slot; - Boolean radio_box; - Boolean list; - int left_buttons; - int right_buttons; +make_dialog (char* name, + Widget parent, + Boolean pop_up_p, + char* shell_title, + char* icon_name, + Boolean text_input_slot, + Boolean radio_box, + Boolean list, + int left_buttons, + int right_buttons) { Widget result; Widget form; @@ -1335,8 +1302,7 @@ } static destroyed_instance* -find_matching_instance (instance) - widget_instance* instance; +find_matching_instance (widget_instance* instance) { destroyed_instance* cur; destroyed_instance* prev; @@ -1373,18 +1339,16 @@ } static void -mark_dead_instance_destroyed (widget, closure, call_data) - Widget widget; - XtPointer closure; - XtPointer call_data; +mark_dead_instance_destroyed (Widget widget, + XtPointer closure, + XtPointer call_data) { destroyed_instance* instance = (destroyed_instance*)closure; instance->widget = NULL; } static void -recenter_widget (widget) - Widget widget; +recenter_widget (Widget widget) { Widget parent = XtParent (widget); Screen* screen = XtScreen (widget); @@ -1420,8 +1384,7 @@ } static Widget -recycle_instance (instance) - destroyed_instance* instance; +recycle_instance (destroyed_instance* instance) { Widget widget = instance->widget; @@ -1457,8 +1420,7 @@ } Widget -xm_create_dialog (instance) - widget_instance* instance; +xm_create_dialog (widget_instance* instance) { char* name = instance->info->type; Widget parent = instance->parent; @@ -1538,8 +1500,7 @@ because we have not yet managed to make it work right in Motif. */ static Widget -make_menubar (instance) - widget_instance* instance; +make_menubar (widget_instance* instance) { Arg al[3]; int ac; @@ -1550,18 +1511,16 @@ } static void -remove_grabs (shell, closure, call_data) - Widget shell; - XtPointer closure; - XtPointer call_data; +remove_grabs (Widget shell, + XtPointer closure, + XtPointer call_data) { Widget menu = (Widget) closure; XmRemoveFromPostFromList (menu, XtParent (XtParent (menu))); } static Widget -make_popup_menu (instance) - widget_instance* instance; +make_popup_menu (widget_instance* instance) { Widget parent = instance->parent; Window parent_window = parent->core.window; @@ -1577,8 +1536,7 @@ } static Widget -make_main (instance) - widget_instance* instance; +make_main (widget_instance* instance) { Widget parent = instance->parent; Widget result; @@ -1717,8 +1675,7 @@ /* Destruction of instances */ void -xm_destroy_instance (instance) - widget_instance* instance; +xm_destroy_instance ( widget_instance* instance) { Widget widget = instance->widget; /* recycle the dialog boxes */ @@ -1752,9 +1709,7 @@ /* popup utility */ void -xm_popup_menu (widget, event) - Widget widget; - XEvent *event; +xm_popup_menu (Widget widget, XEvent *event) { XButtonPressedEvent dummy; @@ -1802,8 +1757,7 @@ } static void -set_min_dialog_size (w) - Widget w; +set_min_dialog_size (Widget w) { short width; short height; @@ -1812,9 +1766,7 @@ } void -xm_pop_instance (instance, up) - widget_instance* instance; - Boolean up; +xm_pop_instance (widget_instance* instance, Boolean up) { Widget widget = instance->widget; @@ -1843,10 +1795,9 @@ /* motif callback */ static void -do_call (widget, closure, type) - Widget widget; - XtPointer closure; - enum do_call_type type; +do_call (Widget widget, + XtPointer closure, + enum do_call_type type) { Arg al [256]; int ac; @@ -1903,10 +1854,9 @@ if the widget was ``destroyed'' by caching it in the all_destroyed_instances list */ static void -xm_internal_update_other_instances (widget, closure, call_data) - Widget widget; - XtPointer closure; - XtPointer call_data; +xm_internal_update_other_instances (Widget widget, + XtPointer closure, + XtPointer call_data) { Widget parent; for (parent = widget; parent; parent = XtParent (parent)) @@ -1918,20 +1868,18 @@ } static void -xm_generic_callback (widget, closure, call_data) - Widget widget; - XtPointer closure; - XtPointer call_data; +xm_generic_callback (Widget widget, + XtPointer closure, + XtPointer call_data) { lw_internal_update_other_instances (widget, closure, call_data); do_call (widget, closure, selection); } static void -xm_nosel_callback (widget, closure, call_data) - Widget widget; - XtPointer closure; - XtPointer call_data; +xm_nosel_callback (Widget widget, + XtPointer closure, + XtPointer call_data) { /* This callback is only called when a dialog box is dismissed with the wm's destroy button (WM_DELETE_WINDOW.) We want the dialog @@ -1946,10 +1894,9 @@ } static void -xm_pull_down_callback (widget, closure, call_data) - Widget widget; - XtPointer closure; - XtPointer call_data; +xm_pull_down_callback (Widget widget, + XtPointer closure, + XtPointer call_data) { Widget parent = XtParent (widget); @@ -1970,10 +1917,9 @@ menu, whether or not its submenu is visible. */ static void -xm_pop_down_callback (widget, closure, call_data) - Widget widget; - XtPointer closure; - XtPointer call_data; +xm_pop_down_callback (Widget widget, + XtPointer closure, + XtPointer call_data) { widget_instance *instance = (widget_instance *) closure; @@ -1985,9 +1931,7 @@ /* set the keyboard focus */ void -xm_set_keyboard_focus (parent, w) - Widget parent; - Widget w; +xm_set_keyboard_focus (Widget parent, Widget w) { XmProcessTraversal (w, 0); XtSetKeyboardFocus (parent, w); @@ -1995,10 +1939,9 @@ /* Motif hack to set the main window areas. */ void -xm_set_main_areas (parent, menubar, work_area) - Widget parent; - Widget menubar; - Widget work_area; +xm_set_main_areas (Widget parent, + Widget menubar, + Widget work_area) { XmMainWindowSetAreas (parent, menubar, /* menubar (maybe 0) */ @@ -2010,9 +1953,7 @@ /* Motif hack to control resizing on the menubar. */ void -xm_manage_resizing (w, flag) - Widget w; - Boolean flag; +xm_manage_resizing (Widget w, Boolean flag) { XtVaSetValues (w, XtNallowShellResize, flag, NULL); }
--- a/lwlib/lwlib-int.h Wed Jul 07 22:09:05 2010 +0000 +++ b/lwlib/lwlib-int.h Thu Jul 08 22:47:34 2010 +0000 @@ -58,8 +58,7 @@ struct _widget_info* next; } widget_info; -typedef Widget -(*widget_creation_function) (); +typedef Widget (*widget_creation_function) (widget_instance *instance); typedef struct _widget_creation_entry {
--- a/lwlib/lwlib-utils.c Wed Jul 07 22:09:05 2010 +0000 +++ b/lwlib/lwlib-utils.c Thu Jul 08 22:47:34 2010 +0000 @@ -77,8 +77,8 @@ int nkids = cw->composite.num_children; Widget *kids = (Widget *) malloc (sizeof (Widget) * nkids); int i; - lwlib_bcopy ((char *) cw->composite.children, (char *) kids, - sizeof (Widget) * nkids); + memcpy ((char *) kids, (char *) cw->composite.children, + sizeof (Widget) * nkids); for (i = 0; i < nkids; i++) /* This prevent us from using gadgets, why is it here? */ /* if (XtIsWidget (kids [i])) */
--- a/lwlib/lwlib.c Wed Jul 07 22:09:05 2010 +0000 +++ b/lwlib/lwlib.c Thu Jul 08 22:47:34 2010 +0000 @@ -104,24 +104,6 @@ static void lw_pop_all_widgets (LWLIB_ID, Boolean); static Boolean get_one_value (widget_instance *, widget_value *); static void show_one_widget_busy (Widget, Boolean); - -void -lwlib_memset (char *address, int value, size_t length) -{ - int i; - - for (i = 0; i < length; i++) - address[i] = value; -} - -void -lwlib_bcopy (char *from, char *to, int length) -{ - int i; - - for (i = 0; i < length; i++) - to[i] = from[i]; -} /* utility functions for widget_instance and widget_info */ char * safe_strdup (const char *s) @@ -179,7 +161,7 @@ wv = (widget_value *) malloc (sizeof (widget_value)); malloc_cpt++; } - lwlib_memset ((void*) wv, 0, sizeof (widget_value)); + memset ((void*) wv, 0, sizeof (widget_value)); return wv; } @@ -267,16 +249,14 @@ } static widget_info * -allocate_widget_info (type, name, id, val, pre_activate_cb, - selection_cb, post_activate_cb, highlight_cb) - char* type; - char* name; - LWLIB_ID id; - widget_value* val; - lw_callback pre_activate_cb; - lw_callback selection_cb; - lw_callback post_activate_cb; - lw_callback highlight_cb; +allocate_widget_info (char* type, + char* name, + LWLIB_ID id, + widget_value* val, + lw_callback pre_activate_cb, + lw_callback selection_cb, + lw_callback post_activate_cb, + lw_callback highlight_cb) { widget_info* info = (widget_info*)malloc (sizeof (widget_info)); info->type = safe_strdup (type); @@ -302,7 +282,7 @@ safe_free_str (info->type); safe_free_str (info->name); free_widget_value_tree (info->val); - lwlib_memset ((void*)info, 0xDEADBEEF, sizeof (widget_info)); + memset ((void*)info, 0xDEADBEEF, sizeof (widget_info)); free (info); } @@ -316,22 +296,12 @@ instance->widget = NULL; } -/* The messy #ifdef PROTOTYPES here and elsewhere are prompted by a - flood of warnings about argument promotion from proprietary ISO C - compilers. (etags still only makes one entry for each function.) */ static widget_instance * -#ifdef PROTOTYPES allocate_widget_instance (widget_info* info, Widget parent, Boolean pop_up_p) -#else -allocate_widget_instance (info, parent, pop_up_p) - widget_info* info; - Widget parent; - Boolean pop_up_p; -#endif { widget_instance* instance = (widget_instance*)malloc (sizeof (widget_instance)); - bzero (instance, sizeof *instance); + memset (instance, 0, sizeof *instance); instance->parent = parent; instance->pop_up_p = pop_up_p; instance->info = info; @@ -348,18 +318,12 @@ static void free_widget_instance (widget_instance *instance) { - lwlib_memset ((void*)instance, 0xDEADBEEF, sizeof (widget_instance)); + memset ((void*)instance, 0xDEADBEEF, sizeof (widget_instance)); free (instance); } static widget_info * -#ifdef PROTOTYPES get_widget_info (LWLIB_ID id, Boolean remove_p) -#else -get_widget_info (id, remove_p) - LWLIB_ID id; - Boolean remove_p; -#endif { widget_info* info; widget_info* prev; @@ -389,13 +353,7 @@ } static widget_instance * -#ifdef PROTOTYPES get_widget_instance (Widget widget, Boolean remove_p) -#else -get_widget_instance (widget, remove_p) - Widget widget; - Boolean remove_p; -#endif { widget_info* info; widget_instance* instance; @@ -428,14 +386,7 @@ } static widget_instance* -#ifdef PROTOTYPES find_instance (LWLIB_ID id, Widget parent, Boolean pop_up_p) -#else -find_instance (id, parent, pop_up_p) - LWLIB_ID id; - Widget parent; - Boolean pop_up_p; -#endif { widget_info* info = get_widget_info (id, False); widget_instance* instance; @@ -478,7 +429,10 @@ static widget_value * -merge_widget_value (widget_value *val1, widget_value *val2, int level, int *change_p) +merge_widget_value (widget_value *val1, + widget_value *val2, + int level, + int *change_p) { change_type change, this_one_change; widget_value* merged_next; @@ -656,14 +610,7 @@ } static void -#ifdef PROTOTYPES set_one_value (widget_instance* instance, widget_value* val, Boolean deep_p) -#else -set_one_value (instance, val, deep_p) - widget_instance* instance; - widget_value* val; - Boolean deep_p; -#endif { Widget widget = name_to_widget (instance, val->name); @@ -685,13 +632,7 @@ } static void -#ifdef PROTOTYPES update_one_widget_instance (widget_instance* instance, Boolean deep_p) -#else -update_one_widget_instance (instance, deep_p) - widget_instance* instance; - Boolean deep_p; -#endif { widget_value *val; @@ -705,13 +646,7 @@ } static void -#ifdef PROTOTYPES update_all_widget_values (widget_info* info, Boolean deep_p) -#else -update_all_widget_values (info, deep_p) - widget_info* info; - Boolean deep_p; -#endif { widget_instance* instance; widget_value* val; @@ -724,14 +659,7 @@ } int -#ifdef PROTOTYPES lw_modify_all_widgets (LWLIB_ID id, widget_value* val, Boolean deep_p) -#else -lw_modify_all_widgets (id, val, deep_p) - LWLIB_ID id; - widget_value* val; - Boolean deep_p; -#endif { widget_info* info = get_widget_info (id, False); widget_value* new_val; @@ -895,16 +823,14 @@ } void -lw_register_widget (type, name, id, val, pre_activate_cb, - selection_cb, post_activate_cb, highlight_cb) - char* type; - char* name; - LWLIB_ID id; - widget_value* val; - lw_callback pre_activate_cb; - lw_callback selection_cb; - lw_callback post_activate_cb; - lw_callback highlight_cb; +lw_register_widget (char* type, + char* name, + LWLIB_ID id, + widget_value* val, + lw_callback pre_activate_cb, + lw_callback selection_cb, + lw_callback post_activate_cb, + lw_callback highlight_cb) { if (!get_widget_info (id, False)) allocate_widget_info (type, name, id, val, pre_activate_cb, selection_cb, @@ -912,14 +838,7 @@ } Widget -#ifdef PROTOTYPES lw_get_widget (LWLIB_ID id, Widget parent, Boolean pop_up_p) -#else -lw_get_widget (id, parent, pop_up_p) - LWLIB_ID id; - Widget parent; - Boolean pop_up_p; -#endif { widget_instance* instance; @@ -928,14 +847,7 @@ } Widget -#ifdef PROTOTYPES lw_make_widget (LWLIB_ID id, Widget parent, Boolean pop_up_p) -#else -lw_make_widget (id, parent, pop_up_p) - LWLIB_ID id; - Widget parent; - Boolean pop_up_p; -#endif { widget_instance* instance; widget_info* info; @@ -955,25 +867,10 @@ } Widget -#ifdef PROTOTYPES lw_create_widget (char* type, char* name, LWLIB_ID id, widget_value* val, Widget parent, Boolean pop_up_p, lw_callback pre_activate_cb, lw_callback selection_cb, lw_callback post_activate_cb, lw_callback highlight_cb) -#else -lw_create_widget (type, name, id, val, parent, pop_up_p, pre_activate_cb, - selection_cb, post_activate_cb, highlight_cb) - char* type; - char* name; - LWLIB_ID id; - widget_value* val; - Widget parent; - Boolean pop_up_p; - lw_callback pre_activate_cb; - lw_callback selection_cb; - lw_callback post_activate_cb; - lw_callback highlight_cb; -#endif { lw_register_widget (type, name, id, val, pre_activate_cb, selection_cb, post_activate_cb, highlight_cb); @@ -1120,13 +1017,7 @@ } static void -#ifdef PROTOTYPES lw_pop_all_widgets (LWLIB_ID id, Boolean up) -#else -lw_pop_all_widgets (id, up) - LWLIB_ID id; - Boolean up; -#endif { widget_info* info = get_widget_info (id, False); widget_instance* instance; @@ -1270,7 +1161,9 @@ modified to update other instances of the widgets. Closure should be the widget_instance. */ void -lw_internal_update_other_instances (Widget widget, XtPointer closure, XtPointer call_data) +lw_internal_update_other_instances (Widget widget, + XtPointer closure, + XtPointer call_data) { widget_instance* instance = (widget_instance*)closure; char* name = XtName (widget); @@ -1327,13 +1220,7 @@ /* Show busy */ static void -#ifdef PROTOTYPES show_one_widget_busy (Widget w, Boolean flag) -#else -show_one_widget_busy (w, flag) - Widget w; - Boolean flag; -#endif { Pixel foreground = 0; Pixel background = 1; @@ -1352,13 +1239,7 @@ } void -#ifdef PROTOTYPES lw_show_busy (Widget w, Boolean busy) -#else -lw_show_busy (w, busy) - Widget w; - Boolean busy; -#endif { widget_instance* instance = get_widget_instance (w, False); widget_info* info; @@ -1380,13 +1261,7 @@ /* This hack exists because Lucid/Athena need to execute the strange function below to support geometry management. */ void -#ifdef PROTOTYPES lw_refigure_widget (Widget w, Boolean doit) -#else -lw_refigure_widget (w, doit) - Widget w; - Boolean doit; -#endif { #if defined (USE_XAW) XawPanedSetRefigureMode (w, doit); @@ -1428,13 +1303,7 @@ /* Manage resizing for Motif. This disables resizing when the menubar is about to be modified. */ void -#ifdef PROTOTYPES lw_allow_resizing (Widget w, Boolean flag) -#else -lw_allow_resizing (w, flag) - Widget w; - Boolean flag; -#endif { #if defined (USE_MOTIF) xm_manage_resizing (w, flag); @@ -1453,7 +1322,7 @@ int separator_p = 0; if (strlen (label) >= 3 - && bcmp (label, "--:", 3) == 0) + && memcmp (label, "--:", 3) == 0) { static struct separator_table { @@ -1496,7 +1365,7 @@ } } else if (strlen (label) > 3 - && bcmp (label, "--", 2) == 0 + && memcmp (label, "--", 2) == 0 && label[2] != '-') { /* Alternative, more Emacs-style names. */
--- a/lwlib/lwlib.h Wed Jul 07 22:09:05 2010 +0000 +++ b/lwlib/lwlib.h Thu Jul 08 22:47:34 2010 +0000 @@ -189,8 +189,6 @@ int lw_separator_p (char *label, enum menu_separator *type, int motif_p); -void lwlib_bcopy (char*, char*, int); - #endif /* LWLIB_H */ /* arch-tag: 44d818d5-7eb2-4d87-acd7-b992bb0d5d20
--- a/lwlib/xlwmenu.c Wed Jul 07 22:09:05 2010 +0000 +++ b/lwlib/xlwmenu.c Thu Jul 08 22:47:34 2010 +0000 @@ -187,9 +187,9 @@ static Boolean XlwMenuSetValues(Widget current, Widget request, Widget new, ArgList args, Cardinal *num_args); -static void XlwMenuRealize(Widget w, Mask *valueMask, XSetWindowAttributes *attributes); +static void XlwMenuRealize(Widget, Mask *, XSetWindowAttributes *); static void XlwMenuResize(Widget w); -static void XlwMenuInitialize(Widget request, Widget mw, ArgList args, Cardinal *num_args); +static void XlwMenuInitialize(Widget, Widget, ArgList, Cardinal *); static void XlwMenuRedisplay(Widget w, XEvent *ev, Region region); static void XlwMenuDestroy(Widget w); static void XlwMenuClassInitialize(void); @@ -473,15 +473,13 @@ /* Returns the sizes of an item */ static void -size_menu_item (mw, val, horizontal_p, label_width, rest_width, button_width, - height) - XlwMenuWidget mw; - widget_value* val; - int horizontal_p; - int* label_width; - int* rest_width; - int* button_width; - int* height; +size_menu_item (XlwMenuWidget mw, + widget_value* val, + int horizontal_p, + int* label_width, + int* rest_width, + int* button_width, + int* height) { enum menu_separator separator; @@ -525,12 +523,12 @@ static void size_menu (XlwMenuWidget mw, int level) { - unsigned int label_width = 0; + int label_width = 0; int rest_width = 0; int button_width = 0; int max_rest_width = 0; int max_button_width = 0; - unsigned int height = 0; + int height = 0; int horizontal_p = mw->menu.horizontal && (level == 0); widget_value* val; window_state* ws; @@ -589,7 +587,13 @@ /* Display code */ static void -draw_arrow (XlwMenuWidget mw, Window window, GC gc, int x, int y, int width, int down_p) +draw_arrow (XlwMenuWidget mw, + Window window, + GC gc, + int x, + int y, + int width, + int down_p) { Display *dpy = XtDisplay (mw); GC top_gc = mw->menu.shadow_top_gc; @@ -646,7 +650,14 @@ static void -draw_shadow_rectangle (XlwMenuWidget mw, Window window, int x, int y, int width, int height, int erase_p, int down_p) +draw_shadow_rectangle (XlwMenuWidget mw, + Window window, + int x, + int y, + int width, + int height, + int erase_p, + int down_p) { Display *dpy = XtDisplay (mw); GC top_gc = !erase_p ? mw->menu.shadow_top_gc : mw->menu.background_gc; @@ -702,7 +713,14 @@ static void -draw_shadow_rhombus (XlwMenuWidget mw, Window window, int x, int y, int width, int height, int erase_p, int down_p) +draw_shadow_rhombus (XlwMenuWidget mw, + Window window, + int x, + int y, + int width, + int height, + int erase_p, + int down_p) { Display *dpy = XtDisplay (mw); GC top_gc = !erase_p ? mw->menu.shadow_top_gc : mw->menu.background_gc; @@ -796,7 +814,12 @@ separator to draw. TYPE is the separator type. */ static void -draw_separator (XlwMenuWidget mw, Window window, int x, int y, int width, enum menu_separator type) +draw_separator (XlwMenuWidget mw, + Window window, + int x, + int y, + int width, + enum menu_separator type) { Display *dpy = XtDisplay (mw); XGCValues xgcv; @@ -946,15 +969,13 @@ the menu item was. */ static void -display_menu_item (mw, val, ws, where, highlighted_p, horizontal_p, - just_compute_p) - XlwMenuWidget mw; - widget_value* val; - window_state* ws; - XPoint* where; - Boolean highlighted_p; - Boolean horizontal_p; - Boolean just_compute_p; +display_menu_item (XlwMenuWidget mw, + widget_value* val, + window_state* ws, + XPoint* where, + Boolean highlighted_p, + Boolean horizontal_p, + Boolean just_compute_p) { GC deco_gc; GC text_gc; @@ -1137,7 +1158,12 @@ } static void -display_menu (XlwMenuWidget mw, int level, Boolean just_compute_p, XPoint *highlighted_pos, XPoint *hit, widget_value **hit_return) +display_menu (XlwMenuWidget mw, + int level, + Boolean just_compute_p, + XPoint *highlighted_pos, + XPoint *hit, + widget_value **hit_return) { widget_value* val; widget_value* following_item; @@ -1345,7 +1371,10 @@ /* Make the window fit in the screen */ static void -fit_to_screen (XlwMenuWidget mw, window_state *ws, window_state *previous_ws, Boolean horizontal_p) +fit_to_screen (XlwMenuWidget mw, + window_state *ws, + window_state *previous_ws, + Boolean horizontal_p) { unsigned int screen_width = WidthOfScreen (XtScreen (mw)); unsigned int screen_height = HeightOfScreen (XtScreen (mw)); @@ -1519,7 +1548,10 @@ } static Boolean -motion_event_is_in_menu (XlwMenuWidget mw, XMotionEvent *ev, int level, XPoint *relative_pos) +motion_event_is_in_menu (XlwMenuWidget mw, + XMotionEvent *ev, + int level, + XPoint *relative_pos) { window_state* ws = &mw->menu.windows [level]; int shadow = level == 0 ? 0 : mw->menu.shadow_thickness; @@ -1532,7 +1564,10 @@ } static Boolean -map_event_to_widget_value (XlwMenuWidget mw, XMotionEvent *ev, widget_value **val, int *level) +map_event_to_widget_value (XlwMenuWidget mw, + XMotionEvent *ev, + widget_value **val, + int *level) { int i; XPoint relative_pos; @@ -1861,7 +1896,7 @@ /* _XtCreate is freeing the object that was passed to us, so make a copy that we will actually keep. */ - lwlib_bcopy (mw->menu.contents, tem, sizeof (widget_value)); + memcpy (tem, mw->menu.contents, sizeof (widget_value)); mw->menu.contents = tem; #endif
--- a/msdos/ChangeLog Wed Jul 07 22:09:05 2010 +0000 +++ b/msdos/ChangeLog Thu Jul 08 22:47:34 2010 +0000 @@ -1,3 +1,19 @@ +2010-07-08 Eli Zaretskii <eliz@gnu.org> + + * sed1v2.inp (stamp-oldxmenu): Don't edit out in `temacs:' target, + which doesn't exist. + + * sed2v2.inp (HAVE_MEMCPY): Don't edit, defined on <sys/config.h>. + +2010-07-08 Dan Nicolaescu <dann@ics.uci.edu> + + * sed1v2.inp: Remove reference to prefix-args. + +2010-07-07 Andreas Schwab <schwab@linux-m68k.org> + + * sed2v2.inp (HAVE_MEMCPY, HAVE_MEMSET): Edit to 1. + (HAVE_BZERO): Don't edit. + 2010-07-02 Eli Zaretskii <eliz@gnu.org> * sed1v2.inp (LIB_GCC): Edit to empty.
--- a/msdos/sed1v2.inp Wed Jul 07 22:09:05 2010 +0000 +++ b/msdos/sed1v2.inp Thu Jul 08 22:47:34 2010 +0000 @@ -128,8 +128,6 @@ /^[ ]*$/d /^ if test -f/,/^ fi$/c\ command.com /c if exist .gdbinit rm -f _gdbinit -/^temacs:/s/prefix-args// -/^temacs:/s/stamp-oldxmenu// /^ if test "\${CANNOT_DUMP}" =/,/^ else /d /^ fi/d /^ LC_ALL=C \$(RUN_TEMACS)/i\
--- a/msdos/sed2v2.inp Wed Jul 07 22:09:05 2010 +0000 +++ b/msdos/sed2v2.inp Thu Jul 08 22:47:34 2010 +0000 @@ -38,6 +38,7 @@ /^#undef HAVE_CBRT *$/s/^.*$/#define HAVE_CBRT 1/ /^#undef HAVE_DIFFTIME *$/s/^.*$/#define HAVE_DIFFTIME 1/ /^#undef HAVE_FPATHCONF *$/s/^.*$/#define HAVE_FPATHCONF 1/ +/^#undef HAVE_MEMSET *$/s/^.*$/#define HAVE_MEMSET 1/ /^#undef HAVE_MEMCMP *$/s/^.*$/#define HAVE_MEMCMP 1/ /^#undef HAVE_MEMMOVE *$/s/^.*$/#define HAVE_MEMMOVE 1/ /^#undef HAVE_SETRLIMIT *$/s/^.*$/#define HAVE_SETRLIMIT 1/ @@ -84,14 +85,6 @@ #else\ #undef HAVE_STDINT_H\ #endif -# GCC 3.x has a built-in bzero, which conflicts with the define at -# the end of config.in -/^#undef HAVE_BZERO/c\ -#if __GNUC__ >= 3\ -#define HAVE_BZERO 1\ -#else\ -#undef HAVE_BZERO\ -#endif # Comment out any remaining undef directives, because some of them # might be defined in sys/config.h we include at the top of config.h.
--- a/nt/ChangeLog Wed Jul 07 22:09:05 2010 +0000 +++ b/nt/ChangeLog Thu Jul 08 22:47:34 2010 +0000 @@ -1,3 +1,8 @@ +2010-07-07 Andreas Schwab <schwab@linux-m68k.org> + + * config.nt (HAVE_BCOPY, HAVE_BCMP): Remove undefs. + (HAVE_MEMCPY, HAVE_MEMMOVE, HAVE_MEMSET, HAVE_MEMCMP): Add undefs. + 2010-07-02 Juanma Barranquero <lekktu@gmail.com> * config.nt (__P): Remove.
--- a/nt/config.nt Wed Jul 07 22:09:05 2010 +0000 +++ b/nt/config.nt Thu Jul 08 22:47:34 2010 +0000 @@ -212,8 +212,10 @@ #undef HAVE_SYSINFO #undef HAVE_RANDOM #undef HAVE_LRAND48 -#undef HAVE_BCOPY -#undef HAVE_BCMP +#undef HAVE_MEMCPY +#undef HAVE_MEMMOVE +#undef HAVE_MEMSET +#undef HAVE_MEMCMP #undef HAVE_LOGB #undef HAVE_FREXP #undef HAVE_FMOD
--- a/src/ChangeLog Wed Jul 07 22:09:05 2010 +0000 +++ b/src/ChangeLog Thu Jul 08 22:47:34 2010 +0000 @@ -1,3 +1,309 @@ +2010-07-08 Dan Nicolaescu <dann@ics.uci.edu> + + * alloc.c: Convert DEFUNs to standard C. + * buffer.c: + * bytecode.c: + * callint.c: + * callproc.c: + * casefiddle.c: + * casetab.c: + * category.c: + * character.c: + * charset.c: + * chartab.c: + * cmds.c: + * coding.c: + * composite.c: + * data.c: + * dbusbind.c: + * dired.c: + * dispnew.c: + * doc.c: + * dosfns.c: + * editfns.c: + * emacs.c: + * eval.c: + * fileio.c: + * filelock.c: + * floatfns.c: + * fns.c: + * font.c: + * fontset.c: + * frame.c: + * fringe.c: + * image.c: + * indent.c: + * insdel.c: + * keyboard.c: + * keymap.c: + * lread.c: + * macros.c: + * marker.c: + * menu.c: + * minibuf.c: + * msdos.c: + * nsfns.m: + * nsmenu.m: + * nsselect.m: + * print.c: + * process.c: + * search.c: + * sound.c: + * syntax.c: + * term.c: + * terminal.c: + * textprop.c: + * undo.c: + * w16select.c: + * w32console.c: + * w32fns.c: + * w32font.c: + * w32menu.c: + * w32proc.c: + * w32select.c: + * window.c: + * xdisp.c: + * xfaces.c: + * xfns.c: + * xmenu.c: + * xselect.c: + * xsettings.c: + * xsmfns.c: Likewise. + + +2010-07-08 Eli Zaretskii <eliz@gnu.org> + + * process.c (kbd_is_on_hold, hold_keyboard_input) + (unhold_keyboard_input, kbd_on_hold_p) [!subprocesses]: Define. + +2010-07-08 Jan Djärv <jan.h.d@swipnet.se> + + * xmenu.c (set_frame_menubar, create_and_show_popup_menu) + (create_and_show_dialog): Don't call apply_systemfont_to_(menu|dialog) + unless USE_LUCID. + +2010-07-08 Dan Nicolaescu <dann@ics.uci.edu> + + * xdisp.c (store_mode_line_noprop_char): Remove K&R alternative declaration. + + Clean up include guards. + * tparam.c: Remove include guards for config.h, string.h and code + that assumes #ifndef emacs. + * termcap.c: + * unexalpha.c: + * sysdep.c: + * filemode.c: + * filelock.c: + * bidi.c: Likewise. + + Remove prefix-args.c + * prefix-args.c: Remove file. + * autodeps.mk (ALLOBJS): Remove reference to prefix-args. + * Makefile.in (temacs${EXEEXT}): Remove references to + PRE_EDIT_LDFLAGS and POST_EDIT_LDFLAGS. + (mostlyclean): Remove reference to prefix-args. + (prefix-args): Remove. + + Simplify cstart_of_data, start_of_code and related code. + * mem-limits.h: Remove !emacs and _LIBC conditional code. + (start_of_data): Merge into start_of_data function. + * sysdep.c (start_of_text): Remove. Move simplified versions of + it in the only users: unexaix.c and unexec.c. + (read_input_waiting): Remove local declaration of quit_char. + (start, etext): Remove declarations. + (start_of_data): Merge with the version in mem-limits.h and move + to vm-limits.c. + * vm-limit.c (start_of_data): Merged and simplified version of the + code formerly in mem-limits.h and sysdep.c. + * unexec.c (start): New declaration, moved from sysdep.c. + (start_of_text): Simplified version of the code formerly in sysdep.c. + * unexaix.c (start_of_text): Simplified version of the code + formerly in sysdep.c. + * m/alpha.h (HAVE_TEXT_START): Remove. + (TEXT_START): Move ... + * unexalpha.c (TEXT_START): ... here. + * s/hpux10-20.h (TEXT_START): Remove. + * s/darwin.h (TEXT_START): + * m/mips.h (TEXT_START): + * m/macppc.h (HAVE_TEXT_START): + * m/m68k.h (TEXT_START): + * m/iris4d.h (TEXT_START): + * m/intel386.h (TEXT_START): + * m/ibmrs6000.h (TEXT_START): + * m/ia64.h (HAVE_TEXT_START): + * s/msdos.h (TEXT_START): Likewise. + +2010-07-07 Andreas Schwab <schwab@linux-m68k.org> + + * alloc.c (overrun_check_malloc, overrun_check_realloc) + (overrun_check_free, xstrdup, allocate_string) + (allocate_string_data, compact_small_strings, Fmake_string) + (make_unibyte_string, make_multibyte_string) + (make_string_from_bytes, make_specified_string, make_float) + (Fcons, allocate_terminal, allocate_frame, make_pure_string) + (Fgarbage_collect): Replace bcopy, safe_bcopy, bzero, bcmp by + memcpy, memmove, memset, memcmp. + * atimer.c (start_atimer, set_alarm): Likewise. + * buffer.c (clone_per_buffer_values, report_overlay_modification) + (mmap_realloc, init_buffer_once): Likewise. + * callint.c (Fcall_interactively): Likewise. + * callproc.c (Fcall_process, Fcall_process_region, child_setup) + (getenv_internal_1): Likewise. + * casefiddle.c (casify_object): Likewise. + * ccl.c (ccl_driver): Likewise. + * character.c (str_as_multibyte, str_to_multibyte): Likewise. + * charset.c (load_charset_map_from_file) + (load_charset_map_from_file, load_charset_map_from_vector) + (Fdefine_charset_internal): Likewise. + * cm.c (Wcm_clear): Likewise. + * coding.c (decode_eol, decode_coding_object) + (Fset_coding_system_priority, make_subsidiaries): Likewise. + * data.c (Faset): Likewise. + * dired.c (directory_files_internal, file_name_completion_stat): + Likewise. + * dispnew.c (new_glyph_matrix, adjust_glyph_matrix) + (clear_glyph_row, copy_row_except_pointers) + (copy_glyph_row_contents, new_glyph_pool, realloc_glyph_pool) + (save_current_matrix, restore_current_matrix) + (build_frame_matrix_from_leaf_window, mirrored_line_dance) + (mirror_line_dance, scrolling_window): Likewise. + * doc.c (Fsnarf_documentation, Fsubstitute_command_keys): + Likewise. + * doprnt.c (doprnt): Likewise. + * editfns.c (Fuser_full_name, make_buffer_string_both) + (Fmessage_box, Fformat, Ftranspose_regions): Likewise. + * emacs.c (sort_args): Likewise. + * eval.c (Fapply, Ffuncall): Likewise. + * fileio.c (Ffile_name_directory, make_temp_name) + (Fexpand_file_name, search_embedded_absfilename) + (Fsubstitute_in_file_name, Ffile_symlink_p, Finsert_file_contents) + (auto_save_error): Likewise. + * fns.c (Fstring_equal, Fcopy_sequence, concat) + (string_to_multibyte, Fstring_as_unibyte, Fstring_as_multibyte) + (internal_equal, Fclear_string, larger_vector, copy_hash_table) + (Fmake_hash_table): Likewise. + * fringe.c (Fdefine_fringe_bitmap): Likewise. + * ftfont.c (ftfont_text_extents): Likewise. + * getloadavg.c (getloadavg): Likewise. + * image.c (define_image_type, make_image, make_image_cache) + (x_create_x_image_and_pixmap, xbm_image_p) + (w32_create_pixmap_from_bitmap_data, xbm_load, xpm_lookup_color) + (xpm_image_p, x_create_bitmap_from_xpm_data, xpm_load) + (init_color_table, x_build_heuristic_mask, pbm_image_p, pbm_load) + (png_image_p, png_read_from_memory, png_load, jpeg_image_p) + (tiff_image_p, tiff_read_from_memory, gif_image_p) + (gif_read_from_memory, gif_load, svg_image_p, gs_image_p): + Likewise. + * indent.c (scan_for_column, compute_motion): Likewise. + * insdel.c (gap_left, gap_right, make_gap_smaller, copy_text) + (insert_1_both, insert_from_gap, replace_range_2): Likewise. + * intervals.c (reproduce_tree, reproduce_tree_obj): Likewise. + * keyboard.c (echo_char, save_getcjmp, restore_getcjmp) + (kbd_buffer_store_event_hold, apply_modifiers_uncached) + (store_user_signal_events, menu_bar_items, tool_bar_items) + (process_tool_bar_item, append_tool_bar_item) + (read_char_minibuf_menu_prompt, read_key_sequence) + (Fread_key_sequence, Fread_key_sequence_vector, Frecent_keys): + Likewise. + * keymap.c (current_minor_maps, Fdescribe_buffer_bindings): + Likewise. + * lisp.h (STRING_COPYIN): Likewise. + * lread.c (Fload, read1, oblookup): Likewise. + * msdos.c (Frecent_doskeys): Likewise. + * nsfns.m (Fx_create_frame): Likewise. + * nsfont.m (nsfont_open, nsfont_text_extents, ns_glyph_metrics): + Likewise. + * nsimage.m (EmacsImage-initFromSkipXBM:width:height:) + (EmacsImage-initForXPMWithDepth:width:height:flip:length:): + Likewise. + * nsmenu.m (ns_update_menubar): Likewise. + * nsterm.m (ns_draw_fringe_bitmap, ns_term_init): Likewise. + * print.c (print_unwind, printchar, strout, print_string) + (print_error_message): Likewise. + * process.c (conv_lisp_to_sockaddr, set_socket_option) + (Fmake_network_process, Fnetwork_interface_list) + (Fnetwork_interface_info, read_process_output, Fprocess_send_eof) + (init_process): Likewise. + * ralloc.c (resize_bloc, r_alloc_sbrk, r_alloc_init): Likewise. + * regex.c (init_syntax_once, regex_compile, re_compile_fastmap): + Likewise. + * scroll.c (do_scrolling, do_direct_scrolling) + (scrolling_max_lines_saved): Likewise. + * search.c (search_buffer, wordify, Freplace_match): Likewise. + * sound.c (wav_init, au_init, Fplay_sound_internal): Likewise. + * syntax.c (skip_chars, skip_syntaxes): Likewise. + * sysdep.c (child_setup_tty, sys_subshell, emacs_get_tty) + (emacs_set_tty): Likewise. + * term.c (encode_terminal_code, calculate_costs) + (produce_special_glyphs, create_tty_output, init_tty, delete_tty): + Likewise. + * termcap.c (tgetst1, gobble_line): Likewise. + * termhooks.h (EVENT_INIT): Likewise. + * tparam.c (tparam1): Likewise. + * unexalpha.c (unexec): Likewise. + * unexec.c (write_segment): Likewise. + * unexmacosx.c (unexec_write_zero): Likewise. + * w32fns.c (w32_wnd_proc, Fx_create_frame, x_create_tip_frame) + (Fx_file_dialog, Fsystem_move_file_to_trash): Likewise. + * w32font.c (w32font_list_family, w32font_text_extents) + (w32font_list_internal, w32font_match_internal) + (w32font_open_internal, compute_metrics, Fx_select_font): + Likewise. + * w32menu.c (set_frame_menubar, add_menu_item) + (w32_menu_display_help, w32_free_submenu_strings): Likewise. + * w32term.c (XCreateGC, w32_initialize_display_info): Likewise. + * w32uniscribe.c (uniscribe_list_family): Likewise. + * w32xfns.c (get_next_msg, post_msg, prepend_msg): Likewise. + * window.c (make_window, replace_window, set_window_buffer) + (Fsplit_window): Likewise. + * xdisp.c (init_iterator, RECORD_OVERLAY_STRING, reseat_to_string) + (add_to_log, message3, x_consider_frame_title) + (append_space_for_newline, extend_face_to_end_of_line) + (decode_mode_spec_coding, init_glyph_string): Likewise. + * xfaces.c (x_create_gc, get_lface_attributes_no_remap) + (Finternal_copy_lisp_face, Finternal_merge_in_global_face) + (face_attr_equal_p, make_realized_face, make_face_cache) + (free_realized_faces, lookup_named_face, smaller_face) + (face_with_height, lookup_derived_face) + (x_supports_face_attributes_p, Finternal_set_font_selection_order) + (Finternal_set_font_selection_order, realize_default_face) + (compute_char_face, face_at_buffer_position) + (face_for_overlay_string, face_at_string_position, merge_faces): + Likewise. + * xfns.c (xic_create_fontsetname, Fx_create_frame) + (Fx_window_property, x_create_tip_frame) + (Fx_backspace_delete_keys_p): Likewise. + * xfont.c (xfont_list, xfont_match, xfont_list_family) + (xfont_text_extents): Likewise. + * xmenu.c (set_frame_menubar, xmenu_show): Likewise. + * xrdb.c (magic_file_p, x_get_resource): Likewise. + * xselect.c (x_queue_event, x_get_window_property) + (receive_incremental_selection): Likewise. + * xsmfns.c (x_session_check_input): Likewise. + * xterm.c (x_send_scroll_bar_event, SET_SAVED_MENU_EVENT) + (handle_one_xevent, x_check_errors, xim_initialize, x_term_init): + Likewise. + * character.h (BCOPY_SHORT): Removed. + * config.in: Regenerate. + * dispnew.c (safe_bcopy): Only define as dummy if PROFILING. + * emacs.c (main) [PROFILING]: Don't declare + dump_opcode_frequencies. + * lisp.h (safe_bcopy): Remove declaration. + (memset) [!HAVE_MEMSET]: Declare. + (memcpy) [!HAVE_MEMCPY]: Likewise. + (memmove) [!HAVE_MEMMOVE]: Likewise. + (memcmp) [!HAVE_MEMCMP]: Likewise. + * s/ms-w32.h (bzero, bcopy, bcmp, GAP_USE_BCOPY) + (BCOPY_UPWARD_SAFE, BCOPY_DOWNWARD_SAFE, HAVE_BCOPY, HAVE_BCMP): + Don't define. + (HAVE_MEMCMP, HAVE_MEMCPY, HAVE_MEMMOVE, HAVE_MEMSET): Define. + * s/msdos.h (GAP_USE_BCOPY, BCOPY_UPWARD_SAFE) + (BCOPY_DOWNWARD_SAFE): Don't define. + * sysdep.c (memset) [!HAVE_MEMSET]: Define. + (memcpy) [!HAVE_MEMCPY]: Define. + (memmove) [!HAVE_MEMMOVE]: Define. + (memcmp) [!HAVE_MEMCMP]: Define. + 2010-07-07 Jan Djärv <jan.h.d@swipnet.se> * process.c (kbd_is_on_hold): New variable.
--- a/src/Makefile.in Wed Jul 07 22:09:05 2010 +0000 +++ b/src/Makefile.in Thu Jul 08 22:47:34 2010 +0000 @@ -628,20 +628,10 @@ echo "#define BUILDOBJ \"${obj} ${otherobj} " "\"" > buildobj.h -## We cannot define variables for PRE_EDIT and POST_EDIT. -## If !ORDINARY_LINK && !LINKER && GCC, they add a -## `./prefix-args -Xlinker ... ` wrapper, otherwise they are empty. -## One alternative to this approach would be to always call prefix-args, -## and have it DTRT in all cases, by testing the above defines. -temacs${EXEEXT}: $(START_FILES) stamp-oldxmenu ${obj} ${otherobj} prefix-args${EXEEXT} - $(LD) @PRE_EDIT_LDFLAGS@ ${TEMACS_LDFLAGS} @POST_EDIT_LDFLAGS@ \ - ${TEMACS_LDFLAGS2} \ +temacs${EXEEXT}: $(START_FILES) stamp-oldxmenu ${obj} ${otherobj} + $(LD) ${TEMACS_LDFLAGS} ${TEMACS_LDFLAGS2} \ -o temacs ${START_FILES} ${obj} ${otherobj} ${LIBES} -prefix-args${EXEEXT}: prefix-args.o $(config_h) - $(CC) $(LDFLAGS) prefix-args.o -o prefix-args - - ## The following oldxmenu-related rules are only (possibly) used if ## HAVE_X11 && !USE_GTK, but there is no harm in always defining them ## (provided we take a little care that OLDXMENU is never empty). @@ -688,7 +678,7 @@ mostlyclean: - rm -f temacs${EXEEXT} prefix-args${EXEEXT} core *.core \#* *.o libXMenu11.a liblw.a + rm -f temacs${EXEEXT} core *.core \#* *.o libXMenu11.a liblw.a rm -f ../etc/DOC rm -f bootstrap-emacs${EXEEXT} emacs-${version}${EXEEXT} rm -f buildobj.h
--- a/src/alloc.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/alloc.c Thu Jul 08 22:47:34 2010 +0000 @@ -636,10 +636,12 @@ val = (unsigned char *) malloc (size + overhead); if (val && check_depth == 1) { - bcopy (xmalloc_overrun_check_header, val, XMALLOC_OVERRUN_CHECK_SIZE - 4); + memcpy (val, xmalloc_overrun_check_header, + XMALLOC_OVERRUN_CHECK_SIZE - 4); val += XMALLOC_OVERRUN_CHECK_SIZE; XMALLOC_PUT_SIZE(val, size); - bcopy (xmalloc_overrun_check_trailer, val + size, XMALLOC_OVERRUN_CHECK_SIZE); + memcpy (val + size, xmalloc_overrun_check_trailer, + XMALLOC_OVERRUN_CHECK_SIZE); } --check_depth; return (POINTER_TYPE *)val; @@ -659,28 +661,29 @@ if (val && check_depth == 1 - && bcmp (xmalloc_overrun_check_header, - val - XMALLOC_OVERRUN_CHECK_SIZE, - XMALLOC_OVERRUN_CHECK_SIZE - 4) == 0) + && memcmp (xmalloc_overrun_check_header, + val - XMALLOC_OVERRUN_CHECK_SIZE, + XMALLOC_OVERRUN_CHECK_SIZE - 4) == 0) { size_t osize = XMALLOC_GET_SIZE (val); - if (bcmp (xmalloc_overrun_check_trailer, - val + osize, - XMALLOC_OVERRUN_CHECK_SIZE)) + if (memcmp (xmalloc_overrun_check_trailer, val + osize, + XMALLOC_OVERRUN_CHECK_SIZE)) abort (); - bzero (val + osize, XMALLOC_OVERRUN_CHECK_SIZE); + memset (val + osize, 0, XMALLOC_OVERRUN_CHECK_SIZE); val -= XMALLOC_OVERRUN_CHECK_SIZE; - bzero (val, XMALLOC_OVERRUN_CHECK_SIZE); + memset (val, 0, XMALLOC_OVERRUN_CHECK_SIZE); } val = (unsigned char *) realloc ((POINTER_TYPE *)val, size + overhead); if (val && check_depth == 1) { - bcopy (xmalloc_overrun_check_header, val, XMALLOC_OVERRUN_CHECK_SIZE - 4); + memcpy (val, xmalloc_overrun_check_header, + XMALLOC_OVERRUN_CHECK_SIZE - 4); val += XMALLOC_OVERRUN_CHECK_SIZE; XMALLOC_PUT_SIZE(val, size); - bcopy (xmalloc_overrun_check_trailer, val + size, XMALLOC_OVERRUN_CHECK_SIZE); + memcpy (val + size, xmalloc_overrun_check_trailer, + XMALLOC_OVERRUN_CHECK_SIZE); } --check_depth; return (POINTER_TYPE *)val; @@ -697,22 +700,21 @@ ++check_depth; if (val && check_depth == 1 - && bcmp (xmalloc_overrun_check_header, - val - XMALLOC_OVERRUN_CHECK_SIZE, - XMALLOC_OVERRUN_CHECK_SIZE - 4) == 0) + && memcmp (xmalloc_overrun_check_header, + val - XMALLOC_OVERRUN_CHECK_SIZE, + XMALLOC_OVERRUN_CHECK_SIZE - 4) == 0) { size_t osize = XMALLOC_GET_SIZE (val); - if (bcmp (xmalloc_overrun_check_trailer, - val + osize, - XMALLOC_OVERRUN_CHECK_SIZE)) + if (memcmp (xmalloc_overrun_check_trailer, val + osize, + XMALLOC_OVERRUN_CHECK_SIZE)) abort (); #ifdef XMALLOC_CLEAR_FREE_MEMORY val -= XMALLOC_OVERRUN_CHECK_SIZE; memset (val, 0xff, osize + XMALLOC_OVERRUN_CHECK_SIZE*2); #else - bzero (val + osize, XMALLOC_OVERRUN_CHECK_SIZE); + memset (val + osize, 0, XMALLOC_OVERRUN_CHECK_SIZE); val -= XMALLOC_OVERRUN_CHECK_SIZE; - bzero (val, XMALLOC_OVERRUN_CHECK_SIZE); + memset (val, 0, XMALLOC_OVERRUN_CHECK_SIZE); #endif } @@ -799,7 +801,7 @@ { size_t len = strlen (s) + 1; char *p = (char *) xmalloc (len); - bcopy (s, p, len); + memcpy (p, s, len); return p; } @@ -1873,7 +1875,7 @@ int i; b = (struct string_block *) lisp_malloc (sizeof *b, MEM_TYPE_STRING); - bzero (b, sizeof *b); + memset (b, 0, sizeof *b); b->next = string_blocks; string_blocks = b; ++n_string_blocks; @@ -1897,7 +1899,7 @@ MALLOC_UNBLOCK_INPUT; /* Probably not strictly necessary, but play it safe. */ - bzero (s, sizeof *s); + memset (s, 0, sizeof *s); --total_free_strings; ++total_strings; @@ -2005,8 +2007,7 @@ s->size_byte = nbytes; s->data[nbytes] = '\0'; #ifdef GC_CHECK_STRING_OVERRUN - bcopy (string_overrun_cookie, (char *) data + needed, - GC_STRING_OVERRUN_COOKIE_SIZE); + memcpy (data + needed, string_overrun_cookie, GC_STRING_OVERRUN_COOKIE_SIZE); #endif /* If S had already data assigned, mark that as free by setting its @@ -2197,9 +2198,9 @@ from_end = (struct sdata *) ((char *) from + nbytes + GC_STRING_EXTRA); #ifdef GC_CHECK_STRING_OVERRUN - if (bcmp (string_overrun_cookie, - ((char *) from_end) - GC_STRING_OVERRUN_COOKIE_SIZE, - GC_STRING_OVERRUN_COOKIE_SIZE)) + if (memcmp (string_overrun_cookie, + (char *) from_end - GC_STRING_OVERRUN_COOKIE_SIZE, + GC_STRING_OVERRUN_COOKIE_SIZE)) abort (); #endif @@ -2221,7 +2222,7 @@ if (from != to) { xassert (tb != b || to <= from); - safe_bcopy ((char *) from, (char *) to, nbytes + GC_STRING_EXTRA); + memmove (to, from, nbytes + GC_STRING_EXTRA); to->string->data = SDATA_DATA (to); } @@ -2249,8 +2250,7 @@ doc: /* Return a newly created string of length LENGTH, with INIT in each element. LENGTH must be an integer. INIT must be an integer that represents a character. */) - (length, init) - Lisp_Object length, init; + (Lisp_Object length, Lisp_Object init) { register Lisp_Object val; register unsigned char *p, *end; @@ -2280,7 +2280,7 @@ end = p + nbytes; while (p != end) { - bcopy (str, p, len); + memcpy (p, str, len); p += len; } } @@ -2293,8 +2293,7 @@ DEFUN ("make-bool-vector", Fmake_bool_vector, Smake_bool_vector, 2, 2, 0, doc: /* Return a new bool-vector of length LENGTH, using INIT for each element. LENGTH must be a number. INIT matters only in whether it is t or nil. */) - (length, init) - Lisp_Object length, init; + (Lisp_Object length, Lisp_Object init) { register Lisp_Object val; struct Lisp_Bool_Vector *p; @@ -2362,7 +2361,7 @@ { register Lisp_Object val; val = make_uninit_string (length); - bcopy (contents, SDATA (val), length); + memcpy (SDATA (val), contents, length); STRING_SET_UNIBYTE (val); return val; } @@ -2376,7 +2375,7 @@ { register Lisp_Object val; val = make_uninit_multibyte_string (nchars, nbytes); - bcopy (contents, SDATA (val), nbytes); + memcpy (SDATA (val), contents, nbytes); return val; } @@ -2389,7 +2388,7 @@ { register Lisp_Object val; val = make_uninit_multibyte_string (nchars, nbytes); - bcopy (contents, SDATA (val), nbytes); + memcpy (SDATA (val), contents, nbytes); if (SBYTES (val) == SCHARS (val)) STRING_SET_UNIBYTE (val); return val; @@ -2414,7 +2413,7 @@ nchars = nbytes; } val = make_uninit_multibyte_string (nchars, nbytes); - bcopy (contents, SDATA (val), nbytes); + memcpy (SDATA (val), contents, nbytes); if (!multibyte) STRING_SET_UNIBYTE (val); return val; @@ -2587,7 +2586,7 @@ new = (struct float_block *) lisp_align_malloc (sizeof *new, MEM_TYPE_FLOAT); new->next = float_block; - bzero ((char *) new->gcmarkbits, sizeof new->gcmarkbits); + memset (new->gcmarkbits, 0, sizeof new->gcmarkbits); float_block = new; float_block_index = 0; n_float_blocks++; @@ -2686,8 +2685,7 @@ DEFUN ("cons", Fcons, Scons, 2, 2, 0, doc: /* Create a new cons, give it CAR and CDR as components, and return it. */) - (car, cdr) - Lisp_Object car, cdr; + (Lisp_Object car, Lisp_Object cdr) { register Lisp_Object val; @@ -2709,7 +2707,7 @@ register struct cons_block *new; new = (struct cons_block *) lisp_align_malloc (sizeof *new, MEM_TYPE_CONS); - bzero ((char *) new->gcmarkbits, sizeof new->gcmarkbits); + memset (new->gcmarkbits, 0, sizeof new->gcmarkbits); new->next = cons_block; cons_block = new; cons_block_index = 0; @@ -2782,9 +2780,7 @@ doc: /* Return a newly created list with specified arguments as elements. Any number of arguments, even zero arguments, are allowed. usage: (list &rest OBJECTS) */) - (nargs, args) - int nargs; - register Lisp_Object *args; + (int nargs, register Lisp_Object *args) { register Lisp_Object val; val = Qnil; @@ -2800,8 +2796,7 @@ DEFUN ("make-list", Fmake_list, Smake_list, 2, 2, 0, doc: /* Return a newly created list of length LENGTH, with each element being INIT. */) - (length, init) - register Lisp_Object length, init; + (register Lisp_Object length, Lisp_Object init) { register Lisp_Object val; register int size; @@ -2950,8 +2945,8 @@ struct terminal *t = ALLOCATE_PSEUDOVECTOR (struct terminal, next_terminal, PVEC_TERMINAL); /* Zero out the non-GC'd fields. FIXME: This should be made unnecessary. */ - bzero (&(t->next_terminal), - ((char*)(t+1)) - ((char*)&(t->next_terminal))); + memset (&t->next_terminal, 0, + (char*) (t + 1) - (char*) &t->next_terminal); return t; } @@ -2962,8 +2957,8 @@ struct frame *f = ALLOCATE_PSEUDOVECTOR (struct frame, face_cache, PVEC_FRAME); /* Zero out the non-GC'd fields. FIXME: This should be made unnecessary. */ - bzero (&(f->face_cache), - ((char*)(f+1)) - ((char*)&(f->face_cache))); + memset (&f->face_cache, 0, + (char *) (f + 1) - (char *) &f->face_cache); return f; } @@ -2978,8 +2973,7 @@ DEFUN ("make-vector", Fmake_vector, Smake_vector, 2, 2, 0, doc: /* Return a newly created vector of length LENGTH, with each element being INIT. See also the function `vector'. */) - (length, init) - register Lisp_Object length, init; + (register Lisp_Object length, Lisp_Object init) { Lisp_Object vector; register EMACS_INT sizei; @@ -3002,9 +2996,7 @@ doc: /* Return a newly created vector with specified arguments as elements. Any number of arguments, even zero arguments, are allowed. usage: (vector &rest OBJECTS) */) - (nargs, args) - register int nargs; - Lisp_Object *args; + (register int nargs, Lisp_Object *args) { register Lisp_Object len, val; register int index; @@ -3026,9 +3018,7 @@ The first four arguments are required; at most six have any significance. usage: (make-byte-code ARGLIST BYTE-CODE CONSTANTS DEPTH &optional DOCSTRING INTERACTIVE-SPEC &rest ELEMENTS) */) - (nargs, args) - register int nargs; - Lisp_Object *args; + (register int nargs, Lisp_Object *args) { register Lisp_Object len, val; register int index; @@ -3110,8 +3100,7 @@ DEFUN ("make-symbol", Fmake_symbol, Smake_symbol, 1, 1, 0, doc: /* Return a newly allocated uninterned symbol whose name is NAME. Its value and function definition are void, and its property list is nil. */) - (name) - Lisp_Object name; + (Lisp_Object name) { register Lisp_Object val; register struct Lisp_Symbol *p; @@ -3272,7 +3261,7 @@ DEFUN ("make-marker", Fmake_marker, Smake_marker, 0, 0, 0, doc: /* Return a newly allocated marker which does not point at any place. */) - () + (void) { register Lisp_Object val; register struct Lisp_Marker *p; @@ -4001,7 +3990,7 @@ DEFUN ("gc-status", Fgc_status, Sgc_status, 0, 0, "", doc: /* Show information about live and zombie objects. */) - () + (void) { Lisp_Object args[8], zombie_list = Qnil; int i; @@ -4713,7 +4702,7 @@ if (s->data == NULL) { s->data = (unsigned char *) pure_alloc (nbytes + 1, -1); - bcopy (data, s->data, nbytes); + memcpy (s->data, data, nbytes); s->data[nbytes] = '\0'; } s->size = nchars; @@ -4795,8 +4784,7 @@ doc: /* Make a copy of object OBJ in pure storage. Recursively copies contents of vectors and cons cells. Does not copy symbols. Copies strings without text properties. */) - (obj) - register Lisp_Object obj; + (register Lisp_Object obj) { if (NILP (Vpurify_flag)) return obj; @@ -4897,7 +4885,7 @@ (USED-STRINGS . FREE-STRINGS)) However, if there was overflow in pure space, `garbage-collect' returns nil, because real GC can't be done. */) - () + (void) { register struct specbinding *bind; struct catchtag *catch; @@ -4980,9 +4968,9 @@ if (stack_copy) { if ((EMACS_INT) (&stack_top_variable - stack_bottom) > 0) - bcopy (stack_bottom, stack_copy, i); + memcpy (stack_copy, stack_bottom, i); else - bcopy (&stack_top_variable, stack_copy, i); + memcpy (stack_copy, &stack_top_variable, i); } } } @@ -6114,7 +6102,7 @@ doc: /* Return the address of the last byte Emacs has allocated, divided by 1024. This may be helpful in debugging Emacs's memory usage. We divide the value by 1024 to make sure it fits in a Lisp integer. */) - () + (void) { Lisp_Object end; @@ -6136,7 +6124,7 @@ MISCS include overlays, markers, and some internal types. Frames, windows, buffers, and subprocesses count as vectors (but the contents of a buffer's text do not count here). */) - () + (void) { Lisp_Object consed[8];
--- a/src/atimer.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/atimer.c Thu Jul 08 22:47:34 2010 +0000 @@ -116,7 +116,7 @@ t = (struct atimer *) xmalloc (sizeof *t); /* Fill the atimer structure. */ - bzero (t, sizeof *t); + memset (t, 0, sizeof *t); t->type = type; t->fn = fn; t->client_data = client_data; @@ -308,7 +308,7 @@ EMACS_SET_USECS (time, 1000); } - bzero (&it, sizeof it); + memset (&it, 0, sizeof it); it.it_value = time; setitimer (ITIMER_REAL, &it, 0); #else /* not HAVE_SETITIMER */
--- a/src/autodeps.mk Wed Jul 07 22:09:05 2010 +0000 +++ b/src/autodeps.mk Thu Jul 08 22:47:34 2010 +0000 @@ -2,5 +2,5 @@ ## This is inserted in src/Makefile if AUTO_DEPEND=yes. -ALLOBJS=$(START_FILES) ${obj} ${otherobj} prefix-args.o +ALLOBJS=$(START_FILES) ${obj} ${otherobj} -include $(ALLOBJS:%.o=${DEPDIR}/%.d)
--- a/src/bidi.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/bidi.c Thu Jul 08 22:47:34 2010 +0000 @@ -49,16 +49,9 @@ rule X9 and to its modifications decribed in the "Implementation Notes" section of UAX#9, under "Retaining Format Codes". */ -#ifdef HAVE_CONFIG_H #include <config.h> -#endif - #include <stdio.h> - -#ifdef HAVE_STRING_H #include <string.h> -#endif - #include <setjmp.h> #include "lisp.h"
--- a/src/buffer.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/buffer.c Thu Jul 08 22:47:34 2010 +0000 @@ -190,8 +190,7 @@ DEFUN ("buffer-live-p", Fbuffer_live_p, Sbuffer_live_p, 1, 1, 0, doc: /* Return non-nil if OBJECT is a buffer which has not been killed. Value is nil if OBJECT is not a buffer or if it has been killed. */) - (object) - Lisp_Object object; + (Lisp_Object object) { return ((BUFFERP (object) && ! NILP (XBUFFER (object)->name)) ? Qt : Qnil); @@ -202,8 +201,7 @@ If the optional arg FRAME is a frame, we return the buffer list in the proper order for that frame: the buffers in FRAME's `buffer-list' frame parameter come first, followed by the rest of the buffers. */) - (frame) - Lisp_Object frame; + (Lisp_Object frame) { Lisp_Object general; general = Fmapcar (Qcdr, Vbuffer_alist); @@ -266,8 +264,7 @@ BUFFER-OR-NAME must be either a string or a buffer. If BUFFER-OR-NAME is a string and there is no buffer with that name, return nil. If BUFFER-OR-NAME is a buffer, return it as given. */) - (buffer_or_name) - register Lisp_Object buffer_or_name; + (register Lisp_Object buffer_or_name) { if (BUFFERP (buffer_or_name)) return buffer_or_name; @@ -281,8 +278,7 @@ The buffer's `buffer-file-name' must match exactly the expansion of FILENAME. If there is no such live buffer, return nil. See also `find-buffer-visiting'. */) - (filename) - register Lisp_Object filename; + (register Lisp_Object filename) { register Lisp_Object tail, buf, tem; Lisp_Object handler; @@ -337,8 +333,7 @@ If BUFFER-OR-NAME is a buffer instead of a string, return it as given, even if it is dead. The return value is never nil. */) - (buffer_or_name) - register Lisp_Object buffer_or_name; + (register Lisp_Object buffer_or_name) { register Lisp_Object buffer, name; register struct buffer *b; @@ -514,7 +509,7 @@ PER_BUFFER_VALUE (to, offset) = obj; } - bcopy (from->local_flags, to->local_flags, sizeof to->local_flags); + memcpy (to->local_flags, from->local_flags, sizeof to->local_flags); to->overlays_before = copy_overlays (to, from->overlays_before); to->overlays_after = copy_overlays (to, from->overlays_after); @@ -533,8 +528,7 @@ Optional argument CLONE non-nil means preserve BASE-BUFFER's state, such as major and minor modes, in the indirect buffer. CLONE nil means the indirect buffer's state is reset to default values. */) - (base_buffer, name, clone) - Lisp_Object base_buffer, name, clone; + (Lisp_Object base_buffer, Lisp_Object name, Lisp_Object clone) { Lisp_Object buf, tem; struct buffer *b; @@ -829,8 +823,7 @@ \(starting at 2) until an unused name is found, and then return that name. Optional second argument IGNORE specifies a name that is okay to use (if it is in the sequence to be tried) even if a buffer with that name exists. */) - (name, ignore) - register Lisp_Object name, ignore; + (register Lisp_Object name, Lisp_Object ignore) { register Lisp_Object gentemp, tem; int count; @@ -864,8 +857,7 @@ doc: /* Return the name of BUFFER, as a string. BUFFER defaults to the current buffer. Return nil if BUFFER has been killed. */) - (buffer) - register Lisp_Object buffer; + (register Lisp_Object buffer) { if (NILP (buffer)) return current_buffer->name; @@ -876,8 +868,7 @@ DEFUN ("buffer-file-name", Fbuffer_file_name, Sbuffer_file_name, 0, 1, 0, doc: /* Return name of file BUFFER is visiting, or nil if none. No argument or nil as argument means use the current buffer. */) - (buffer) - register Lisp_Object buffer; + (register Lisp_Object buffer) { if (NILP (buffer)) return current_buffer->filename; @@ -890,8 +881,7 @@ doc: /* Return the base buffer of indirect buffer BUFFER. If BUFFER is not indirect, return nil. BUFFER defaults to the current buffer. */) - (buffer) - register Lisp_Object buffer; + (register Lisp_Object buffer) { struct buffer *base; Lisp_Object base_buffer; @@ -915,9 +905,7 @@ doc: /* Return the value of VARIABLE in BUFFER. If VARIABLE does not have a buffer-local binding in BUFFER, the value is the default binding of the variable. */) - (variable, buffer) - register Lisp_Object variable; - register Lisp_Object buffer; + (register Lisp_Object variable, register Lisp_Object buffer) { register struct buffer *buf; register Lisp_Object result; @@ -1015,8 +1003,7 @@ For a symbol that is locally unbound, just the symbol appears in the value. Note that storing new VALUEs in these elements doesn't change the variables. No argument or nil as argument means use current buffer as BUFFER. */) - (buffer) - register Lisp_Object buffer; + (register Lisp_Object buffer) { register struct buffer *buf; register Lisp_Object result; @@ -1058,8 +1045,7 @@ 0, 1, 0, doc: /* Return t if BUFFER was modified since its file was last read or saved. No argument or nil as argument means use current buffer as BUFFER. */) - (buffer) - register Lisp_Object buffer; + (register Lisp_Object buffer) { register struct buffer *buf; if (NILP (buffer)) @@ -1077,8 +1063,7 @@ 1, 1, 0, doc: /* Mark current buffer as modified or unmodified according to FLAG. A non-nil FLAG means mark the buffer modified. */) - (flag) - register Lisp_Object flag; + (register Lisp_Object flag) { register int already; register Lisp_Object fn; @@ -1147,8 +1132,7 @@ doc: /* Like `set-buffer-modified-p', with a difference concerning redisplay. It is not ensured that mode lines will be updated to show the modified state of the current buffer. Use with care. */) - (flag) - Lisp_Object flag; + (Lisp_Object flag) { #ifdef CLASH_DETECTION Lisp_Object fn; @@ -1178,8 +1162,7 @@ Each buffer has a tick counter which is incremented each time the text in that buffer is changed. It wraps around occasionally. No argument or nil as argument means use current buffer as BUFFER. */) - (buffer) - register Lisp_Object buffer; + (register Lisp_Object buffer) { register struct buffer *buf; if (NILP (buffer)) @@ -1203,8 +1186,7 @@ you can tell whether a character change occurred in that buffer in between these calls. No argument or nil as argument means use current buffer as BUFFER. */) - (buffer) - register Lisp_Object buffer; + (register Lisp_Object buffer) { register struct buffer *buf; if (NILP (buffer)) @@ -1230,8 +1212,7 @@ Interactively, you can set UNIQUE with a prefix argument. We return the name we actually gave the buffer. This does not change the name of the visited file (if any). */) - (newname, unique) - register Lisp_Object newname, unique; + (register Lisp_Object newname, Lisp_Object unique) { register Lisp_Object tem, buf; @@ -1278,8 +1259,7 @@ buffer list instead of the selected frame's buffer list. If no other buffer exists, the buffer `*scratch*' is returned. If BUFFER is omitted or nil, some interesting buffer is returned. */) - (buffer, visible_ok, frame) - register Lisp_Object buffer, visible_ok, frame; + (register Lisp_Object buffer, Lisp_Object visible_ok, Lisp_Object frame) { Lisp_Object Fset_buffer_major_mode (Lisp_Object buffer); register Lisp_Object tail, buf, notsogood, tem, pred, add_ons; @@ -1350,8 +1330,7 @@ 0, 1, "", doc: /* Start keeping undo information for buffer BUFFER. No argument or nil as argument means do this for the current buffer. */) - (buffer) - register Lisp_Object buffer; + (register Lisp_Object buffer) { Lisp_Object real_buffer; @@ -1392,8 +1371,7 @@ Any processes that have this buffer as the `process-buffer' are killed with SIGHUP. */) - (buffer_or_name) - Lisp_Object buffer_or_name; + (Lisp_Object buffer_or_name) { Lisp_Object buffer; register struct buffer *b; @@ -1682,8 +1660,7 @@ according to `default-major-mode'. Use this function before selecting the buffer, since it may need to inspect the current buffer's major mode. */) - (buffer) - Lisp_Object buffer; + (Lisp_Object buffer) { int count; Lisp_Object function; @@ -1770,8 +1747,7 @@ WARNING: This is NOT the way to work on another buffer temporarily within a Lisp program! Use `set-buffer' instead. That avoids messing with the window-buffer correspondences. */) - (buffer_or_name, norecord) - Lisp_Object buffer_or_name, norecord; + (Lisp_Object buffer_or_name, Lisp_Object norecord) { if (EQ (buffer_or_name, Fwindow_buffer (selected_window))) { @@ -1800,7 +1776,7 @@ DEFUN ("current-buffer", Fcurrent_buffer, Scurrent_buffer, 0, 0, 0, doc: /* Return the current buffer as a Lisp object. */) - () + (void) { register Lisp_Object buf; XSETBUFFER (buf, current_buffer); @@ -1986,8 +1962,7 @@ temporarily. This function does not display the buffer, so its effect ends when the current command terminates. Use `switch-to-buffer' or `pop-to-buffer' to switch buffers permanently. */) - (buffer_or_name) - register Lisp_Object buffer_or_name; + (register Lisp_Object buffer_or_name) { register Lisp_Object buffer; buffer = Fget_buffer (buffer_or_name); @@ -2012,7 +1987,7 @@ DEFUN ("barf-if-buffer-read-only", Fbarf_if_buffer_read_only, Sbarf_if_buffer_read_only, 0, 0, 0, doc: /* Signal a `buffer-read-only' error if the current buffer is read-only. */) - () + (void) { if (!NILP (current_buffer->read_only) && NILP (Vinhibit_read_only)) @@ -2032,8 +2007,7 @@ window is dedicated to its buffer, delete that window if there are other windows on the same frame. If the selected window is the only window on its frame, iconify that frame. */) - (buffer_or_name) - register Lisp_Object buffer_or_name; + (register Lisp_Object buffer_or_name) { Lisp_Object buffer; @@ -2087,7 +2061,7 @@ doc: /* Delete the entire contents of the current buffer. Any narrowing restriction in effect (see `narrow-to-region') is removed, so the buffer is truly empty after this. */) - () + (void) { Fwiden (); @@ -2161,8 +2135,7 @@ DEFUN ("buffer-swap-text", Fbuffer_swap_text, Sbuffer_swap_text, 1, 1, 0, doc: /* Swap the text between current buffer and BUFFER. */) - (buffer) - Lisp_Object buffer; + (Lisp_Object buffer) { struct buffer *other_buffer; CHECK_BUFFER (buffer); @@ -2300,8 +2273,7 @@ all eight-bit bytes to eight-bit characters. If the multibyte flag was really changed, undo information of the current buffer is cleared. */) - (flag) - Lisp_Object flag; + (Lisp_Object flag) { struct Lisp_Marker *tail, *markers; struct buffer *other; @@ -2599,7 +2571,7 @@ The first thing this function does is run the normal hook `change-major-mode-hook'. */) - () + (void) { if (!NILP (Vrun_hooks)) call1 (Vrun_hooks, Qchange_major_mode_hook); @@ -3700,8 +3672,7 @@ DEFUN ("overlayp", Foverlayp, Soverlayp, 1, 1, 0, doc: /* Return t if OBJECT is an overlay. */) - (object) - Lisp_Object object; + (Lisp_Object object) { return (OVERLAYP (object) ? Qt : Qnil); } @@ -3716,9 +3687,7 @@ The fifth arg REAR-ADVANCE, if non-nil, makes the marker for the rear of the overlay advance when text is inserted there \(which means the text *is* included in the overlay). */) - (beg, end, buffer, front_advance, rear_advance) - Lisp_Object beg, end, buffer; - Lisp_Object front_advance, rear_advance; + (Lisp_Object beg, Lisp_Object end, Lisp_Object buffer, Lisp_Object front_advance, Lisp_Object rear_advance) { Lisp_Object overlay; struct buffer *b; @@ -3838,8 +3807,7 @@ If BUFFER is omitted, leave OVERLAY in the same buffer it inhabits now. If BUFFER is omitted, and OVERLAY is in no buffer, put it in the current buffer. */) - (overlay, beg, end, buffer) - Lisp_Object overlay, beg, end, buffer; + (Lisp_Object overlay, Lisp_Object beg, Lisp_Object end, Lisp_Object buffer) { struct buffer *b, *ob; Lisp_Object obuffer; @@ -3948,8 +3916,7 @@ DEFUN ("delete-overlay", Fdelete_overlay, Sdelete_overlay, 1, 1, 0, doc: /* Delete the overlay OVERLAY from its buffer. */) - (overlay) - Lisp_Object overlay; + (Lisp_Object overlay) { Lisp_Object buffer; struct buffer *b; @@ -3989,8 +3956,7 @@ DEFUN ("overlay-start", Foverlay_start, Soverlay_start, 1, 1, 0, doc: /* Return the position at which OVERLAY starts. */) - (overlay) - Lisp_Object overlay; + (Lisp_Object overlay) { CHECK_OVERLAY (overlay); @@ -3999,8 +3965,7 @@ DEFUN ("overlay-end", Foverlay_end, Soverlay_end, 1, 1, 0, doc: /* Return the position at which OVERLAY ends. */) - (overlay) - Lisp_Object overlay; + (Lisp_Object overlay) { CHECK_OVERLAY (overlay); @@ -4010,8 +3975,7 @@ DEFUN ("overlay-buffer", Foverlay_buffer, Soverlay_buffer, 1, 1, 0, doc: /* Return the buffer OVERLAY belongs to. Return nil if OVERLAY has been deleted. */) - (overlay) - Lisp_Object overlay; + (Lisp_Object overlay) { CHECK_OVERLAY (overlay); @@ -4022,8 +3986,7 @@ doc: /* Return a list of the properties on OVERLAY. This is a copy of OVERLAY's plist; modifying its conses has no effect on OVERLAY. */) - (overlay) - Lisp_Object overlay; + (Lisp_Object overlay) { CHECK_OVERLAY (overlay); @@ -4033,8 +3996,7 @@ DEFUN ("overlays-at", Foverlays_at, Soverlays_at, 1, 1, 0, doc: /* Return a list of the overlays that contain the character at POS. */) - (pos) - Lisp_Object pos; + (Lisp_Object pos) { int noverlays; Lisp_Object *overlay_vec; @@ -4066,8 +4028,7 @@ Empty overlays are included in the result if they are located at BEG, between BEG and END, or at END provided END denotes the position at the end of the buffer. */) - (beg, end) - Lisp_Object beg, end; + (Lisp_Object beg, Lisp_Object end) { int noverlays; Lisp_Object *overlay_vec; @@ -4097,8 +4058,7 @@ doc: /* Return the next position after POS where an overlay starts or ends. If there are no overlay boundaries from POS to (point-max), the value is (point-max). */) - (pos) - Lisp_Object pos; + (Lisp_Object pos) { int noverlays; EMACS_INT endpos; @@ -4139,8 +4099,7 @@ doc: /* Return the previous position before POS where an overlay starts or ends. If there are no overlay boundaries from (point-min) to POS, the value is (point-min). */) - (pos) - Lisp_Object pos; + (Lisp_Object pos) { int noverlays; EMACS_INT prevpos; @@ -4176,7 +4135,7 @@ Recentering overlays moves overlays between these lists. The lists you get are copies, so that changing them has no effect. However, the overlays you get are the real objects that the buffer uses. */) - () + (void) { struct Lisp_Overlay *ol; Lisp_Object before = Qnil, after = Qnil, tmp; @@ -4197,8 +4156,7 @@ doc: /* Recenter the overlays of the current buffer around position POS. That makes overlay lookup faster for positions near POS (but perhaps slower for positions far away from POS). */) - (pos) - Lisp_Object pos; + (Lisp_Object pos) { CHECK_NUMBER_COERCE_MARKER (pos); @@ -4208,8 +4166,7 @@ DEFUN ("overlay-get", Foverlay_get, Soverlay_get, 2, 2, 0, doc: /* Get the property of overlay OVERLAY with property name PROP. */) - (overlay, prop) - Lisp_Object overlay, prop; + (Lisp_Object overlay, Lisp_Object prop) { CHECK_OVERLAY (overlay); return lookup_char_property (XOVERLAY (overlay)->plist, prop, 0); @@ -4217,8 +4174,7 @@ DEFUN ("overlay-put", Foverlay_put, Soverlay_put, 3, 3, 0, doc: /* Set one property of overlay OVERLAY: give property PROP value VALUE. */) - (overlay, prop, value) - Lisp_Object overlay, prop, value; + (Lisp_Object overlay, Lisp_Object prop, Lisp_Object value) { Lisp_Object tail, buffer; int changed; @@ -4413,8 +4369,8 @@ Lisp_Object *copy = (Lisp_Object *) alloca (size * sizeof (Lisp_Object)); int i; - bcopy (XVECTOR (last_overlay_modification_hooks)->contents, - copy, size * sizeof (Lisp_Object)); + memcpy (copy, XVECTOR (last_overlay_modification_hooks)->contents, + size * sizeof (Lisp_Object)); gcpro1.var = copy; gcpro1.nvars = size; @@ -4877,7 +4833,7 @@ } else if (mmap_alloc (var, nbytes)) { - bcopy (old_ptr, *var, r->nbytes_specified); + memcpy (*var, old_ptr, r->nbytes_specified); mmap_free_1 (MMAP_REGION (old_ptr)); result = *var; r = MMAP_REGION (result); @@ -5058,7 +5014,7 @@ { int idx; - bzero (buffer_permanent_local_flags, sizeof buffer_permanent_local_flags); + memset (buffer_permanent_local_flags, 0, sizeof buffer_permanent_local_flags); /* Make sure all markable slots in buffer_defaults are initialized reasonably, so mark_buffer won't choke. */ @@ -5146,7 +5102,7 @@ if (sizeof (EMACS_INT) != sizeof (Lisp_Object)) abort (); /* 0 means not a lisp var, -1 means always local, else mask */ - bzero (&buffer_local_flags, sizeof buffer_local_flags); + memset (&buffer_local_flags, 0, sizeof buffer_local_flags); XSETINT (buffer_local_flags.filename, -1); XSETINT (buffer_local_flags.directory, -1); XSETINT (buffer_local_flags.backed_up, -1);
--- a/src/bytecode.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/bytecode.c Thu Jul 08 22:47:34 2010 +0000 @@ -403,8 +403,7 @@ the second, VECTOR, a vector of constants; the third, MAXDEPTH, the maximum stack depth used in this function. If the third argument is incorrect, Emacs may crash. */) - (bytestr, vector, maxdepth) - Lisp_Object bytestr, vector, maxdepth; + (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth) { int count = SPECPDL_INDEX (); #ifdef BYTE_CODE_METER
--- a/src/callint.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/callint.c Thu Jul 08 22:47:34 2010 +0000 @@ -131,8 +131,7 @@ You may use `@', `*', and `^' together. They are processed in the order that they appear, before reading any arguments. usage: (interactive &optional ARGS) */) - (args) - Lisp_Object args; + (Lisp_Object args) { return Qnil; } @@ -263,8 +262,7 @@ supply, as a vector, if the command inquires which events were used to invoke it. If KEYS is omitted or nil, the return value of `this-command-keys-vector' is used. */) - (function, record_flag, keys) - Lisp_Object function, record_flag, keys; + (Lisp_Object function, Lisp_Object record_flag, Lisp_Object keys) { Lisp_Object *args, *visargs; Lisp_Object specs; @@ -348,8 +346,7 @@ /* Make a copy of string so that if a GC relocates specs, `string' will still be valid. */ string = (unsigned char *) alloca (SBYTES (specs) + 1); - bcopy (SDATA (specs), string, - SBYTES (specs) + 1); + memcpy (string, SDATA (specs), SBYTES (specs) + 1); } else { @@ -873,8 +870,7 @@ doc: /* Return numeric meaning of raw prefix argument RAW. A raw prefix argument is what you get from `(interactive "P")'. Its numeric meaning is what you would get from `(interactive "p")'. */) - (raw) - Lisp_Object raw; + (Lisp_Object raw) { Lisp_Object val;
--- a/src/callproc.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/callproc.c Thu Jul 08 22:47:34 2010 +0000 @@ -215,9 +215,7 @@ If you quit, the process is killed with SIGINT, or SIGKILL if you quit again. usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) - (nargs, args) - int nargs; - register Lisp_Object *args; + (int nargs, register Lisp_Object *args) { Lisp_Object infile, buffer, current_dir, path; int display_p; @@ -775,10 +773,8 @@ PT_BYTE + process_coding.produced); carryover = process_coding.carryover_bytes; if (carryover > 0) - /* As CARRYOVER should not be that large, we had - better avoid overhead of bcopy. */ - BCOPY_SHORT (process_coding.carryover, buf, - process_coding.carryover_bytes); + memcpy (buf, process_coding.carryover, + process_coding.carryover_bytes); } } @@ -879,9 +875,7 @@ If you quit, the process is killed with SIGINT, or SIGKILL if you quit again. usage: (call-process-region START END PROGRAM &optional DELETE BUFFER DISPLAY &rest ARGS) */) - (nargs, args) - int nargs; - register Lisp_Object *args; + (int nargs, register Lisp_Object *args) { struct gcpro gcpro1; Lisp_Object filename_string; @@ -916,7 +910,7 @@ pattern = Fexpand_file_name (Vtemp_file_name_pattern, tmpdir); tempfile = (char *) alloca (SBYTES (pattern) + 1); - bcopy (SDATA (pattern), tempfile, SBYTES (pattern) + 1); + memcpy (tempfile, SDATA (pattern), SBYTES (pattern) + 1); coding_systems = Qt; #ifdef HAVE_MKSTEMP @@ -1099,8 +1093,8 @@ pwd_var = (char *) alloca (i + 6); #endif temp = pwd_var + 4; - bcopy ("PWD=", pwd_var, 4); - bcopy (SDATA (current_dir), temp, i); + memcpy (pwd_var, "PWD=", 4); + memcpy (temp, SDATA (current_dir), i); if (!IS_DIRECTORY_SEP (temp[i - 1])) temp[i++] = DIRECTORY_SEP; temp[i] = 0; @@ -1325,7 +1319,7 @@ /* NT environment variables are case insensitive. */ && ! strnicmp (SDATA (entry), var, varlen) #else /* not WINDOWSNT */ - && ! bcmp (SDATA (entry), var, varlen) + && ! memcmp (SDATA (entry), var, varlen) #endif /* not WINDOWSNT */ ) { @@ -1385,8 +1379,7 @@ If optional parameter ENV is a list, then search this list instead of `process-environment', and return t when encountering a negative entry \(an entry for a variable with no value). */) - (variable, env) - Lisp_Object variable, env; + (Lisp_Object variable, Lisp_Object env) { char *value; int valuelen;
--- a/src/casefiddle.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/casefiddle.c Thu Jul 08 22:47:34 2010 +0000 @@ -128,7 +128,7 @@ unsigned char *old_dst = dst; o_size += o_size; /* Probably overkill, but extremely rare. */ SAFE_ALLOCA (dst, void *, o_size); - bcopy (old_dst, dst, o - old_dst); + memcpy (dst, old_dst, o - old_dst); o = dst + (o - old_dst); } c = STRING_CHAR_AND_LENGTH (SDATA (obj) + i_byte, len); @@ -153,8 +153,7 @@ The argument may be a character or string. The result has the same type. The argument object is not altered--the value is a copy. See also `capitalize', `downcase' and `upcase-initials'. */) - (obj) - Lisp_Object obj; + (Lisp_Object obj) { return casify_object (CASE_UP, obj); } @@ -163,8 +162,7 @@ doc: /* Convert argument to lower case and return that. The argument may be a character or string. The result has the same type. The argument object is not altered--the value is a copy. */) - (obj) - Lisp_Object obj; + (Lisp_Object obj) { return casify_object (CASE_DOWN, obj); } @@ -175,8 +173,7 @@ and the rest is lower case. The argument may be a character or string. The result has the same type. The argument object is not altered--the value is a copy. */) - (obj) - Lisp_Object obj; + (Lisp_Object obj) { return casify_object (CASE_CAPITALIZE, obj); } @@ -188,8 +185,7 @@ Do not change the other letters of each word. The argument may be a character or string. The result has the same type. The argument object is not altered--the value is a copy. */) - (obj) - Lisp_Object obj; + (Lisp_Object obj) { return casify_object (CASE_CAPITALIZE_UP, obj); } @@ -306,8 +302,7 @@ the region to operate on. When used as a command, the text between point and the mark is operated on. See also `capitalize-region'. */) - (beg, end) - Lisp_Object beg, end; + (Lisp_Object beg, Lisp_Object end) { casify_region (CASE_UP, beg, end); return Qnil; @@ -318,8 +313,7 @@ These arguments specify the starting and ending character numbers of the region to operate on. When used as a command, the text between point and the mark is operated on. */) - (beg, end) - Lisp_Object beg, end; + (Lisp_Object beg, Lisp_Object end) { casify_region (CASE_DOWN, beg, end); return Qnil; @@ -331,8 +325,7 @@ and the rest of it is lower case. In programs, give two arguments, the starting and ending character positions to operate on. */) - (beg, end) - Lisp_Object beg, end; + (Lisp_Object beg, Lisp_Object end) { casify_region (CASE_CAPITALIZE, beg, end); return Qnil; @@ -346,8 +339,7 @@ Subsequent letters of each word are not changed. In programs, give two arguments, the starting and ending character positions to operate on. */) - (beg, end) - Lisp_Object beg, end; + (Lisp_Object beg, Lisp_Object end) { casify_region (CASE_CAPITALIZE_UP, beg, end); return Qnil; @@ -376,8 +368,7 @@ doc: /* Convert following word (or ARG words) to upper case, moving over. With negative argument, convert previous words but do not move. See also `capitalize-word'. */) - (arg) - Lisp_Object arg; + (Lisp_Object arg) { Lisp_Object beg, end; EMACS_INT newpoint; @@ -391,8 +382,7 @@ DEFUN ("downcase-word", Fdowncase_word, Sdowncase_word, 1, 1, "p", doc: /* Convert following word (or ARG words) to lower case, moving over. With negative argument, convert previous words but do not move. */) - (arg) - Lisp_Object arg; + (Lisp_Object arg) { Lisp_Object beg, end; EMACS_INT newpoint; @@ -408,8 +398,7 @@ This gives the word(s) a first character in upper case and the rest lower case. With negative argument, capitalize previous words but do not move. */) - (arg) - Lisp_Object arg; + (Lisp_Object arg) { Lisp_Object beg, end; EMACS_INT newpoint;
--- a/src/casetab.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/casetab.c Thu Jul 08 22:47:34 2010 +0000 @@ -41,8 +41,7 @@ DEFUN ("case-table-p", Fcase_table_p, Scase_table_p, 1, 1, 0, doc: /* Return t if OBJECT is a case table. See `set-case-table' for more information on these data structures. */) - (object) - Lisp_Object object; + (Lisp_Object object) { Lisp_Object up, canon, eqv; @@ -71,7 +70,7 @@ DEFUN ("current-case-table", Fcurrent_case_table, Scurrent_case_table, 0, 0, 0, doc: /* Return the case table of the current buffer. */) - () + (void) { return current_buffer->downcase_table; } @@ -79,7 +78,7 @@ DEFUN ("standard-case-table", Fstandard_case_table, Sstandard_case_table, 0, 0, 0, doc: /* Return the standard case table. This is the one used for new buffers. */) - () + (void) { return Vascii_downcase_table; } @@ -103,8 +102,7 @@ EQUIVALENCES is a map that cyclicly permutes each equivalence class (of characters with the same canonical equivalent); it may be nil, in which case it is deduced from CANONICALIZE. */) - (table) - Lisp_Object table; + (Lisp_Object table) { return set_case_table (table, 0); } @@ -112,8 +110,7 @@ DEFUN ("set-standard-case-table", Fset_standard_case_table, Sset_standard_case_table, 1, 1, 0, doc: /* Select a new standard case table for new buffers. See `set-case-table' for more info on case tables. */) - (table) - Lisp_Object table; + (Lisp_Object table) { return set_case_table (table, 1); }
--- a/src/category.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/category.c Thu Jul 08 22:47:34 2010 +0000 @@ -89,8 +89,7 @@ CATEGORIES is a string of category mnemonics. The value is a bool-vector which has t at the indices corresponding to those categories. */) - (categories) - Lisp_Object categories; + (Lisp_Object categories) { Lisp_Object val; int len; @@ -126,8 +125,7 @@ and the rest lines should be the full description. The category is defined only in category table TABLE, which defaults to the current buffer's category table. */) - (category, docstring, table) - Lisp_Object category, docstring, table; + (Lisp_Object category, Lisp_Object docstring, Lisp_Object table) { CHECK_CATEGORY (category); CHECK_STRING (docstring); @@ -146,8 +144,7 @@ doc: /* Return the documentation string of CATEGORY, as defined in TABLE. TABLE should be a category table and defaults to the current buffer's category table. */) - (category, table) - Lisp_Object category, table; + (Lisp_Object category, Lisp_Object table) { CHECK_CATEGORY (category); table = check_category_table (table); @@ -161,8 +158,7 @@ If no category remains available, return nil. The optional argument TABLE specifies which category table to modify; it defaults to the current buffer's category table. */) - (table) - Lisp_Object table; + (Lisp_Object table) { int i; @@ -180,8 +176,7 @@ DEFUN ("category-table-p", Fcategory_table_p, Scategory_table_p, 1, 1, 0, doc: /* Return t if ARG is a category table. */) - (arg) - Lisp_Object arg; + (Lisp_Object arg) { if (CHAR_TABLE_P (arg) && EQ (XCHAR_TABLE (arg)->purpose, Qcategory_table)) @@ -206,7 +201,7 @@ DEFUN ("category-table", Fcategory_table, Scategory_table, 0, 0, 0, doc: /* Return the current category table. This is the one specified by the current buffer. */) - () + (void) { return current_buffer->category_table; } @@ -215,7 +210,7 @@ Sstandard_category_table, 0, 0, 0, doc: /* Return the standard category table. This is the one used for new buffers. */) - () + (void) { return Vstandard_category_table; } @@ -255,8 +250,7 @@ 0, 1, 0, doc: /* Construct a new category table and return it. It is a copy of the TABLE, which defaults to the standard category table. */) - (table) - Lisp_Object table; + (Lisp_Object table) { if (!NILP (table)) check_category_table (table); @@ -269,7 +263,7 @@ DEFUN ("make-category-table", Fmake_category_table, Smake_category_table, 0, 0, 0, doc: /* Construct a new and empty category table and return it. */) - () + (void) { Lisp_Object val; int i; @@ -286,8 +280,7 @@ DEFUN ("set-category-table", Fset_category_table, Sset_category_table, 1, 1, 0, doc: /* Specify TABLE as the category table for the current buffer. Return TABLE. */) - (table) - Lisp_Object table; + (Lisp_Object table) { int idx; table = check_category_table (table); @@ -308,8 +301,7 @@ DEFUN ("char-category-set", Fchar_category_set, Schar_category_set, 1, 1, 0, doc: /* Return the category set of CHAR. usage: (char-category-set CHAR) */) - (ch) - Lisp_Object ch; + (Lisp_Object ch) { CHECK_NUMBER (ch); return CATEGORY_SET (XFASTINT (ch)); @@ -321,8 +313,7 @@ CATEGORY-SET is a bool-vector, and the categories \"in\" it are those that are indexes where t occurs in the bool-vector. The return value is a string containing those same categories. */) - (category_set) - Lisp_Object category_set; + (Lisp_Object category_set) { int i, j; char str[96]; @@ -361,8 +352,7 @@ lower and upper ends of an inclusive character range to modify. If optional fourth argument RESET is non-nil, then delete CATEGORY from the category set instead of adding it. */) - (character, category, table, reset) - Lisp_Object character, category, table, reset; + (Lisp_Object character, Lisp_Object category, Lisp_Object table, Lisp_Object reset) { Lisp_Object set_value; /* Actual value to be set in category sets. */ Lisp_Object category_set;
--- a/src/ccl.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/ccl.c Thu Jul 08 22:47:34 2010 +0000 @@ -1715,7 +1715,7 @@ msglen = strlen (msg); if (dst + msglen <= (dst_bytes ? dst_end : src)) { - bcopy (msg, dst, msglen); + memcpy (dst, msg, msglen); dst += msglen; } @@ -1728,7 +1728,7 @@ msglen = strlen (msg); if (dst + msglen > (dst_bytes ? dst_end : src)) break; - bcopy (msg, dst, msglen); + memcpy (dst, msg, msglen); dst += msglen; } goto ccl_finish; @@ -1761,7 +1761,7 @@ int i = src_end - src; if (dst_bytes && (dst_end - dst) < i) i = dst_end - dst; - bcopy (src, dst, i); + memcpy (dst, src, i); src += i; dst += i; #else
--- a/src/character.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/character.c Thu Jul 08 22:47:34 2010 +0000 @@ -288,15 +288,14 @@ DEFUN ("characterp", Fcharacterp, Scharacterp, 1, 2, 0, doc: /* Return non-nil if OBJECT is a character. */) - (object, ignore) - Lisp_Object object, ignore; + (Lisp_Object object, Lisp_Object ignore) { return (CHARACTERP (object) ? Qt : Qnil); } DEFUN ("max-char", Fmax_char, Smax_char, 0, 0, 0, doc: /* Return the character of the maximum code. */) - () + (void) { return make_number (MAX_CHAR); } @@ -304,8 +303,7 @@ DEFUN ("unibyte-char-to-multibyte", Funibyte_char_to_multibyte, Sunibyte_char_to_multibyte, 1, 1, 0, doc: /* Convert the byte CH to multibyte character. */) - (ch) - Lisp_Object ch; + (Lisp_Object ch) { int c; @@ -321,8 +319,7 @@ Smultibyte_char_to_unibyte, 1, 1, 0, doc: /* Convert the multibyte character CH to a byte. If the multibyte character does not represent a byte, return -1. */) - (ch) - Lisp_Object ch; + (Lisp_Object ch) { int cm; @@ -343,8 +340,7 @@ doc: /* Return 1 regardless of the argument CHAR. This is now an obsolete function. We keep it just for backward compatibility. usage: (char-bytes CHAR) */) - (ch) - Lisp_Object ch; + (Lisp_Object ch) { CHECK_CHARACTER (ch); return make_number (1); @@ -355,8 +351,7 @@ The width is measured by how many columns it occupies on the screen. Tab is taken to occupy `tab-width' columns. usage: (char-width CHAR) */) - (ch) - Lisp_Object ch; + (Lisp_Object ch) { Lisp_Object disp; int c, width; @@ -527,8 +522,7 @@ the following bytes is not checked. Tabs in STRING are always taken to occupy `tab-width' columns. usage: (string-width STRING) */) - (str) - Lisp_Object str; + (Lisp_Object str) { Lisp_Object val; @@ -541,8 +535,7 @@ doc: /* Return the direction of CHAR. The returned value is 0 for left-to-right and 1 for right-to-left. usage: (char-direction CHAR) */) - (ch) - Lisp_Object ch; + (Lisp_Object ch) { int c; @@ -668,7 +661,7 @@ to = p; nbytes = endp - p; endp = str + len; - safe_bcopy ((char *) p, (char *) (endp - nbytes), nbytes); + memmove (endp - nbytes, p, nbytes); p = endp - nbytes; if (nbytes >= MAX_MULTIBYTE_LENGTH) @@ -746,7 +739,7 @@ to = p; bytes = endp - p; endp = str + len; - safe_bcopy ((char *) p, (char *) (endp - bytes), bytes); + memmove (endp - bytes, p, bytes); p = endp - bytes; while (p < endp) { @@ -922,9 +915,7 @@ doc: /* Concatenate all the argument characters and make the result a string. usage: (string &rest CHARACTERS) */) - (n, args) - int n; - Lisp_Object *args; + (int n, Lisp_Object *args) { int i, c; unsigned char *buf, *p; @@ -949,9 +940,7 @@ DEFUN ("unibyte-string", Funibyte_string, Sunibyte_string, 0, MANY, 0, doc: /* Concatenate all the argument bytes and make the result a unibyte string. usage: (unibyte-string &rest BYTES) */) - (n, args) - int n; - Lisp_Object *args; + (int n, Lisp_Object *args) { int i, c; unsigned char *buf, *p; @@ -981,8 +970,7 @@ The value is a character with modifiers resolved into the character code. Unresolved modifiers are kept in the value. usage: (char-resolve-modifiers CHAR) */) - (character) - Lisp_Object character; + (Lisp_Object character) { int c; @@ -1001,8 +989,7 @@ If the current buffer (or STRING) is multibyte, and the target character is not ASCII nor 8-bit character, an error is signalled. */) - (position, string) - Lisp_Object position, string; + (Lisp_Object position, Lisp_Object string) { int c; EMACS_INT pos;
--- a/src/character.h Wed Jul 07 22:09:05 2010 +0000 +++ b/src/character.h Thu Jul 08 22:47:34 2010 +0000 @@ -636,18 +636,6 @@ extern Lisp_Object Vchar_script_table; extern Lisp_Object Vscript_representative_chars; -/* Copy LEN bytes from FROM to TO. This macro should be used only - when a caller knows that LEN is short and the obvious copy loop is - faster than calling bcopy which has some overhead. Copying a - multibyte sequence of a character is the typical case. */ - -#define BCOPY_SHORT(from, to, len) \ - do { \ - int i = len; \ - unsigned char *from_p = from, *to_p = to; \ - while (i--) *to_p++ = *from_p++; \ - } while (0) - #define DEFSYM(sym, name) \ do { (sym) = intern_c_string ((name)); staticpro (&(sym)); } while (0)
--- a/src/charset.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/charset.c Thu Jul 08 22:47:34 2010 +0000 @@ -522,7 +522,7 @@ SAFE_ALLOCA (head, struct charset_map_entries *, sizeof (struct charset_map_entries)); entries = head; - bzero (entries, sizeof (struct charset_map_entries)); + memset (entries, 0, sizeof (struct charset_map_entries)); n_entries = 0; eof = 0; @@ -549,7 +549,7 @@ SAFE_ALLOCA (entries->next, struct charset_map_entries *, sizeof (struct charset_map_entries)); entries = entries->next; - bzero (entries, sizeof (struct charset_map_entries)); + memset (entries, 0, sizeof (struct charset_map_entries)); } idx = n_entries % 0x10000; entries->entry[idx].from = from; @@ -585,7 +585,7 @@ SAFE_ALLOCA (head, struct charset_map_entries *, sizeof (struct charset_map_entries)); entries = head; - bzero (entries, sizeof (struct charset_map_entries)); + memset (entries, 0, sizeof (struct charset_map_entries)); n_entries = 0; for (i = 0; i < len; i += 2) @@ -622,7 +622,7 @@ SAFE_ALLOCA (entries->next, struct charset_map_entries *, sizeof (struct charset_map_entries)); entries = entries->next; - bzero (entries, sizeof (struct charset_map_entries)); + memset (entries, 0, sizeof (struct charset_map_entries)); } idx = n_entries % 0x10000; entries->entry[idx].from = from; @@ -663,8 +663,7 @@ DEFUN ("charsetp", Fcharsetp, Scharsetp, 1, 1, 0, doc: /* Return non-nil if and only if OBJECT is a charset.*/) - (object) - Lisp_Object object; + (Lisp_Object object) { return (CHARSETP (object) ? Qt : Qnil); } @@ -830,8 +829,7 @@ The optional 4th and 5th arguments FROM-CODE and TO-CODE specify the range of code points (in CHARSET) of target characters. */) - (function, charset, arg, from_code, to_code) - Lisp_Object function, charset, arg, from_code, to_code; + (Lisp_Object function, Lisp_Object charset, Lisp_Object arg, Lisp_Object from_code, Lisp_Object to_code) { struct charset *cs; unsigned from, to; @@ -869,9 +867,7 @@ Sdefine_charset_internal, charset_arg_max, MANY, 0, doc: /* For internal use only. usage: (define-charset-internal ...) */) - (nargs, args) - int nargs; - Lisp_Object *args; + (int nargs, Lisp_Object *args) { /* Charset attr vector. */ Lisp_Object attrs; @@ -935,7 +931,7 @@ if (! charset.code_linear_p) { charset.code_space_mask = (unsigned char *) xmalloc (256); - bzero (charset.code_space_mask, 256); + memset (charset.code_space_mask, 0, 256); for (i = 0; i < 4; i++) for (j = charset.code_space[i * 4]; j <= charset.code_space[i * 4 + 1]; j++) @@ -1058,7 +1054,7 @@ charset.unified_p = 0; - bzero (charset.fast_map, sizeof (charset.fast_map)); + memset (charset.fast_map, 0, sizeof (charset.fast_map)); if (! NILP (args[charset_arg_code_offset])) { @@ -1191,8 +1187,8 @@ struct charset *new_table = (struct charset *) xmalloc (sizeof (struct charset) * (charset_table_size + 16)); - bcopy (charset_table, new_table, - sizeof (struct charset) * charset_table_size); + memcpy (new_table, charset_table, + sizeof (struct charset) * charset_table_size); charset_table_size += 16; charset_table = new_table; } @@ -1342,8 +1338,7 @@ DEFUN ("define-charset-alias", Fdefine_charset_alias, Sdefine_charset_alias, 2, 2, 0, doc: /* Define ALIAS as an alias for charset CHARSET. */) - (alias, charset) - Lisp_Object alias, charset; + (Lisp_Object alias, Lisp_Object charset) { Lisp_Object attr; @@ -1356,8 +1351,7 @@ DEFUN ("charset-plist", Fcharset_plist, Scharset_plist, 1, 1, 0, doc: /* Return the property list of CHARSET. */) - (charset) - Lisp_Object charset; + (Lisp_Object charset) { Lisp_Object attrs; @@ -1368,8 +1362,7 @@ DEFUN ("set-charset-plist", Fset_charset_plist, Sset_charset_plist, 2, 2, 0, doc: /* Set CHARSET's property list to PLIST. */) - (charset, plist) - Lisp_Object charset, plist; + (Lisp_Object charset, Lisp_Object plist) { Lisp_Object attrs; @@ -1389,8 +1382,7 @@ `define-charset' (which see). Optional third argument DEUNIFY, if non-nil, means to de-unify CHARSET. */) - (charset, unify_map, deunify) - Lisp_Object charset, unify_map, deunify; + (Lisp_Object charset, Lisp_Object unify_map, Lisp_Object deunify) { int id; struct charset *cs; @@ -1445,8 +1437,7 @@ This final char is for private use, thus the range is `0' (48) .. `?' (63). If there's no unused final char for the specified kind of charset, return nil. */) - (dimension, chars) - Lisp_Object dimension, chars; + (Lisp_Object dimension, Lisp_Object chars) { int final_char; @@ -1485,8 +1476,7 @@ On decoding by an ISO-2022 base coding system, when a charset specified by DIMENSION, CHARS, and FINAL-CHAR is designated, behave as if CHARSET is designated instead. */) - (dimension, chars, final_char, charset) - Lisp_Object dimension, chars, final_char, charset; + (Lisp_Object dimension, Lisp_Object chars, Lisp_Object final_char, Lisp_Object charset) { int id; int chars_flag; @@ -1584,8 +1574,7 @@ If the current buffer is unibyte, the returned list may contain only `ascii', `eight-bit-control', and `eight-bit-graphic'. */) - (beg, end, table) - Lisp_Object beg, end, table; + (Lisp_Object beg, Lisp_Object end, Lisp_Object table) { Lisp_Object charsets; EMACS_INT from, from_byte, to, stop, stop_byte; @@ -1636,8 +1625,7 @@ If STR is unibyte, the returned list may contain only `ascii', `eight-bit-control', and `eight-bit-graphic'. */) - (str, table) - Lisp_Object str, table; + (Lisp_Object str, Lisp_Object table) { Lisp_Object charsets; int i; @@ -1888,8 +1876,7 @@ Optional argument RESTRICTION specifies a way to map the pair of CCS and CODE-POINT to a character. Currently not supported and just ignored. */) - (charset, code_point, restriction) - Lisp_Object charset, code_point, restriction; + (Lisp_Object charset, Lisp_Object code_point, Lisp_Object restriction) { int c, id; unsigned code; @@ -1919,8 +1906,7 @@ Optional argument RESTRICTION specifies a way to map CH to a code-point in CCS. Currently not supported and just ignored. */) - (ch, charset, restriction) - Lisp_Object ch, charset, restriction; + (Lisp_Object ch, Lisp_Object charset, Lisp_Object restriction) { int id; unsigned code; @@ -1945,8 +1931,7 @@ CODE1 through CODE4 are optional, but if you don't supply sufficient position codes, it is assumed that the minimum code in each dimension is specified. */) - (charset, code1, code2, code3, code4) - Lisp_Object charset, code1, code2, code3, code4; + (Lisp_Object charset, Lisp_Object code1, Lisp_Object code2, Lisp_Object code3, Lisp_Object code4) { int id, dimension; struct charset *charsetp; @@ -2062,8 +2047,7 @@ The charset is decided by the current priority order of charsets. A position-code is a byte value of each dimension of the code-point of CH in the charset. */) - (ch) - Lisp_Object ch; + (Lisp_Object ch) { struct charset *charset; int c, dimension; @@ -2093,8 +2077,7 @@ If optional 2nd arg RESTRICTION is non-nil, it is a list of charsets from which to find the charset. It may also be a coding system. In that case, find the charset from what supported by that coding system. */) - (ch, restriction) - Lisp_Object ch, restriction; + (Lisp_Object ch, Lisp_Object restriction) { struct charset *charset; @@ -2132,8 +2115,7 @@ Return charset of a character in the current buffer at position POS. If POS is nil, it defauls to the current point. If POS is out of range, the value is nil. */) - (pos) - Lisp_Object pos; + (Lisp_Object pos) { Lisp_Object ch; struct charset *charset; @@ -2155,8 +2137,7 @@ whereas Emacs distinguishes them by charset symbol. See the documentation of the function `charset-info' for the meanings of DIMENSION, CHARS, and FINAL-CHAR. */) - (dimension, chars, final_char) - Lisp_Object dimension, chars, final_char; + (Lisp_Object dimension, Lisp_Object chars, Lisp_Object final_char) { int id; int chars_flag; @@ -2175,7 +2156,7 @@ Internal use only. Clear temporary charset mapping tables. It should be called only from temacs invoked for dumping. */) - () + (void) { if (temp_charset_work) { @@ -2193,8 +2174,7 @@ Scharset_priority_list, 0, 1, 0, doc: /* Return the list of charsets ordered by priority. HIGHESTP non-nil means just return the highest priority one. */) - (highestp) - Lisp_Object highestp; + (Lisp_Object highestp) { Lisp_Object val = Qnil, list = Vcharset_ordered_list; @@ -2213,9 +2193,7 @@ 1, MANY, 0, doc: /* Assign higher priority to the charsets given as arguments. usage: (set-charset-priority &rest charsets) */) - (nargs, args) - int nargs; - Lisp_Object *args; + (int nargs, Lisp_Object *args) { Lisp_Object new_head, old_list, arglist[2]; Lisp_Object list_2022, list_emacs_mule; @@ -2267,8 +2245,7 @@ 0, 1, 0, doc: /* Internal use only. Return charset identification number of CHARSET. */) - (charset) - Lisp_Object charset; + (Lisp_Object charset) { int id;
--- a/src/chartab.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/chartab.c Thu Jul 08 22:47:34 2010 +0000 @@ -62,8 +62,7 @@ property, the property's value should be an integer between 0 and 10 that specifies how many extra slots the char-table has. Otherwise, the char-table has no extra slot. */) - (purpose, init) - register Lisp_Object purpose, init; + (register Lisp_Object purpose, Lisp_Object init) { Lisp_Object vector; Lisp_Object n; @@ -452,8 +451,7 @@ 1, 1, 0, doc: /* Return the subtype of char-table CHAR-TABLE. The value is a symbol. */) - (char_table) - Lisp_Object char_table; + (Lisp_Object char_table) { CHECK_CHAR_TABLE (char_table); @@ -467,8 +465,7 @@ If CHAR-TABLE holds nil for a given character, then the actual applicable value is inherited from the parent char-table \(or from its parents, if necessary). */) - (char_table) - Lisp_Object char_table; + (Lisp_Object char_table) { CHECK_CHAR_TABLE (char_table); @@ -479,8 +476,7 @@ 2, 2, 0, doc: /* Set the parent char-table of CHAR-TABLE to PARENT. Return PARENT. PARENT must be either nil or another char-table. */) - (char_table, parent) - Lisp_Object char_table, parent; + (Lisp_Object char_table, Lisp_Object parent) { Lisp_Object temp; @@ -503,8 +499,7 @@ DEFUN ("char-table-extra-slot", Fchar_table_extra_slot, Schar_table_extra_slot, 2, 2, 0, doc: /* Return the value of CHAR-TABLE's extra-slot number N. */) - (char_table, n) - Lisp_Object char_table, n; + (Lisp_Object char_table, Lisp_Object n) { CHECK_CHAR_TABLE (char_table); CHECK_NUMBER (n); @@ -519,8 +514,7 @@ Sset_char_table_extra_slot, 3, 3, 0, doc: /* Set CHAR-TABLE's extra-slot number N to VALUE. */) - (char_table, n, value) - Lisp_Object char_table, n, value; + (Lisp_Object char_table, Lisp_Object n, Lisp_Object value) { CHECK_CHAR_TABLE (char_table); CHECK_NUMBER (n); @@ -536,8 +530,7 @@ doc: /* Return the value in CHAR-TABLE for a range of characters RANGE. RANGE should be nil (for the default value), a cons of character codes (for characters in the range), or a character code. */) - (char_table, range) - Lisp_Object char_table, range; + (Lisp_Object char_table, Lisp_Object range) { Lisp_Object val; CHECK_CHAR_TABLE (char_table); @@ -567,8 +560,7 @@ RANGE should be t (for all characters), nil (for the default value), a cons of character codes (for characters in the range), or a character code. Return VALUE. */) - (char_table, range, value) - Lisp_Object char_table, range, value; + (Lisp_Object char_table, Lisp_Object range, Lisp_Object value) { CHECK_CHAR_TABLE (char_table); if (EQ (range, Qt)) @@ -600,8 +592,7 @@ Sset_char_table_default, 3, 3, 0, doc: /* This function is obsolete and has no effect. */) - (char_table, ch, value) - Lisp_Object char_table, ch, value; + (Lisp_Object char_table, Lisp_Object ch, Lisp_Object value) { return Qnil; } @@ -653,8 +644,7 @@ doc: /* Optimize CHAR-TABLE. TEST is the comparison function used to decide whether two entries are equivalent and can be merged. It defaults to `equal'. */) - (char_table, test) - Lisp_Object char_table, test; + (Lisp_Object char_table, Lisp_Object test) { Lisp_Object elt; int i; @@ -866,8 +856,7 @@ FUNCTION is called with two arguments--a key and a value. The key is a character code or a cons of character codes specifying a range of characters that have the same value. */) - (function, char_table) - Lisp_Object function, char_table; + (Lisp_Object function, Lisp_Object char_table) { CHECK_CHAR_TABLE (char_table);
--- a/src/cm.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/cm.c Thu Jul 08 22:47:34 2010 +0000 @@ -430,7 +430,7 @@ void Wcm_clear (struct tty_display_info *tty) { - bzero (tty->Wcm, sizeof (struct cm)); + memset (tty->Wcm, 0, sizeof (struct cm)); UP = 0; BC = 0; }
--- a/src/cmds.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/cmds.c Thu Jul 08 22:47:34 2010 +0000 @@ -48,8 +48,7 @@ DEFUN ("forward-point", Fforward_point, Sforward_point, 1, 1, 0, doc: /* Return buffer position N characters after (before if N negative) point. */) - (n) - Lisp_Object n; + (Lisp_Object n) { CHECK_NUMBER (n); @@ -63,8 +62,7 @@ Depending on the bidirectional context, the movement may be to the right or to the left on the screen. This is in contrast with \\[right-char], which see. */) - (n) - Lisp_Object n; + (Lisp_Object n) { if (NILP (n)) XSETFASTINT (n, 1); @@ -103,8 +101,7 @@ Depending on the bidirectional context, the movement may be to the right or to the left on the screen. This is in contrast with \\[left-char], which see. */) - (n) - Lisp_Object n; + (Lisp_Object n) { if (NILP (n)) XSETFASTINT (n, 1); @@ -123,8 +120,7 @@ that is N - number of lines moved; if backward, N + number moved. With positive N, a non-empty line at the end counts as one line successfully moved (for the return value). */) - (n) - Lisp_Object n; + (Lisp_Object n) { int opoint = PT, opoint_byte = PT_BYTE; int pos, pos_byte; @@ -173,8 +169,7 @@ `inhibit-field-text-motion' to t, or use the `forward-line' function instead. For instance, `(forward-line 0)' does the same thing as `(beginning-of-line)', except that it ignores field boundaries. */) - (n) - Lisp_Object n; + (Lisp_Object n) { if (NILP (n)) XSETFASTINT (n, 1); @@ -197,8 +192,7 @@ N is nil or 1, and a rear-sticky field ends at point, the point does not move. To ignore field boundaries bind `inhibit-field-text-motion' to t. */) - (n) - Lisp_Object n; + (Lisp_Object n) { int newpos; @@ -243,8 +237,7 @@ N was explicitly specified. The command `delete-forward' is preferable for interactive use. */) - (n, killflag) - Lisp_Object n, killflag; + (Lisp_Object n, Lisp_Object killflag) { int pos; @@ -286,8 +279,7 @@ not have word syntax and the previous character in the buffer does. After insertion, the value of `auto-fill-function' is called if the `auto-fill-chars' table has a non-nil value for the inserted character. */) - (n) - Lisp_Object n; + (Lisp_Object n) { int remove_boundary = 1; CHECK_NUMBER (n);
--- a/src/coding.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/coding.c Thu Jul 08 22:47:34 2010 +0000 @@ -6550,7 +6550,7 @@ for (p = pend - 2; p >= pbeg; p--) if (*p == '\r') { - safe_bcopy ((char *) (p + 1), (char *) p, pend-- - p - 1); + memmove (p, p + 1, pend-- - p - 1); n++; } } @@ -7814,7 +7814,7 @@ } if (BEGV < GPT && GPT < BEGV + coding->produced_char) move_gap_both (BEGV, BEGV_BYTE); - bcopy (BEGV_ADDR, destination, coding->produced); + memcpy (destination, BEGV_ADDR, coding->produced); coding->destination = destination; } } @@ -8091,8 +8091,7 @@ doc: /* Return t if OBJECT is nil or a coding-system. See the documentation of `define-coding-system' for information about coding-system objects. */) - (object) - Lisp_Object object; + (Lisp_Object object) { if (NILP (object) || CODING_SYSTEM_ID (object) >= 0) @@ -8106,8 +8105,7 @@ DEFUN ("read-non-nil-coding-system", Fread_non_nil_coding_system, Sread_non_nil_coding_system, 1, 1, 0, doc: /* Read a coding system from the minibuffer, prompting with string PROMPT. */) - (prompt) - Lisp_Object prompt; + (Lisp_Object prompt) { Lisp_Object val; do @@ -8124,8 +8122,7 @@ If the user enters null input, return second argument DEFAULT-CODING-SYSTEM. Ignores case when completing coding systems (all Emacs coding systems are lower-case). */) - (prompt, default_coding_system) - Lisp_Object prompt, default_coding_system; + (Lisp_Object prompt, Lisp_Object default_coding_system) { Lisp_Object val; int count = SPECPDL_INDEX (); @@ -8146,8 +8143,7 @@ If valid, return CODING-SYSTEM, else signal a `coding-system-error' error. It is valid if it is nil or a symbol defined as a coding system by the function `define-coding-system'. */) - (coding_system) - Lisp_Object coding_system; + (Lisp_Object coding_system) { Lisp_Object define_form; @@ -8499,8 +8495,7 @@ If optional argument HIGHEST is non-nil, return the coding system of highest priority. */) - (start, end, highest) - Lisp_Object start, end, highest; + (Lisp_Object start, Lisp_Object end, Lisp_Object highest) { int from, to; int from_byte, to_byte; @@ -8538,8 +8533,7 @@ If optional argument HIGHEST is non-nil, return the coding system of highest priority. */) - (string, highest) - Lisp_Object string, highest; + (Lisp_Object string, Lisp_Object highest) { CHECK_STRING (string); @@ -8581,8 +8575,7 @@ Ffind_coding_systems_region_internal, Sfind_coding_systems_region_internal, 2, 3, 0, doc: /* Internal use only. */) - (start, end, exclude) - Lisp_Object start, end, exclude; + (Lisp_Object start, Lisp_Object end, Lisp_Object exclude) { Lisp_Object coding_attrs_list, safe_codings; EMACS_INT start_byte, end_byte; @@ -8715,8 +8708,7 @@ If optional 5th argument STRING is non-nil, it is a string to search for un-encodable characters. In that case, START and END are indexes to the string. */) - (start, end, coding_system, count, string) - Lisp_Object start, end, coding_system, count, string; + (Lisp_Object start, Lisp_Object end, Lisp_Object coding_system, Lisp_Object count, Lisp_Object string) { int n; struct coding_system coding; @@ -8831,8 +8823,7 @@ If the current buffer (or START if it is a string) is unibyte, the value is nil. */) - (start, end, coding_system_list) - Lisp_Object start, end, coding_system_list; + (Lisp_Object start, Lisp_Object end, Lisp_Object coding_system_list) { Lisp_Object list; EMACS_INT start_byte, end_byte; @@ -8998,8 +8989,7 @@ This function sets `last-coding-system-used' to the precise coding system used (which may be different from CODING-SYSTEM if CODING-SYSTEM is not fully specified.) */) - (start, end, coding_system, destination) - Lisp_Object start, end, coding_system, destination; + (Lisp_Object start, Lisp_Object end, Lisp_Object coding_system, Lisp_Object destination) { return code_convert_region (start, end, coding_system, destination, 0, 0); } @@ -9021,8 +9011,7 @@ This function sets `last-coding-system-used' to the precise coding system used (which may be different from CODING-SYSTEM if CODING-SYSTEM is not fully specified.) */) - (start, end, coding_system, destination) - Lisp_Object start, end, coding_system, destination; + (Lisp_Object start, Lisp_Object end, Lisp_Object coding_system, Lisp_Object destination) { return code_convert_region (start, end, coding_system, destination, 1, 0); } @@ -9099,8 +9088,7 @@ This function sets `last-coding-system-used' to the precise coding system used (which may be different from CODING-SYSTEM if CODING-SYSTEM is not fully specified.) */) - (string, coding_system, nocopy, buffer) - Lisp_Object string, coding_system, nocopy, buffer; + (Lisp_Object string, Lisp_Object coding_system, Lisp_Object nocopy, Lisp_Object buffer) { return code_convert_string (string, coding_system, buffer, 0, ! NILP (nocopy), 0); @@ -9120,8 +9108,7 @@ This function sets `last-coding-system-used' to the precise coding system used (which may be different from CODING-SYSTEM if CODING-SYSTEM is not fully specified.) */) - (string, coding_system, nocopy, buffer) - Lisp_Object string, coding_system, nocopy, buffer; + (Lisp_Object string, Lisp_Object coding_system, Lisp_Object nocopy, Lisp_Object buffer) { return code_convert_string (string, coding_system, buffer, 1, ! NILP (nocopy), 1); @@ -9131,8 +9118,7 @@ DEFUN ("decode-sjis-char", Fdecode_sjis_char, Sdecode_sjis_char, 1, 1, 0, doc: /* Decode a Japanese character which has CODE in shift_jis encoding. Return the corresponding character. */) - (code) - Lisp_Object code; + (Lisp_Object code) { Lisp_Object spec, attrs, val; struct charset *charset_roman, *charset_kanji, *charset_kana, *charset; @@ -9179,8 +9165,7 @@ DEFUN ("encode-sjis-char", Fencode_sjis_char, Sencode_sjis_char, 1, 1, 0, doc: /* Encode a Japanese character CH to shift_jis encoding. Return the corresponding code in SJIS. */) - (ch) - Lisp_Object ch; + (Lisp_Object ch) { Lisp_Object spec, attrs, charset_list; int c; @@ -9208,8 +9193,7 @@ DEFUN ("decode-big5-char", Fdecode_big5_char, Sdecode_big5_char, 1, 1, 0, doc: /* Decode a Big5 character which has CODE in BIG5 coding system. Return the corresponding character. */) - (code) - Lisp_Object code; + (Lisp_Object code) { Lisp_Object spec, attrs, val; struct charset *charset_roman, *charset_big5, *charset; @@ -9247,8 +9231,7 @@ DEFUN ("encode-big5-char", Fencode_big5_char, Sencode_big5_char, 1, 1, 0, doc: /* Encode the Big5 character CH to BIG5 coding system. Return the corresponding character code in Big5. */) - (ch) - Lisp_Object ch; + (Lisp_Object ch) { Lisp_Object spec, attrs, charset_list; struct charset *charset; @@ -9275,9 +9258,7 @@ DEFUN ("set-terminal-coding-system-internal", Fset_terminal_coding_system_internal, Sset_terminal_coding_system_internal, 1, 2, 0, doc: /* Internal use only. */) - (coding_system, terminal) - Lisp_Object coding_system; - Lisp_Object terminal; + (Lisp_Object coding_system, Lisp_Object terminal) { struct coding_system *terminal_coding = TERMINAL_TERMINAL_CODING (get_terminal (terminal, 1)); CHECK_SYMBOL (coding_system); @@ -9295,8 +9276,7 @@ Fset_safe_terminal_coding_system_internal, Sset_safe_terminal_coding_system_internal, 1, 1, 0, doc: /* Internal use only. */) - (coding_system) - Lisp_Object coding_system; + (Lisp_Object coding_system) { CHECK_SYMBOL (coding_system); setup_coding_system (Fcheck_coding_system (coding_system), @@ -9313,8 +9293,7 @@ doc: /* Return coding system specified for terminal output on the given terminal. TERMINAL may be a terminal object, a frame, or nil for the selected frame's terminal device. */) - (terminal) - Lisp_Object terminal; + (Lisp_Object terminal) { struct coding_system *terminal_coding = TERMINAL_TERMINAL_CODING (get_terminal (terminal, 1)); @@ -9327,9 +9306,7 @@ DEFUN ("set-keyboard-coding-system-internal", Fset_keyboard_coding_system_internal, Sset_keyboard_coding_system_internal, 1, 2, 0, doc: /* Internal use only. */) - (coding_system, terminal) - Lisp_Object coding_system; - Lisp_Object terminal; + (Lisp_Object coding_system, Lisp_Object terminal) { struct terminal *t = get_terminal (terminal, 1); CHECK_SYMBOL (coding_system); @@ -9347,8 +9324,7 @@ DEFUN ("keyboard-coding-system", Fkeyboard_coding_system, Skeyboard_coding_system, 0, 1, 0, doc: /* Return coding system specified for decoding keyboard input. */) - (terminal) - Lisp_Object terminal; + (Lisp_Object terminal) { return CODING_ID_NAME (TERMINAL_KEYBOARD_CODING (get_terminal (terminal, 1))->id); @@ -9396,9 +9372,7 @@ contents of BUFFER instead of reading the file. usage: (find-operation-coding-system OPERATION ARGUMENTS...) */) - (nargs, args) - int nargs; - Lisp_Object *args; + (int nargs, Lisp_Object *args) { Lisp_Object operation, target_idx, target, val; register Lisp_Object chain; @@ -9474,15 +9448,13 @@ all but the first one are ignored. usage: (set-coding-system-priority &rest coding-systems) */) - (nargs, args) - int nargs; - Lisp_Object *args; + (int nargs, Lisp_Object *args) { int i, j; int changed[coding_category_max]; enum coding_category priorities[coding_category_max]; - bzero (changed, sizeof changed); + memset (changed, 0, sizeof changed); for (i = j = 0; i < nargs; i++) { @@ -9517,7 +9489,7 @@ priorities[i] = coding_priorities[j]; } - bcopy (priorities, coding_priorities, sizeof priorities); + memcpy (coding_priorities, priorities, sizeof priorities); /* Update `coding-category-list'. */ Vcoding_category_list = Qnil; @@ -9536,8 +9508,7 @@ assigned to each coding category (see `coding-category-list'). HIGHESTP non-nil means just return the highest priority one. */) - (highestp) - Lisp_Object highestp; + (Lisp_Object highestp) { int i; Lisp_Object val; @@ -9568,11 +9539,11 @@ char *buf = (char *) alloca (base_name_len + 6); int i; - bcopy (SDATA (SYMBOL_NAME (base)), buf, base_name_len); + memcpy (buf, SDATA (SYMBOL_NAME (base)), base_name_len); subsidiaries = Fmake_vector (make_number (3), Qnil); for (i = 0; i < 3; i++) { - bcopy (suffixes[i], buf + base_name_len, strlen (suffixes[i]) + 1); + memcpy (buf + base_name_len, suffixes[i], strlen (suffixes[i]) + 1); ASET (subsidiaries, i, intern (buf)); } return subsidiaries; @@ -9583,9 +9554,7 @@ Sdefine_coding_system_internal, coding_arg_max, MANY, 0, doc: /* For internal use only. usage: (define-coding-system-internal ...) */) - (nargs, args) - int nargs; - Lisp_Object *args; + (int nargs, Lisp_Object *args) { Lisp_Object name; Lisp_Object spec_vec; /* [ ATTRS ALIASE EOL_TYPE ] */ @@ -10114,8 +10083,7 @@ DEFUN ("coding-system-put", Fcoding_system_put, Scoding_system_put, 3, 3, 0, doc: /* Change value in CODING-SYSTEM's property list PROP to VAL. */) - (coding_system, prop, val) - Lisp_Object coding_system, prop, val; + (Lisp_Object coding_system, Lisp_Object prop, Lisp_Object val) { Lisp_Object spec, attrs; @@ -10171,8 +10139,7 @@ DEFUN ("define-coding-system-alias", Fdefine_coding_system_alias, Sdefine_coding_system_alias, 2, 2, 0, doc: /* Define ALIAS as an alias for CODING-SYSTEM. */) - (alias, coding_system) - Lisp_Object alias, coding_system; + (Lisp_Object alias, Lisp_Object coding_system) { Lisp_Object spec, aliases, eol_type, val; @@ -10212,8 +10179,7 @@ 1, 1, 0, doc: /* Return the base of CODING-SYSTEM. Any alias or subsidiary coding system is not a base coding system. */) - (coding_system) - Lisp_Object coding_system; + (Lisp_Object coding_system) { Lisp_Object spec, attrs; @@ -10227,8 +10193,7 @@ DEFUN ("coding-system-plist", Fcoding_system_plist, Scoding_system_plist, 1, 1, 0, doc: "Return the property list of CODING-SYSTEM.") - (coding_system) - Lisp_Object coding_system; + (Lisp_Object coding_system) { Lisp_Object spec, attrs; @@ -10243,8 +10208,7 @@ DEFUN ("coding-system-aliases", Fcoding_system_aliases, Scoding_system_aliases, 1, 1, 0, doc: /* Return the list of aliases of CODING-SYSTEM. */) - (coding_system) - Lisp_Object coding_system; + (Lisp_Object coding_system) { Lisp_Object spec; @@ -10265,8 +10229,7 @@ A vector value indicates that a format of end-of-line should be detected automatically. Nth element of the vector is the subsidiary coding system whose eol-type is N. */) - (coding_system) - Lisp_Object coding_system; + (Lisp_Object coding_system) { Lisp_Object spec, eol_type; int n;
--- a/src/composite.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/composite.c Thu Jul 08 22:47:34 2010 +0000 @@ -1758,8 +1758,7 @@ If GLYPH is nil, the remaining elements of the glyph-string vector should be ignored. */) - (from, to, font_object, string) - Lisp_Object font_object, from, to, string; + (Lisp_Object from, Lisp_Object to, Lisp_Object font_object, Lisp_Object string) { Lisp_Object gstring, header; EMACS_INT frompos, topos; @@ -1804,8 +1803,7 @@ Compose text in the region between START and END. Optional 3rd and 4th arguments are COMPONENTS and MODIFICATION-FUNC for the composition. See `compose-region' for more details. */) - (start, end, components, modification_func) - Lisp_Object start, end, components, modification_func; + (Lisp_Object start, Lisp_Object end, Lisp_Object components, Lisp_Object modification_func) { validate_region (&start, &end); if (!NILP (components) @@ -1825,8 +1823,7 @@ Compose text between indices START and END of STRING. Optional 4th and 5th arguments are COMPONENTS and MODIFICATION-FUNC for the composition. See `compose-string' for more details. */) - (string, start, end, components, modification_func) - Lisp_Object string, start, end, components, modification_func; + (Lisp_Object string, Lisp_Object start, Lisp_Object end, Lisp_Object components, Lisp_Object modification_func) { CHECK_STRING (string); CHECK_NUMBER (start); @@ -1847,8 +1844,7 @@ Return information about composition at or nearest to position POS. See `find-composition' for more details. */) - (pos, limit, string, detail_p) - Lisp_Object pos, limit, string, detail_p; + (Lisp_Object pos, Lisp_Object limit, Lisp_Object string, Lisp_Object detail_p) { Lisp_Object prop, tail, gstring; EMACS_INT start, end, from, to;
--- a/src/config.in Wed Jul 07 22:09:05 2010 +0000 +++ b/src/config.in Thu Jul 08 22:47:34 2010 +0000 @@ -102,15 +102,6 @@ /* Define to 1 if ALSA is available. */ #undef HAVE_ALSA -/* Define to 1 if you have the `bcmp' function. */ -#undef HAVE_BCMP - -/* Define to 1 if you have the `bcopy' function. */ -#undef HAVE_BCOPY - -/* Define to 1 if you have the `bzero' function. */ -#undef HAVE_BZERO - /* Define to 1 if you have the `cbrt' function. */ #undef HAVE_CBRT @@ -1141,10 +1132,6 @@ #include <string.h> #endif -#ifdef HAVE_STRINGS_H -#include <strings.h> /* May be needed for bcopy & al. */ -#endif - #ifdef HAVE_STDLIB_H #include <stdlib.h> #endif @@ -1186,16 +1173,6 @@ # endif #endif -#ifndef HAVE_BCOPY -#define bcopy(a,b,s) memcpy (b,a,s) -#endif -#ifndef HAVE_BZERO -#define bzero(a,s) memset (a,0,s) -#endif -#ifndef HAVE_BCMP -#define BCMP memcmp -#endif - #endif /* EMACS_CONFIG_H */ /*
--- a/src/data.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/data.c Thu Jul 08 22:47:34 2010 +0000 @@ -154,8 +154,7 @@ DEFUN ("eq", Feq, Seq, 2, 2, 0, doc: /* Return t if the two args are the same Lisp object. */) - (obj1, obj2) - Lisp_Object obj1, obj2; + (Lisp_Object obj1, Lisp_Object obj2) { if (EQ (obj1, obj2)) return Qt; @@ -164,8 +163,7 @@ DEFUN ("null", Fnull, Snull, 1, 1, 0, doc: /* Return t if OBJECT is nil. */) - (object) - Lisp_Object object; + (Lisp_Object object) { if (NILP (object)) return Qt; @@ -176,8 +174,7 @@ doc: /* Return a symbol representing the type of OBJECT. The symbol returned names the object's basic type; for example, (type-of 1) returns `integer'. */) - (object) - Lisp_Object object; + (Lisp_Object object) { switch (XTYPE (object)) { @@ -244,8 +241,7 @@ DEFUN ("consp", Fconsp, Sconsp, 1, 1, 0, doc: /* Return t if OBJECT is a cons cell. */) - (object) - Lisp_Object object; + (Lisp_Object object) { if (CONSP (object)) return Qt; @@ -254,8 +250,7 @@ DEFUN ("atom", Fatom, Satom, 1, 1, 0, doc: /* Return t if OBJECT is not a cons cell. This includes nil. */) - (object) - Lisp_Object object; + (Lisp_Object object) { if (CONSP (object)) return Qnil; @@ -265,8 +260,7 @@ DEFUN ("listp", Flistp, Slistp, 1, 1, 0, doc: /* Return t if OBJECT is a list, that is, a cons cell or nil. Otherwise, return nil. */) - (object) - Lisp_Object object; + (Lisp_Object object) { if (CONSP (object) || NILP (object)) return Qt; @@ -275,8 +269,7 @@ DEFUN ("nlistp", Fnlistp, Snlistp, 1, 1, 0, doc: /* Return t if OBJECT is not a list. Lists include nil. */) - (object) - Lisp_Object object; + (Lisp_Object object) { if (CONSP (object) || NILP (object)) return Qnil; @@ -285,8 +278,7 @@ DEFUN ("symbolp", Fsymbolp, Ssymbolp, 1, 1, 0, doc: /* Return t if OBJECT is a symbol. */) - (object) - Lisp_Object object; + (Lisp_Object object) { if (SYMBOLP (object)) return Qt; @@ -299,8 +291,7 @@ doc: /* Return t if OBJECT is a keyword. This means that it is a symbol with a print name beginning with `:' interned in the initial obarray. */) - (object) - Lisp_Object object; + (Lisp_Object object) { if (SYMBOLP (object) && SREF (SYMBOL_NAME (object), 0) == ':' @@ -311,8 +302,7 @@ DEFUN ("vectorp", Fvectorp, Svectorp, 1, 1, 0, doc: /* Return t if OBJECT is a vector. */) - (object) - Lisp_Object object; + (Lisp_Object object) { if (VECTORP (object)) return Qt; @@ -321,8 +311,7 @@ DEFUN ("stringp", Fstringp, Sstringp, 1, 1, 0, doc: /* Return t if OBJECT is a string. */) - (object) - Lisp_Object object; + (Lisp_Object object) { if (STRINGP (object)) return Qt; @@ -332,8 +321,7 @@ DEFUN ("multibyte-string-p", Fmultibyte_string_p, Smultibyte_string_p, 1, 1, 0, doc: /* Return t if OBJECT is a multibyte string. */) - (object) - Lisp_Object object; + (Lisp_Object object) { if (STRINGP (object) && STRING_MULTIBYTE (object)) return Qt; @@ -342,8 +330,7 @@ DEFUN ("char-table-p", Fchar_table_p, Schar_table_p, 1, 1, 0, doc: /* Return t if OBJECT is a char-table. */) - (object) - Lisp_Object object; + (Lisp_Object object) { if (CHAR_TABLE_P (object)) return Qt; @@ -353,8 +340,7 @@ DEFUN ("vector-or-char-table-p", Fvector_or_char_table_p, Svector_or_char_table_p, 1, 1, 0, doc: /* Return t if OBJECT is a char-table or vector. */) - (object) - Lisp_Object object; + (Lisp_Object object) { if (VECTORP (object) || CHAR_TABLE_P (object)) return Qt; @@ -363,8 +349,7 @@ DEFUN ("bool-vector-p", Fbool_vector_p, Sbool_vector_p, 1, 1, 0, doc: /* Return t if OBJECT is a bool-vector. */) - (object) - Lisp_Object object; + (Lisp_Object object) { if (BOOL_VECTOR_P (object)) return Qt; @@ -373,8 +358,7 @@ DEFUN ("arrayp", Farrayp, Sarrayp, 1, 1, 0, doc: /* Return t if OBJECT is an array (string or vector). */) - (object) - Lisp_Object object; + (Lisp_Object object) { if (ARRAYP (object)) return Qt; @@ -383,8 +367,7 @@ DEFUN ("sequencep", Fsequencep, Ssequencep, 1, 1, 0, doc: /* Return t if OBJECT is a sequence (list or array). */) - (object) - register Lisp_Object object; + (register Lisp_Object object) { if (CONSP (object) || NILP (object) || ARRAYP (object)) return Qt; @@ -393,8 +376,7 @@ DEFUN ("bufferp", Fbufferp, Sbufferp, 1, 1, 0, doc: /* Return t if OBJECT is an editor buffer. */) - (object) - Lisp_Object object; + (Lisp_Object object) { if (BUFFERP (object)) return Qt; @@ -403,8 +385,7 @@ DEFUN ("markerp", Fmarkerp, Smarkerp, 1, 1, 0, doc: /* Return t if OBJECT is a marker (editor pointer). */) - (object) - Lisp_Object object; + (Lisp_Object object) { if (MARKERP (object)) return Qt; @@ -413,8 +394,7 @@ DEFUN ("subrp", Fsubrp, Ssubrp, 1, 1, 0, doc: /* Return t if OBJECT is a built-in function. */) - (object) - Lisp_Object object; + (Lisp_Object object) { if (SUBRP (object)) return Qt; @@ -424,8 +404,7 @@ DEFUN ("byte-code-function-p", Fbyte_code_function_p, Sbyte_code_function_p, 1, 1, 0, doc: /* Return t if OBJECT is a byte-compiled function object. */) - (object) - Lisp_Object object; + (Lisp_Object object) { if (COMPILEDP (object)) return Qt; @@ -434,8 +413,7 @@ DEFUN ("char-or-string-p", Fchar_or_string_p, Schar_or_string_p, 1, 1, 0, doc: /* Return t if OBJECT is a character or a string. */) - (object) - register Lisp_Object object; + (register Lisp_Object object) { if (CHARACTERP (object) || STRINGP (object)) return Qt; @@ -444,8 +422,7 @@ DEFUN ("integerp", Fintegerp, Sintegerp, 1, 1, 0, doc: /* Return t if OBJECT is an integer. */) - (object) - Lisp_Object object; + (Lisp_Object object) { if (INTEGERP (object)) return Qt; @@ -454,8 +431,7 @@ DEFUN ("integer-or-marker-p", Finteger_or_marker_p, Sinteger_or_marker_p, 1, 1, 0, doc: /* Return t if OBJECT is an integer or a marker (editor pointer). */) - (object) - register Lisp_Object object; + (register Lisp_Object object) { if (MARKERP (object) || INTEGERP (object)) return Qt; @@ -464,8 +440,7 @@ DEFUN ("natnump", Fnatnump, Snatnump, 1, 1, 0, doc: /* Return t if OBJECT is a nonnegative integer. */) - (object) - Lisp_Object object; + (Lisp_Object object) { if (NATNUMP (object)) return Qt; @@ -474,8 +449,7 @@ DEFUN ("numberp", Fnumberp, Snumberp, 1, 1, 0, doc: /* Return t if OBJECT is a number (floating point or integer). */) - (object) - Lisp_Object object; + (Lisp_Object object) { if (NUMBERP (object)) return Qt; @@ -486,8 +460,7 @@ DEFUN ("number-or-marker-p", Fnumber_or_marker_p, Snumber_or_marker_p, 1, 1, 0, doc: /* Return t if OBJECT is a number or a marker. */) - (object) - Lisp_Object object; + (Lisp_Object object) { if (NUMBERP (object) || MARKERP (object)) return Qt; @@ -496,8 +469,7 @@ DEFUN ("floatp", Ffloatp, Sfloatp, 1, 1, 0, doc: /* Return t if OBJECT is a floating point number. */) - (object) - Lisp_Object object; + (Lisp_Object object) { if (FLOATP (object)) return Qt; @@ -513,16 +485,14 @@ See Info node `(elisp)Cons Cells' for a discussion of related basic Lisp concepts such as car, cdr, cons cell and list. */) - (list) - register Lisp_Object list; + (register Lisp_Object list) { return CAR (list); } DEFUN ("car-safe", Fcar_safe, Scar_safe, 1, 1, 0, doc: /* Return the car of OBJECT if it is a cons cell, or else nil. */) - (object) - Lisp_Object object; + (Lisp_Object object) { return CAR_SAFE (object); } @@ -533,24 +503,21 @@ See Info node `(elisp)Cons Cells' for a discussion of related basic Lisp concepts such as cdr, car, cons cell and list. */) - (list) - register Lisp_Object list; + (register Lisp_Object list) { return CDR (list); } DEFUN ("cdr-safe", Fcdr_safe, Scdr_safe, 1, 1, 0, doc: /* Return the cdr of OBJECT if it is a cons cell, or else nil. */) - (object) - Lisp_Object object; + (Lisp_Object object) { return CDR_SAFE (object); } DEFUN ("setcar", Fsetcar, Ssetcar, 2, 2, 0, doc: /* Set the car of CELL to be NEWCAR. Returns NEWCAR. */) - (cell, newcar) - register Lisp_Object cell, newcar; + (register Lisp_Object cell, Lisp_Object newcar) { CHECK_CONS (cell); CHECK_IMPURE (cell); @@ -560,8 +527,7 @@ DEFUN ("setcdr", Fsetcdr, Ssetcdr, 2, 2, 0, doc: /* Set the cdr of CELL to be NEWCDR. Returns NEWCDR. */) - (cell, newcdr) - register Lisp_Object cell, newcdr; + (register Lisp_Object cell, Lisp_Object newcdr) { CHECK_CONS (cell); CHECK_IMPURE (cell); @@ -573,8 +539,7 @@ DEFUN ("boundp", Fboundp, Sboundp, 1, 1, 0, doc: /* Return t if SYMBOL's value is not void. */) - (symbol) - register Lisp_Object symbol; + (register Lisp_Object symbol) { Lisp_Object valcontents; struct Lisp_Symbol *sym; @@ -612,8 +577,7 @@ DEFUN ("fboundp", Ffboundp, Sfboundp, 1, 1, 0, doc: /* Return t if SYMBOL's function definition is not void. */) - (symbol) - register Lisp_Object symbol; + (register Lisp_Object symbol) { CHECK_SYMBOL (symbol); return (EQ (XSYMBOL (symbol)->function, Qunbound) ? Qnil : Qt); @@ -622,8 +586,7 @@ DEFUN ("makunbound", Fmakunbound, Smakunbound, 1, 1, 0, doc: /* Make SYMBOL's value be void. Return SYMBOL. */) - (symbol) - register Lisp_Object symbol; + (register Lisp_Object symbol) { CHECK_SYMBOL (symbol); if (SYMBOL_CONSTANT_P (symbol)) @@ -635,8 +598,7 @@ DEFUN ("fmakunbound", Ffmakunbound, Sfmakunbound, 1, 1, 0, doc: /* Make SYMBOL's function definition be void. Return SYMBOL. */) - (symbol) - register Lisp_Object symbol; + (register Lisp_Object symbol) { CHECK_SYMBOL (symbol); if (NILP (symbol) || EQ (symbol, Qt)) @@ -647,8 +609,7 @@ DEFUN ("symbol-function", Fsymbol_function, Ssymbol_function, 1, 1, 0, doc: /* Return SYMBOL's function definition. Error if that is void. */) - (symbol) - register Lisp_Object symbol; + (register Lisp_Object symbol) { CHECK_SYMBOL (symbol); if (!EQ (XSYMBOL (symbol)->function, Qunbound)) @@ -658,8 +619,7 @@ DEFUN ("symbol-plist", Fsymbol_plist, Ssymbol_plist, 1, 1, 0, doc: /* Return SYMBOL's property list. */) - (symbol) - register Lisp_Object symbol; + (register Lisp_Object symbol) { CHECK_SYMBOL (symbol); return XSYMBOL (symbol)->plist; @@ -667,8 +627,7 @@ DEFUN ("symbol-name", Fsymbol_name, Ssymbol_name, 1, 1, 0, doc: /* Return SYMBOL's name, a string. */) - (symbol) - register Lisp_Object symbol; + (register Lisp_Object symbol) { register Lisp_Object name; @@ -679,8 +638,7 @@ DEFUN ("fset", Ffset, Sfset, 2, 2, 0, doc: /* Set SYMBOL's function definition to DEFINITION, and return DEFINITION. */) - (symbol, definition) - register Lisp_Object symbol, definition; + (register Lisp_Object symbol, Lisp_Object definition) { register Lisp_Object function; @@ -714,8 +672,7 @@ The optional third argument DOCSTRING specifies the documentation string for SYMBOL; if it is omitted or nil, SYMBOL uses the documentation string determined by DEFINITION. */) - (symbol, definition, docstring) - register Lisp_Object symbol, definition, docstring; + (register Lisp_Object symbol, Lisp_Object definition, Lisp_Object docstring) { CHECK_SYMBOL (symbol); if (CONSP (XSYMBOL (symbol)->function) @@ -730,8 +687,7 @@ DEFUN ("setplist", Fsetplist, Ssetplist, 2, 2, 0, doc: /* Set SYMBOL's property list to NEWPLIST, and return NEWPLIST. */) - (symbol, newplist) - register Lisp_Object symbol, newplist; + (register Lisp_Object symbol, Lisp_Object newplist) { CHECK_SYMBOL (symbol); XSYMBOL (symbol)->plist = newplist; @@ -744,8 +700,7 @@ The returned value is a pair (MIN . MAX). MIN is the minimum number of args. MAX is the maximum number or the symbol `many', for a function with `&rest' args, or `unevalled' for a special form. */) - (subr) - Lisp_Object subr; + (Lisp_Object subr) { short minargs, maxargs; CHECK_SUBR (subr); @@ -762,8 +717,7 @@ DEFUN ("subr-name", Fsubr_name, Ssubr_name, 1, 1, 0, doc: /* Return name of subroutine SUBR. SUBR must be a built-in function. */) - (subr) - Lisp_Object subr; + (Lisp_Object subr) { const char *name; CHECK_SUBR (subr); @@ -775,8 +729,7 @@ doc: /* Return the interactive form of CMD or nil if none. If CMD is not a command, the return value is nil. Value, if non-nil, is a list \(interactive SPEC). */) - (cmd) - Lisp_Object cmd; + (Lisp_Object cmd) { Lisp_Object fun = indirect_function (cmd); /* Check cycles. */ @@ -868,8 +821,7 @@ variable. If OBJECT is not a symbol, just return it. Signal a cyclic-variable-indirection error if there is a loop in the variable chain of symbols. */) - (object) - Lisp_Object object; + (Lisp_Object object) { if (SYMBOLP (object)) XSETSYMBOL (object, indirect_variable (XSYMBOL (object))); @@ -1124,8 +1076,7 @@ DEFUN ("symbol-value", Fsymbol_value, Ssymbol_value, 1, 1, 0, doc: /* Return SYMBOL's value. Error if that is void. */) - (symbol) - Lisp_Object symbol; + (Lisp_Object symbol) { Lisp_Object val; @@ -1138,8 +1089,7 @@ DEFUN ("set", Fset, Sset, 2, 2, 0, doc: /* Set SYMBOL's value to NEWVAL, and return NEWVAL. */) - (symbol, newval) - register Lisp_Object symbol, newval; + (register Lisp_Object symbol, Lisp_Object newval) { set_internal (symbol, newval, Qnil, 0); return newval; @@ -1387,8 +1337,7 @@ doc: /* Return t if SYMBOL has a non-void default value. This is the value that is seen in buffers that do not have their own values for this variable. */) - (symbol) - Lisp_Object symbol; + (Lisp_Object symbol) { register Lisp_Object value; @@ -1401,8 +1350,7 @@ This is the value that is seen in buffers that do not have their own values for this variable. The default value is meaningful for variables with local bindings in certain buffers. */) - (symbol) - Lisp_Object symbol; + (Lisp_Object symbol) { register Lisp_Object value; @@ -1417,8 +1365,7 @@ doc: /* Set SYMBOL's default value to VALUE. SYMBOL and VALUE are evaluated. The default value is seen in buffers that do not have their own values for this variable. */) - (symbol, value) - Lisp_Object symbol, value; + (Lisp_Object symbol, Lisp_Object value) { struct Lisp_Symbol *sym; @@ -1497,8 +1444,7 @@ The VALUE for the Nth VAR can refer to the new default values of previous VARs. usage: (setq-default [VAR VALUE]...) */) - (args) - Lisp_Object args; + (Lisp_Object args) { register Lisp_Object args_left; register Lisp_Object val, symbol; @@ -1572,8 +1518,7 @@ which makes a variable local in just one buffer. The function `default-value' gets the default value and `set-default' sets it. */) - (variable) - register Lisp_Object variable; + (register Lisp_Object variable) { struct Lisp_Symbol *sym; struct Lisp_Buffer_Local_Value *blv = NULL; @@ -1650,8 +1595,7 @@ Do not use `make-local-variable' to make a hook variable buffer-local. Instead, use `add-hook' and specify t for the LOCAL argument. */) - (variable) - register Lisp_Object variable; + (register Lisp_Object variable) { register Lisp_Object tem; int forwarded; @@ -1752,8 +1696,7 @@ 1, 1, "vKill Local Variable: ", doc: /* Make VARIABLE no longer have a separate value in the current buffer. From now on the default value will apply in this buffer. Return VARIABLE. */) - (variable) - register Lisp_Object variable; + (register Lisp_Object variable) { register Lisp_Object tem; struct Lisp_Buffer_Local_Value *blv; @@ -1841,8 +1784,7 @@ Note that since Emacs 23.1, variables cannot be both buffer-local and frame-local any more (buffer-local bindings used to take precedence over frame-local bindings). */) - (variable) - register Lisp_Object variable; + (register Lisp_Object variable) { int forwarded; union Lisp_Val_Fwd valcontents; @@ -1897,8 +1839,7 @@ 1, 2, 0, doc: /* Non-nil if VARIABLE has a local binding in buffer BUFFER. BUFFER defaults to the current buffer. */) - (variable, buffer) - register Lisp_Object variable, buffer; + (register Lisp_Object variable, Lisp_Object buffer) { register struct buffer *buf; struct Lisp_Symbol *sym; @@ -1962,8 +1903,7 @@ will produce a buffer local binding. See Info node `(elisp)Creating Buffer-Local'. BUFFER defaults to the current buffer. */) - (variable, buffer) - register Lisp_Object variable, buffer; + (register Lisp_Object variable, Lisp_Object buffer) { struct Lisp_Symbol *sym; @@ -1996,8 +1936,7 @@ If the current binding is buffer-local, the value is the current buffer. If the current binding is frame-local, the value is the selected frame. If the current binding is global (the default), the value is nil. */) - (variable) - register Lisp_Object variable; + (register Lisp_Object variable) { struct Lisp_Symbol *sym; @@ -2047,9 +1986,7 @@ TERMINAL may be a terminal object, a frame, or nil (meaning the selected frame's terminal device). */) - (symbol, terminal) - Lisp_Object symbol; - Lisp_Object terminal; + (Lisp_Object symbol, Lisp_Object terminal) { Lisp_Object result; struct terminal *t = get_terminal (terminal, 1); @@ -2066,10 +2003,7 @@ TERMINAL may be a terminal object, a frame, or nil (meaning the selected frame's terminal device). */) - (symbol, terminal, value) - Lisp_Object symbol; - Lisp_Object terminal; - Lisp_Object value; + (Lisp_Object symbol, Lisp_Object terminal, Lisp_Object value) { Lisp_Object result; struct terminal *t = get_terminal (terminal, 1); @@ -2122,9 +2056,7 @@ Optional arg NOERROR non-nil means to return nil instead of signalling. Signal a cyclic-function-indirection error if there is a loop in the function chain of symbols. */) - (object, noerror) - register Lisp_Object object; - Lisp_Object noerror; + (register Lisp_Object object, Lisp_Object noerror) { Lisp_Object result; @@ -2148,9 +2080,7 @@ doc: /* Return the element of ARRAY at index IDX. ARRAY may be a vector, a string, a char-table, a bool-vector, or a byte-code object. IDX starts at 0. */) - (array, idx) - register Lisp_Object array; - Lisp_Object idx; + (register Lisp_Object array, Lisp_Object idx) { register int idxval; @@ -2204,9 +2134,7 @@ doc: /* Store into the element of ARRAY at index IDX the value NEWELT. Return NEWELT. ARRAY may be a vector, a string, a char-table or a bool-vector. IDX starts at 0. */) - (array, idx, newelt) - register Lisp_Object array; - Lisp_Object idx, newelt; + (register Lisp_Object array, Lisp_Object idx, Lisp_Object newelt) { register int idxval; @@ -2264,13 +2192,13 @@ USE_SAFE_ALLOCA; SAFE_ALLOCA (str, unsigned char *, nbytes); - bcopy (SDATA (array), str, nbytes); + memcpy (str, SDATA (array), nbytes); allocate_string_data (XSTRING (array), nchars, nbytes + new_bytes - prev_bytes); - bcopy (str, SDATA (array), idxval_byte); + memcpy (SDATA (array), str, idxval_byte); p1 = SDATA (array) + idxval_byte; - bcopy (str + idxval_byte + prev_bytes, p1 + new_bytes, - nbytes - (idxval_byte + prev_bytes)); + memcpy (p1 + new_bytes, str + idxval_byte + prev_bytes, + nbytes - (idxval_byte + prev_bytes)); SAFE_FREE (); clear_string_char_byte_cache (); } @@ -2360,24 +2288,21 @@ DEFUN ("=", Feqlsign, Seqlsign, 2, 2, 0, doc: /* Return t if two args, both numbers or markers, are equal. */) - (num1, num2) - register Lisp_Object num1, num2; + (register Lisp_Object num1, Lisp_Object num2) { return arithcompare (num1, num2, equal); } DEFUN ("<", Flss, Slss, 2, 2, 0, doc: /* Return t if first arg is less than second arg. Both must be numbers or markers. */) - (num1, num2) - register Lisp_Object num1, num2; + (register Lisp_Object num1, Lisp_Object num2) { return arithcompare (num1, num2, less); } DEFUN (">", Fgtr, Sgtr, 2, 2, 0, doc: /* Return t if first arg is greater than second arg. Both must be numbers or markers. */) - (num1, num2) - register Lisp_Object num1, num2; + (register Lisp_Object num1, Lisp_Object num2) { return arithcompare (num1, num2, grtr); } @@ -2385,8 +2310,7 @@ DEFUN ("<=", Fleq, Sleq, 2, 2, 0, doc: /* Return t if first arg is less than or equal to second arg. Both must be numbers or markers. */) - (num1, num2) - register Lisp_Object num1, num2; + (register Lisp_Object num1, Lisp_Object num2) { return arithcompare (num1, num2, less_or_equal); } @@ -2394,24 +2318,21 @@ DEFUN (">=", Fgeq, Sgeq, 2, 2, 0, doc: /* Return t if first arg is greater than or equal to second arg. Both must be numbers or markers. */) - (num1, num2) - register Lisp_Object num1, num2; + (register Lisp_Object num1, Lisp_Object num2) { return arithcompare (num1, num2, grtr_or_equal); } DEFUN ("/=", Fneq, Sneq, 2, 2, 0, doc: /* Return t if first arg is not equal to second arg. Both must be numbers or markers. */) - (num1, num2) - register Lisp_Object num1, num2; + (register Lisp_Object num1, Lisp_Object num2) { return arithcompare (num1, num2, notequal); } DEFUN ("zerop", Fzerop, Szerop, 1, 1, 0, doc: /* Return t if NUMBER is zero. */) - (number) - register Lisp_Object number; + (register Lisp_Object number) { CHECK_NUMBER_OR_FLOAT (number); @@ -2460,8 +2381,7 @@ doc: /* Return the decimal representation of NUMBER as a string. Uses a minus sign if negative. NUMBER may be an integer or a floating point number. */) - (number) - Lisp_Object number; + (Lisp_Object number) { char buffer[VALBITS]; @@ -2512,8 +2432,7 @@ If BASE, interpret STRING as a number in that base. If BASE isn't present, base 10 is used. BASE must be between 2 and 16 (inclusive). If the base used is not 10, STRING is always parsed as integer. */) - (string, base) - register Lisp_Object string, base; + (register Lisp_Object string, Lisp_Object base) { register unsigned char *p; register int b; @@ -2732,9 +2651,7 @@ DEFUN ("+", Fplus, Splus, 0, MANY, 0, doc: /* Return sum of any number of arguments, which are numbers or markers. usage: (+ &rest NUMBERS-OR-MARKERS) */) - (nargs, args) - int nargs; - Lisp_Object *args; + (int nargs, Lisp_Object *args) { return arith_driver (Aadd, nargs, args); } @@ -2744,9 +2661,7 @@ With one arg, negates it. With more than one arg, subtracts all but the first from the first. usage: (- &optional NUMBER-OR-MARKER &rest MORE-NUMBERS-OR-MARKERS) */) - (nargs, args) - int nargs; - Lisp_Object *args; + (int nargs, Lisp_Object *args) { return arith_driver (Asub, nargs, args); } @@ -2754,9 +2669,7 @@ DEFUN ("*", Ftimes, Stimes, 0, MANY, 0, doc: /* Return product of any number of arguments, which are numbers or markers. usage: (* &rest NUMBERS-OR-MARKERS) */) - (nargs, args) - int nargs; - Lisp_Object *args; + (int nargs, Lisp_Object *args) { return arith_driver (Amult, nargs, args); } @@ -2765,9 +2678,7 @@ doc: /* Return first argument divided by all the remaining arguments. The arguments must be numbers or markers. usage: (/ DIVIDEND DIVISOR &rest DIVISORS) */) - (nargs, args) - int nargs; - Lisp_Object *args; + (int nargs, Lisp_Object *args) { int argnum; for (argnum = 2; argnum < nargs; argnum++) @@ -2779,8 +2690,7 @@ DEFUN ("%", Frem, Srem, 2, 2, 0, doc: /* Return remainder of X divided by Y. Both must be integers or markers. */) - (x, y) - register Lisp_Object x, y; + (register Lisp_Object x, Lisp_Object y) { Lisp_Object val; @@ -2821,8 +2731,7 @@ doc: /* Return X modulo Y. The result falls between zero (inclusive) and Y (exclusive). Both X and Y must be numbers or markers. */) - (x, y) - register Lisp_Object x, y; + (register Lisp_Object x, Lisp_Object y) { Lisp_Object val; EMACS_INT i1, i2; @@ -2853,9 +2762,7 @@ doc: /* Return largest of all the arguments (which must be numbers or markers). The value is always a number; markers are converted to numbers. usage: (max NUMBER-OR-MARKER &rest NUMBERS-OR-MARKERS) */) - (nargs, args) - int nargs; - Lisp_Object *args; + (int nargs, Lisp_Object *args) { return arith_driver (Amax, nargs, args); } @@ -2864,9 +2771,7 @@ doc: /* Return smallest of all the arguments (which must be numbers or markers). The value is always a number; markers are converted to numbers. usage: (min NUMBER-OR-MARKER &rest NUMBERS-OR-MARKERS) */) - (nargs, args) - int nargs; - Lisp_Object *args; + (int nargs, Lisp_Object *args) { return arith_driver (Amin, nargs, args); } @@ -2875,9 +2780,7 @@ doc: /* Return bitwise-and of all the arguments. Arguments may be integers, or markers converted to integers. usage: (logand &rest INTS-OR-MARKERS) */) - (nargs, args) - int nargs; - Lisp_Object *args; + (int nargs, Lisp_Object *args) { return arith_driver (Alogand, nargs, args); } @@ -2886,9 +2789,7 @@ doc: /* Return bitwise-or of all the arguments. Arguments may be integers, or markers converted to integers. usage: (logior &rest INTS-OR-MARKERS) */) - (nargs, args) - int nargs; - Lisp_Object *args; + (int nargs, Lisp_Object *args) { return arith_driver (Alogior, nargs, args); } @@ -2897,9 +2798,7 @@ doc: /* Return bitwise-exclusive-or of all the arguments. Arguments may be integers, or markers converted to integers. usage: (logxor &rest INTS-OR-MARKERS) */) - (nargs, args) - int nargs; - Lisp_Object *args; + (int nargs, Lisp_Object *args) { return arith_driver (Alogxor, nargs, args); } @@ -2908,8 +2807,7 @@ doc: /* Return VALUE with its bits shifted left by COUNT. If COUNT is negative, shifting is actually to the right. In this case, the sign bit is duplicated. */) - (value, count) - register Lisp_Object value, count; + (register Lisp_Object value, Lisp_Object count) { register Lisp_Object val; @@ -2931,8 +2829,7 @@ doc: /* Return VALUE with its bits shifted left by COUNT. If COUNT is negative, shifting is actually to the right. In this case, zeros are shifted in on the left. */) - (value, count) - register Lisp_Object value, count; + (register Lisp_Object value, Lisp_Object count) { register Lisp_Object val; @@ -2953,8 +2850,7 @@ DEFUN ("1+", Fadd1, Sadd1, 1, 1, 0, doc: /* Return NUMBER plus one. NUMBER may be a number or a marker. Markers are converted to integers. */) - (number) - register Lisp_Object number; + (register Lisp_Object number) { CHECK_NUMBER_OR_FLOAT_COERCE_MARKER (number); @@ -2968,8 +2864,7 @@ DEFUN ("1-", Fsub1, Ssub1, 1, 1, 0, doc: /* Return NUMBER minus one. NUMBER may be a number or a marker. Markers are converted to integers. */) - (number) - register Lisp_Object number; + (register Lisp_Object number) { CHECK_NUMBER_OR_FLOAT_COERCE_MARKER (number); @@ -2982,8 +2877,7 @@ DEFUN ("lognot", Flognot, Slognot, 1, 1, 0, doc: /* Return the bitwise complement of NUMBER. NUMBER must be an integer. */) - (number) - register Lisp_Object number; + (register Lisp_Object number) { CHECK_NUMBER (number); XSETINT (number, ~XINT (number)); @@ -2994,7 +2888,7 @@ doc: /* Return the byteorder for the machine. Returns 66 (ASCII uppercase B) for big endian machines or 108 (ASCII lowercase l) for small endian machines. */) - () + (void) { unsigned i = 0x04030201; int order = *(char *)&i == 1 ? 108 : 66;
--- a/src/dbusbind.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/dbusbind.c Thu Jul 08 22:47:34 2010 +0000 @@ -821,8 +821,7 @@ DEFUN ("dbus-init-bus", Fdbus_init_bus, Sdbus_init_bus, 1, 1, 0, doc: /* Initialize connection to D-Bus BUS. This is an internal function, it shall not be used outside dbus.el. */) - (bus) - Lisp_Object bus; + (Lisp_Object bus) { DBusConnection *connection; @@ -847,8 +846,7 @@ DEFUN ("dbus-get-unique-name", Fdbus_get_unique_name, Sdbus_get_unique_name, 1, 1, 0, doc: /* Return the unique name of Emacs registered at D-Bus BUS. */) - (bus) - Lisp_Object bus; + (Lisp_Object bus) { DBusConnection *connection; const char *name; @@ -936,9 +934,7 @@ => "i686" usage: (dbus-call-method BUS SERVICE PATH INTERFACE METHOD &optional :timeout TIMEOUT &rest ARGS) */) - (nargs, args) - int nargs; - register Lisp_Object *args; + (int nargs, register Lisp_Object *args) { Lisp_Object bus, service, path, interface, method; Lisp_Object result; @@ -1120,9 +1116,7 @@ -| i686 usage: (dbus-call-method-asynchronously BUS SERVICE PATH INTERFACE METHOD HANDLER &optional :timeout TIMEOUT &rest ARGS) */) - (nargs, args) - int nargs; - register Lisp_Object *args; + (int nargs, register Lisp_Object *args) { Lisp_Object bus, service, path, interface, method, handler; Lisp_Object result; @@ -1250,9 +1244,7 @@ This is an internal function, it shall not be used outside dbus.el. usage: (dbus-method-return-internal BUS SERIAL SERVICE &rest ARGS) */) - (nargs, args) - int nargs; - register Lisp_Object *args; + (int nargs, register Lisp_Object *args) { Lisp_Object bus, serial, service; struct gcpro gcpro1, gcpro2, gcpro3; @@ -1344,9 +1336,7 @@ This is an internal function, it shall not be used outside dbus.el. usage: (dbus-method-error-internal BUS SERIAL SERVICE &rest ARGS) */) - (nargs, args) - int nargs; - register Lisp_Object *args; + (int nargs, register Lisp_Object *args) { Lisp_Object bus, serial, service; struct gcpro gcpro1, gcpro2, gcpro3; @@ -1461,9 +1451,7 @@ "org.gnu.Emacs.FileManager" "FileModified" "/home/albinus/.emacs") usage: (dbus-send-signal BUS SERVICE PATH INTERFACE SIGNAL &rest ARGS) */) - (nargs, args) - int nargs; - register Lisp_Object *args; + (int nargs, register Lisp_Object *args) { Lisp_Object bus, service, path, interface, signal; struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; @@ -1803,9 +1791,7 @@ `dbus-unregister-object' for removing the registration. usage: (dbus-register-signal BUS SERVICE PATH INTERFACE SIGNAL HANDLER &rest ARGS) */) - (nargs, args) - int nargs; - register Lisp_Object *args; + (int nargs, register Lisp_Object *args) { Lisp_Object bus, service, path, interface, signal, handler; struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5, gcpro6; @@ -1927,8 +1913,7 @@ Lisp function to be called when a method call is received. It must accept the input arguments of METHOD. The return value of HANDLER is used for composing the returning D-Bus message. */) - (bus, service, path, interface, method, handler) - Lisp_Object bus, service, path, interface, method, handler; + (Lisp_Object bus, Lisp_Object service, Lisp_Object path, Lisp_Object interface, Lisp_Object method, Lisp_Object handler) { Lisp_Object key, key1, value; DBusConnection *connection;
--- a/src/dired.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/dired.c Thu Jul 08 22:47:34 2010 +0000 @@ -289,15 +289,14 @@ int nchars; fullname = make_uninit_multibyte_string (nbytes, nbytes); - bcopy (SDATA (directory), SDATA (fullname), - directory_nbytes); + memcpy (SDATA (fullname), SDATA (directory), + directory_nbytes); if (needsep) SSET (fullname, directory_nbytes, DIRECTORY_SEP); - bcopy (SDATA (name), - SDATA (fullname) + directory_nbytes + needsep, - len); + memcpy (SDATA (fullname) + directory_nbytes + needsep, + SDATA (name), len); nchars = chars_in_text (SDATA (fullname), nbytes); @@ -367,8 +366,7 @@ If NOSORT is non-nil, the list is not sorted--its order is unpredictable. Otherwise, the list returned is sorted with `string-lessp'. NOSORT is useful if you plan to sort the result yourself. */) - (directory, full, match, nosort) - Lisp_Object directory, full, match, nosort; + (Lisp_Object directory, Lisp_Object full, Lisp_Object match, Lisp_Object nosort) { Lisp_Object handler; directory = Fexpand_file_name (directory, Qnil); @@ -396,8 +394,7 @@ `file-attributes' for further documentation. On MS-Windows, performance depends on `w32-get-true-file-attributes', which see. */) - (directory, full, match, nosort, id_format) - Lisp_Object directory, full, match, nosort, id_format; + (Lisp_Object directory, Lisp_Object full, Lisp_Object match, Lisp_Object nosort, Lisp_Object id_format) { Lisp_Object handler; directory = Fexpand_file_name (directory, Qnil); @@ -428,8 +425,7 @@ This function ignores some of the possible completions as determined by the variable `completion-ignored-extensions', which see. */) - (file, directory, predicate) - Lisp_Object file, directory, predicate; + (Lisp_Object file, Lisp_Object directory, Lisp_Object predicate) { Lisp_Object handler; @@ -452,8 +448,7 @@ Sfile_name_all_completions, 2, 2, 0, doc: /* Return a list of all completions of file name FILE in directory DIRECTORY. These are all file names in directory DIRECTORY which begin with FILE. */) - (file, directory) - Lisp_Object file, directory; + (Lisp_Object file, Lisp_Object directory) { Lisp_Object handler; @@ -857,11 +852,11 @@ _djstat_flags = _STAT_INODE | _STAT_EXEC_MAGIC | _STAT_DIRSIZE; #endif /* MSDOS */ - bcopy (SDATA (dirname), fullname, pos); + memcpy (fullname, SDATA (dirname), pos); if (!IS_DIRECTORY_SEP (fullname[pos - 1])) fullname[pos++] = DIRECTORY_SEP; - bcopy (dp->d_name, fullname + pos, len); + memcpy (fullname + pos, dp->d_name, len); fullname[pos + len] = 0; #ifdef S_IFLNK @@ -960,8 +955,7 @@ On some FAT-based filesystems, only the date of last access is recorded, so last access time will always be midnight of that day. */) - (filename, id_format) - Lisp_Object filename, id_format; + (Lisp_Object filename, Lisp_Object id_format) { Lisp_Object values[12]; Lisp_Object encoded; @@ -1083,8 +1077,7 @@ DEFUN ("file-attributes-lessp", Ffile_attributes_lessp, Sfile_attributes_lessp, 2, 2, 0, doc: /* Return t if first arg file attributes list is less than second. Comparison is in lexicographic order and case is significant. */) - (f1, f2) - Lisp_Object f1, f2; + (Lisp_Object f1, Lisp_Object f2) { return Fstring_lessp (Fcar (f1), Fcar (f2)); }
--- a/src/dispnew.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/dispnew.c Thu Jul 08 22:47:34 2010 +0000 @@ -413,7 +413,7 @@ DEFUN ("dump-redisplay-history", Fdump_redisplay_history, Sdump_redisplay_history, 0, 0, "", doc: /* Dump redisplay history to stderr. */) - () + (void) { int i; @@ -436,62 +436,15 @@ #endif /* GLYPH_DEBUG == 0 */ -/* Like bcopy except never gets confused by overlap. Let this be the - first function defined in this file, or change emacs.c where the - address of this function is used. */ +#ifdef PROFILING +/* FIXME: only used to find text start for profiling. */ void safe_bcopy (const char *from, char *to, int size) { - if (size <= 0 || from == to) - return; - - /* If the source and destination don't overlap, then bcopy can - handle it. If they do overlap, but the destination is lower in - memory than the source, we'll assume bcopy can handle that. */ - if (to < from || from + size <= to) - bcopy (from, to, size); - - /* Otherwise, we'll copy from the end. */ - else - { - register const char *endf = from + size; - register char *endt = to + size; - - /* If TO - FROM is large, then we should break the copy into - nonoverlapping chunks of TO - FROM bytes each. However, if - TO - FROM is small, then the bcopy function call overhead - makes this not worth it. The crossover point could be about - anywhere. Since I don't think the obvious copy loop is too - bad, I'm trying to err in its favor. */ - if (to - from < 64) - { - do - *--endt = *--endf; - while (endf != from); - } - else - { - for (;;) - { - endt -= (to - from); - endf -= (to - from); - - if (endt < to) - break; - - bcopy (endf, endt, to - from); - } - - /* If SIZE wasn't a multiple of TO - FROM, there will be a - little left over. The amount left over is (endt + (to - - from)) - to, which is endt - from. */ - bcopy (from, to, endt - from); - } - } + abort (); } - - +#endif /*********************************************************************** Glyph Matrices @@ -510,7 +463,7 @@ /* Allocate and clear. */ result = (struct glyph_matrix *) xmalloc (sizeof *result); - bzero (result, sizeof *result); + memset (result, 0, sizeof *result); /* Increment number of allocated matrices. This count is used to detect memory leaks. */ @@ -655,8 +608,8 @@ int size = dim.height * sizeof (struct glyph_row); new_rows = dim.height - matrix->rows_allocated; matrix->rows = (struct glyph_row *) xrealloc (matrix->rows, size); - bzero (matrix->rows + matrix->rows_allocated, - new_rows * sizeof *matrix->rows); + memset (matrix->rows + matrix->rows_allocated, 0, + new_rows * sizeof *matrix->rows); matrix->rows_allocated = dim.height; } else @@ -1103,7 +1056,7 @@ returned by xmalloc. If flickering happens again, activate the code below. If the flickering is gone with that, chances are that the flickering has the same reason as here. */ - bzero (p[0], (char *) p[LAST_AREA] - (char *) p[0]); + memset (p[0], 0, (char *) p[LAST_AREA] - (char *) p[0]); #endif } @@ -1237,13 +1190,13 @@ struct glyph *pointers[1 + LAST_AREA]; /* Save glyph pointers of TO. */ - bcopy (to->glyphs, pointers, sizeof to->glyphs); + memcpy (pointers, to->glyphs, sizeof to->glyphs); /* Do a structure assignment. */ *to = *from; /* Restore original pointers of TO. */ - bcopy (pointers, to->glyphs, sizeof to->glyphs); + memcpy (to->glyphs, pointers, sizeof to->glyphs); } @@ -1264,8 +1217,8 @@ /* Copy glyphs from FROM to TO. */ for (area = 0; area < LAST_AREA; ++area) if (from->used[area]) - bcopy (from->glyphs[area], to->glyphs[area], - from->used[area] * sizeof (struct glyph)); + memcpy (to->glyphs[area], from->glyphs[area], + from->used[area] * sizeof (struct glyph)); /* Increment buffer positions in TO by DELTA. */ increment_row_positions (to, delta, delta_bytes); @@ -1524,7 +1477,7 @@ /* Allocate a new glyph_pool and clear it. */ result = (struct glyph_pool *) xmalloc (sizeof *result); - bzero (result, sizeof *result); + memset (result, 0, sizeof *result); /* For memory leak and double deletion checking. */ ++glyph_pool_count; @@ -1585,7 +1538,7 @@ else { pool->glyphs = (struct glyph *) xmalloc (size); - bzero (pool->glyphs, size); + memset (pool->glyphs, 0, size); } pool->nglyphs = needed; @@ -2196,11 +2149,11 @@ struct glyph_matrix *saved; saved = (struct glyph_matrix *) xmalloc (sizeof *saved); - bzero (saved, sizeof *saved); + memset (saved, 0, sizeof *saved); saved->nrows = f->current_matrix->nrows; saved->rows = (struct glyph_row *) xmalloc (saved->nrows * sizeof *saved->rows); - bzero (saved->rows, saved->nrows * sizeof *saved->rows); + memset (saved->rows, 0, saved->nrows * sizeof *saved->rows); for (i = 0; i < saved->nrows; ++i) { @@ -2208,7 +2161,7 @@ struct glyph_row *to = saved->rows + i; size_t nbytes = from->used[TEXT_AREA] * sizeof (struct glyph); to->glyphs[TEXT_AREA] = (struct glyph *) xmalloc (nbytes); - bcopy (from->glyphs[TEXT_AREA], to->glyphs[TEXT_AREA], nbytes); + memcpy (to->glyphs[TEXT_AREA], from->glyphs[TEXT_AREA], nbytes); to->used[TEXT_AREA] = from->used[TEXT_AREA]; } @@ -2229,7 +2182,7 @@ struct glyph_row *from = saved->rows + i; struct glyph_row *to = f->current_matrix->rows + i; size_t nbytes = from->used[TEXT_AREA] * sizeof (struct glyph); - bcopy (from->glyphs[TEXT_AREA], to->glyphs[TEXT_AREA], nbytes); + memcpy (to->glyphs[TEXT_AREA], from->glyphs[TEXT_AREA], nbytes); to->used[TEXT_AREA] = from->used[TEXT_AREA]; xfree (from->glyphs[TEXT_AREA]); } @@ -2740,9 +2693,9 @@ if (current_row_p) { /* Copy window row to frame row. */ - bcopy (window_row->glyphs[0], - frame_row->glyphs[TEXT_AREA] + window_matrix->matrix_x, - window_matrix->matrix_w * sizeof (struct glyph)); + memcpy (frame_row->glyphs[TEXT_AREA] + window_matrix->matrix_x, + window_row->glyphs[0], + window_matrix->matrix_w * sizeof (struct glyph)); } else { @@ -2979,7 +2932,7 @@ /* Make a copy of the original rows. */ old_rows = (struct glyph_row *) alloca (nlines * sizeof *old_rows); - bcopy (new_rows, old_rows, nlines * sizeof *old_rows); + memcpy (old_rows, new_rows, nlines * sizeof *old_rows); /* Assign new rows, maybe clear lines. */ for (i = 0; i < nlines; ++i) @@ -3097,7 +3050,7 @@ /* Make a copy of the original rows of matrix m. */ old_rows = (struct glyph_row *) alloca (m->nrows * sizeof *old_rows); - bcopy (m->rows, old_rows, m->nrows * sizeof *old_rows); + memcpy (old_rows, m->rows, m->nrows * sizeof *old_rows); for (i = 0; i < nlines; ++i) { @@ -3291,8 +3244,7 @@ DEFUN ("redraw-frame", Fredraw_frame, Sredraw_frame, 1, 1, 0, doc: /* Clear frame FRAME and output again what is supposed to appear on it. */) - (frame) - Lisp_Object frame; + (Lisp_Object frame) { struct frame *f; @@ -3339,7 +3291,7 @@ DEFUN ("redraw-display", Fredraw_display, Sredraw_display, 0, 0, "", doc: /* Clear and redisplay all visible frames. */) - () + (void) { Lisp_Object tail, frame; @@ -4563,7 +4515,7 @@ row_table_size = next_almost_prime (3 * n); nbytes = row_table_size * sizeof *row_table; row_table = (struct row_entry **) xrealloc (row_table, nbytes); - bzero (row_table, nbytes); + memset (row_table, 0, nbytes); } if (n > row_entry_pool_size) @@ -5902,8 +5854,7 @@ 1, 1, "FOpen termscript file: ", doc: /* Start writing all terminal output to FILE as well as the terminal. FILE = nil means just close any termscript file currently open. */) - (file) - Lisp_Object file; + (Lisp_Object file) { struct tty_display_info *tty; @@ -5941,9 +5892,7 @@ It may be a terminal object, a frame, or nil for the terminal used by the currently selected frame. In batch mode, STRING is sent to stdout when TERMINAL is nil. */) - (string, terminal) - Lisp_Object string; - Lisp_Object terminal; + (Lisp_Object string, Lisp_Object terminal) { struct terminal *t = get_terminal (terminal, 1); FILE *out; @@ -5984,8 +5933,7 @@ doc: /* Beep, or flash the screen. Also, unless an argument is given, terminate any keyboard macro currently executing. */) - (arg) - Lisp_Object arg; + (Lisp_Object arg) { if (!NILP (arg)) { @@ -6024,8 +5972,7 @@ additional wait period, in milliseconds; this may be useful if your Emacs was built without floating point support. \(Not all operating systems support waiting for a fraction of a second.) */) - (seconds, milliseconds) - Lisp_Object seconds, milliseconds; + (Lisp_Object seconds, Lisp_Object milliseconds) { int sec, usec; @@ -6129,8 +6076,7 @@ If optional arg FORCE is non-nil or `redisplay-dont-pause' is non-nil, perform a full redisplay even if input is available. Return t if redisplay was performed, nil otherwise. */) - (force) - Lisp_Object force; + (Lisp_Object force) { int count; @@ -6174,8 +6120,7 @@ If VARIABLE is nil, an internal variable is used. Users should not pass nil for VARIABLE. */) - (variable) - Lisp_Object variable; + (Lisp_Object variable) { Lisp_Object state, tail, frame, buf; Lisp_Object *vecp, *end; @@ -6501,8 +6446,7 @@ WINDOW nil means use the selected window. SHOW non-nil means show a cursor in WINDOW in the next redisplay. SHOW nil means don't show a cursor. */) - (window, show) - Lisp_Object window, show; + (Lisp_Object window, Lisp_Object show) { /* Don't change cursor state while redisplaying. This could confuse output routines. */ @@ -6524,8 +6468,7 @@ Sinternal_show_cursor_p, 0, 1, 0, doc: /* Value is non-nil if next redisplay will display a cursor in WINDOW. WINDOW nil or omitted means report on the selected window. */) - (window) - Lisp_Object window; + (Lisp_Object window) { struct window *w; @@ -6541,7 +6484,7 @@ DEFUN ("last-nonminibuffer-frame", Flast_nonminibuf_frame, Slast_nonminibuf_frame, 0, 0, 0, doc: /* Value is last nonminibuffer frame. */) - () + (void) { Lisp_Object frame = Qnil;
--- a/src/doc.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/doc.c Thu Jul 08 22:47:34 2010 +0000 @@ -341,8 +341,7 @@ doc: /* Return the documentation string of FUNCTION. Unless a non-nil second argument RAW is given, the string is passed through `substitute-command-keys'. */) - (function, raw) - Lisp_Object function, raw; + (Lisp_Object function, Lisp_Object raw) { Lisp_Object fun; Lisp_Object funcar; @@ -469,8 +468,7 @@ This differs from `get' in that it can refer to strings stored in the `etc/DOC' file; and that it evaluates documentation properties that aren't strings. */) - (symbol, prop, raw) - Lisp_Object symbol, prop, raw; + (Lisp_Object symbol, Lisp_Object prop, Lisp_Object raw) { int try_reload = 1; Lisp_Object tem; @@ -558,8 +556,7 @@ it specifies the file name (without a directory) of the DOC file. That file is found in `../etc' now; later, when the dumped Emacs is run, the same file name is found in the `doc-directory'. */) - (filename) - Lisp_Object filename; + (Lisp_Object filename) { int fd; char buf[1024 + 1]; @@ -686,7 +683,7 @@ } pos += end - buf; filled -= end - buf; - bcopy (end, buf, filled); + memcpy (buf, end, filled); } emacs_close (fd); return Qnil; @@ -707,8 +704,7 @@ Returns original STRING if no substitutions were made. Otherwise, a new string, without any text properties, is returned. */) - (string) - Lisp_Object string; + (Lisp_Object string) { unsigned char *buf; int changed = 0; @@ -765,7 +761,7 @@ if (len == 1) *bufp = *strp; else - bcopy (strp, bufp, len); + memcpy (bufp, strp, len); strp += len; bufp += len; nchars++; @@ -817,7 +813,7 @@ int offset = bufp - buf; buf = (unsigned char *) xrealloc (buf, bsize += 4); bufp = buf + offset; - bcopy ("M-x ", bufp, 4); + memcpy (bufp, "M-x ", 4); bufp += 4; nchars += 4; if (multibyte) @@ -911,7 +907,7 @@ int offset = bufp - buf; buf = (unsigned char *) xrealloc (buf, bsize += length_byte); bufp = buf + offset; - bcopy (start, bufp, length_byte); + memcpy (bufp, start, length_byte); bufp += length_byte; nchars += length; /* Check STRING again in case gc relocated it. */ @@ -928,7 +924,7 @@ if (len == 1) *bufp = *strp; else - bcopy (strp, bufp, len); + memcpy (bufp, strp, len); strp += len; bufp += len; nchars++;
--- a/src/doprnt.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/doprnt.c Thu Jul 08 22:47:34 2010 +0000 @@ -229,12 +229,12 @@ /* Truncate the string at character boundary. */ tem = bufsize; while (!CHAR_HEAD_P (string[tem - 1])) tem--; - bcopy (string, bufptr, tem); + memcpy (bufptr, string, tem); /* We must calculate WIDTH again. */ width = strwidth (bufptr, tem); } else - bcopy (string, bufptr, tem); + memcpy (bufptr, string, tem); bufptr += tem; bufsize -= tem; if (minlen < 0)
--- a/src/dosfns.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/dosfns.c Thu Jul 08 22:47:34 2010 +0000 @@ -55,8 +55,7 @@ INTERRUPT should be an integer in the range 0 to 255. REGISTERS should be a vector produced by `make-register' and `set-register-value'. */) - (interrupt, registers) - Lisp_Object interrupt, registers; + (Lisp_Object interrupt, Lisp_Object registers) { register int i; int no; @@ -97,8 +96,7 @@ DEFUN ("msdos-memget", Fdos_memget, Sdos_memget, 2, 2, 0, doc: /* Read DOS memory at offset ADDRESS into VECTOR. Return the updated VECTOR. */) - (address, vector) - Lisp_Object address, vector; + (Lisp_Object address, Lisp_Object vector) { register int i; int offs, len; @@ -122,8 +120,7 @@ DEFUN ("msdos-memput", Fdos_memput, Sdos_memput, 2, 2, 0, doc: /* Write DOS memory at offset ADDRESS from VECTOR. */) - (address, vector) - Lisp_Object address, vector; + (Lisp_Object address, Lisp_Object vector) { register int i; int offs, len; @@ -153,8 +150,7 @@ If the optional argument ALLKEYS is non-nil, the keyboard is mapped for all keys; otherwise it is only used when the ALT key is pressed. The current keyboard layout is available in dos-keyboard-code. */) - (country_code, allkeys) - Lisp_Object country_code, allkeys; + (Lisp_Object country_code, Lisp_Object allkeys) { CHECK_NUMBER (country_code); if (!dos_set_keyboard (XINT (country_code), !NILP (allkeys))) @@ -168,7 +164,7 @@ DEFUN ("msdos-mouse-p", Fmsdos_mouse_p, Smsdos_mouse_p, 0, 0, 0, doc: /* Report whether a mouse is present. */) - () + (void) { if (have_mouse) return Qt; @@ -179,7 +175,7 @@ DEFUN ("msdos-mouse-init", Fmsdos_mouse_init, Smsdos_mouse_init, 0, 0, "", doc: /* Initialize and enable mouse if available. */) - () + (void) { if (have_mouse) { @@ -192,7 +188,7 @@ DEFUN ("msdos-mouse-enable", Fmsdos_mouse_enable, Smsdos_mouse_enable, 0, 0, "", doc: /* Enable mouse if available. */) - () + (void) { if (have_mouse) { @@ -204,7 +200,7 @@ DEFUN ("msdos-mouse-disable", Fmsdos_mouse_disable, Smsdos_mouse_disable, 0, 0, "", doc: /* Disable mouse if available. */) - () + (void) { mouse_off (); if (have_mouse) have_mouse = -1; @@ -214,7 +210,7 @@ DEFUN ("insert-startup-screen", Finsert_startup_screen, Sinsert_startup_screen, 0, 0, "", doc: /* Insert copy of screen contents prior to starting Emacs. Return nil if startup screen is not available. */) - () + (void) { char *s; int rows, cols, i, j; @@ -509,8 +505,7 @@ storage of the file system, FREE is the free storage, and AVAIL is the storage available to a non-superuser. All 3 numbers are in bytes. If the underlying system call fails, value is nil. */) - (filename) - Lisp_Object filename; + (Lisp_Object filename) { struct statfs stfs; Lisp_Object encoded, value;
--- a/src/editfns.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/editfns.c Thu Jul 08 22:47:34 2010 +0000 @@ -209,8 +209,7 @@ DEFUN ("char-to-string", Fchar_to_string, Schar_to_string, 1, 1, 0, doc: /* Convert arg CHAR to a string containing that character. usage: (char-to-string CHAR) */) - (character) - Lisp_Object character; + (Lisp_Object character) { int len; unsigned char str[MAX_MULTIBYTE_LENGTH]; @@ -223,8 +222,7 @@ DEFUN ("byte-to-string", Fbyte_to_string, Sbyte_to_string, 1, 1, 0, doc: /* Convert arg BYTE to a string containing that byte. */) - (byte) - Lisp_Object byte; + (Lisp_Object byte) { unsigned char b; CHECK_NUMBER (byte); @@ -235,8 +233,7 @@ DEFUN ("string-to-char", Fstring_to_char, Sstring_to_char, 1, 1, 0, doc: /* Convert arg STRING to a character, the first character of that string. A multibyte character is handled correctly. */) - (string) - register Lisp_Object string; + (register Lisp_Object string) { register Lisp_Object val; CHECK_STRING (string); @@ -264,7 +261,7 @@ DEFUN ("point", Fpoint, Spoint, 0, 0, 0, doc: /* Return value of point, as an integer. Beginning of buffer is position (point-min). */) - () + (void) { Lisp_Object temp; XSETFASTINT (temp, PT); @@ -273,7 +270,7 @@ DEFUN ("point-marker", Fpoint_marker, Spoint_marker, 0, 0, 0, doc: /* Return value of point, as a marker object. */) - () + (void) { return buildmark (PT, PT_BYTE); } @@ -294,8 +291,7 @@ Beginning of buffer is position (point-min), end is (point-max). The return value is POSITION. */) - (position) - register Lisp_Object position; + (register Lisp_Object position) { int pos; @@ -347,14 +343,14 @@ DEFUN ("region-beginning", Fregion_beginning, Sregion_beginning, 0, 0, 0, doc: /* Return position of beginning of region, as an integer. */) - () + (void) { return region_limit (1); } DEFUN ("region-end", Fregion_end, Sregion_end, 0, 0, 0, doc: /* Return position of end of region, as an integer. */) - () + (void) { return region_limit (0); } @@ -363,7 +359,7 @@ doc: /* Return this buffer's mark, as a marker object. Watch out! Moving this marker changes the mark position. If you set the marker not to point anywhere, the buffer will have no mark. */) - () + (void) { return current_buffer->mark; } @@ -639,8 +635,7 @@ doc: /* Delete the field surrounding POS. A field is a region of text with the same `field' property. If POS is nil, the value of point is used for POS. */) - (pos) - Lisp_Object pos; + (Lisp_Object pos) { int beg, end; find_field (pos, Qnil, Qnil, &beg, Qnil, &end); @@ -653,8 +648,7 @@ doc: /* Return the contents of the field surrounding POS as a string. A field is a region of text with the same `field' property. If POS is nil, the value of point is used for POS. */) - (pos) - Lisp_Object pos; + (Lisp_Object pos) { int beg, end; find_field (pos, Qnil, Qnil, &beg, Qnil, &end); @@ -665,8 +659,7 @@ doc: /* Return the contents of the field around POS, without text properties. A field is a region of text with the same `field' property. If POS is nil, the value of point is used for POS. */) - (pos) - Lisp_Object pos; + (Lisp_Object pos) { int beg, end; find_field (pos, Qnil, Qnil, &beg, Qnil, &end); @@ -681,8 +674,7 @@ field, then the beginning of the *previous* field is returned. If LIMIT is non-nil, it is a buffer position; if the beginning of the field is before LIMIT, then LIMIT will be returned instead. */) - (pos, escape_from_edge, limit) - Lisp_Object pos, escape_from_edge, limit; + (Lisp_Object pos, Lisp_Object escape_from_edge, Lisp_Object limit) { int beg; find_field (pos, escape_from_edge, limit, &beg, Qnil, 0); @@ -697,8 +689,7 @@ then the end of the *following* field is returned. If LIMIT is non-nil, it is a buffer position; if the end of the field is after LIMIT, then LIMIT will be returned instead. */) - (pos, escape_from_edge, limit) - Lisp_Object pos, escape_from_edge, limit; + (Lisp_Object pos, Lisp_Object escape_from_edge, Lisp_Object limit) { int end; find_field (pos, escape_from_edge, Qnil, 0, limit, &end); @@ -732,9 +723,7 @@ a non-nil property of that name, then any field boundaries are ignored. Field boundaries are not noticed if `inhibit-field-text-motion' is non-nil. */) - (new_pos, old_pos, escape_from_edge, only_in_line, inhibit_capture_property) - Lisp_Object new_pos, old_pos; - Lisp_Object escape_from_edge, only_in_line, inhibit_capture_property; + (Lisp_Object new_pos, Lisp_Object old_pos, Lisp_Object escape_from_edge, Lisp_Object only_in_line, Lisp_Object inhibit_capture_property) { /* If non-zero, then the original point, before re-positioning. */ int orig_point = 0; @@ -829,8 +818,7 @@ boundaries bind `inhibit-field-text-motion' to t. This function does not move point. */) - (n) - Lisp_Object n; + (Lisp_Object n) { int orig, orig_byte, end; int count = SPECPDL_INDEX (); @@ -868,8 +856,7 @@ boundaries bind `inhibit-field-text-motion' to t. This function does not move point. */) - (n) - Lisp_Object n; + (Lisp_Object n) { int end_pos; int orig = PT; @@ -1000,8 +987,7 @@ then just use `save-current-buffer', or even `with-current-buffer'. usage: (save-excursion &rest BODY) */) - (args) - Lisp_Object args; + (Lisp_Object args) { register Lisp_Object val; int count = SPECPDL_INDEX (); @@ -1016,8 +1002,7 @@ doc: /* Save the current buffer; execute BODY; restore the current buffer. Executes BODY just like `progn'. usage: (save-current-buffer &rest BODY) */) - (args) - Lisp_Object args; + (Lisp_Object args) { Lisp_Object val; int count = SPECPDL_INDEX (); @@ -1031,8 +1016,7 @@ DEFUN ("buffer-size", Fbufsize, Sbufsize, 0, 1, 0, doc: /* Return the number of characters in the current buffer. If BUFFER, return the number of characters in that buffer instead. */) - (buffer) - Lisp_Object buffer; + (Lisp_Object buffer) { if (NILP (buffer)) return make_number (Z - BEG); @@ -1047,7 +1031,7 @@ DEFUN ("point-min", Fpoint_min, Spoint_min, 0, 0, 0, doc: /* Return the minimum permissible value of point in the current buffer. This is 1, unless narrowing (a buffer restriction) is in effect. */) - () + (void) { Lisp_Object temp; XSETFASTINT (temp, BEGV); @@ -1057,7 +1041,7 @@ DEFUN ("point-min-marker", Fpoint_min_marker, Spoint_min_marker, 0, 0, 0, doc: /* Return a marker to the minimum permissible value of point in this buffer. This is the beginning, unless narrowing (a buffer restriction) is in effect. */) - () + (void) { return buildmark (BEGV, BEGV_BYTE); } @@ -1066,7 +1050,7 @@ doc: /* Return the maximum permissible value of point in the current buffer. This is (1+ (buffer-size)), unless narrowing (a buffer restriction) is in effect, in which case it is less. */) - () + (void) { Lisp_Object temp; XSETFASTINT (temp, ZV); @@ -1077,7 +1061,7 @@ doc: /* Return a marker to the maximum permissible value of point in this buffer. This is (1+ (buffer-size)), unless narrowing (a buffer restriction) is in effect, in which case it is less. */) - () + (void) { return buildmark (ZV, ZV_BYTE); } @@ -1085,7 +1069,7 @@ DEFUN ("gap-position", Fgap_position, Sgap_position, 0, 0, 0, doc: /* Return the position of the gap, in the current buffer. See also `gap-size'. */) - () + (void) { Lisp_Object temp; XSETFASTINT (temp, GPT); @@ -1095,7 +1079,7 @@ DEFUN ("gap-size", Fgap_size, Sgap_size, 0, 0, 0, doc: /* Return the size of the current buffer's gap. See also `gap-position'. */) - () + (void) { Lisp_Object temp; XSETFASTINT (temp, GAP_SIZE); @@ -1105,8 +1089,7 @@ DEFUN ("position-bytes", Fposition_bytes, Sposition_bytes, 1, 1, 0, doc: /* Return the byte position for character position POSITION. If POSITION is out of range, the value is nil. */) - (position) - Lisp_Object position; + (Lisp_Object position) { CHECK_NUMBER_COERCE_MARKER (position); if (XINT (position) < BEG || XINT (position) > Z) @@ -1117,8 +1100,7 @@ DEFUN ("byte-to-position", Fbyte_to_position, Sbyte_to_position, 1, 1, 0, doc: /* Return the character position for byte position BYTEPOS. If BYTEPOS is out of range, the value is nil. */) - (bytepos) - Lisp_Object bytepos; + (Lisp_Object bytepos) { CHECK_NUMBER (bytepos); if (XINT (bytepos) < BEG_BYTE || XINT (bytepos) > Z_BYTE) @@ -1129,7 +1111,7 @@ DEFUN ("following-char", Ffollowing_char, Sfollowing_char, 0, 0, 0, doc: /* Return the character following point, as a number. At the end of the buffer or accessible region, return 0. */) - () + (void) { Lisp_Object temp; if (PT >= ZV) @@ -1142,7 +1124,7 @@ DEFUN ("preceding-char", Fprevious_char, Sprevious_char, 0, 0, 0, doc: /* Return the character preceding point, as a number. At the beginning of the buffer or accessible region, return 0. */) - () + (void) { Lisp_Object temp; if (PT <= BEGV) @@ -1161,7 +1143,7 @@ DEFUN ("bobp", Fbobp, Sbobp, 0, 0, 0, doc: /* Return t if point is at the beginning of the buffer. If the buffer is narrowed, this means the beginning of the narrowed part. */) - () + (void) { if (PT == BEGV) return Qt; @@ -1171,7 +1153,7 @@ DEFUN ("eobp", Feobp, Seobp, 0, 0, 0, doc: /* Return t if point is at the end of the buffer. If the buffer is narrowed, this means the end of the narrowed part. */) - () + (void) { if (PT == ZV) return Qt; @@ -1180,7 +1162,7 @@ DEFUN ("bolp", Fbolp, Sbolp, 0, 0, 0, doc: /* Return t if point is at the beginning of a line. */) - () + (void) { if (PT == BEGV || FETCH_BYTE (PT_BYTE - 1) == '\n') return Qt; @@ -1190,7 +1172,7 @@ DEFUN ("eolp", Feolp, Seolp, 0, 0, 0, doc: /* Return t if point is at the end of a line. `End of a line' includes point being at the end of the buffer. */) - () + (void) { if (PT == ZV || FETCH_BYTE (PT_BYTE) == '\n') return Qt; @@ -1201,8 +1183,7 @@ doc: /* Return character in current buffer at position POS. POS is an integer or a marker and defaults to point. If POS is out of range, the value is nil. */) - (pos) - Lisp_Object pos; + (Lisp_Object pos) { register int pos_byte; @@ -1234,8 +1215,7 @@ doc: /* Return character in current buffer preceding position POS. POS is an integer or a marker and defaults to point. If POS is out of range, the value is nil. */) - (pos) - Lisp_Object pos; + (Lisp_Object pos) { register Lisp_Object val; register int pos_byte; @@ -1284,8 +1264,7 @@ If optional argument UID is an integer or a float, return the login name of the user with that uid, or nil if there is no such user. */) - (uid) - Lisp_Object uid; + (Lisp_Object uid) { struct passwd *pw; uid_t id; @@ -1311,7 +1290,7 @@ doc: /* Return the name of the user's real uid, as a string. This ignores the environment variables LOGNAME and USER, so it differs from `user-login-name' when running under `su'. */) - () + (void) { /* Set up the user name info if we didn't do it before. (That can happen if Emacs is dumpable @@ -1324,7 +1303,7 @@ DEFUN ("user-uid", Fuser_uid, Suser_uid, 0, 0, 0, doc: /* Return the effective uid of Emacs. Value is an integer or a float, depending on the value. */) - () + (void) { /* Assignment to EMACS_INT stops GCC whining about limited range of data type. */ @@ -1340,7 +1319,7 @@ DEFUN ("user-real-uid", Fuser_real_uid, Suser_real_uid, 0, 0, 0, doc: /* Return the real uid of Emacs. Value is an integer or a float, depending on the value. */) - () + (void) { /* Assignment to EMACS_INT stops GCC whining about limited range of data type. */ @@ -1362,8 +1341,7 @@ of the user with that uid, or nil if there is no such user. If UID is a string, return the full name of the user with that login name, or nil if there is no such user. */) - (uid) - Lisp_Object uid; + (Lisp_Object uid) { struct passwd *pw; register unsigned char *p, *q; @@ -1405,7 +1383,7 @@ login = Fuser_login_name (make_number (pw->pw_uid)); r = (unsigned char *) alloca (strlen (p) + SCHARS (login) + 1); - bcopy (p, r, q - p); + memcpy (r, p, q - p); r[q - p] = 0; strcat (r, SDATA (login)); r[q - p] = UPCASE (r[q - p]); @@ -1419,7 +1397,7 @@ DEFUN ("system-name", Fsystem_name, Ssystem_name, 0, 0, 0, doc: /* Return the host name of the machine you are running on, as a string. */) - () + (void) { return Vsystem_name; } @@ -1446,7 +1424,7 @@ DEFUN ("emacs-pid", Femacs_pid, Semacs_pid, 0, 0, 0, doc: /* Return the process ID of Emacs, as an integer. */) - () + (void) { return make_number (getpid ()); } @@ -1460,7 +1438,7 @@ The microsecond count is zero on systems that do not provide resolution finer than a second. */) - () + (void) { EMACS_TIME t; @@ -1481,7 +1459,7 @@ On systems that can't determine the run time, `get-internal-run-time' does the same thing as `current-time'. The microsecond count is zero on systems that do not provide resolution finer than a second. */) - () + (void) { #ifdef HAVE_GETRUSAGE struct rusage usage; @@ -1572,8 +1550,7 @@ WARNING: Since the result is floating point, it may not be exact. If precise time stamps are required, use either `current-time', or (if you need time as a string) `format-time-string'. */) - (specified_time) - Lisp_Object specified_time; + (Lisp_Object specified_time) { time_t sec; int usec; @@ -1683,8 +1660,7 @@ %OX is like %X, but uses the locale's number symbols. For example, to produce full ISO 8601 format, use "%Y-%m-%dT%T%z". */) - (format_string, time, universal) - Lisp_Object format_string, time, universal; + (Lisp_Object format_string, Lisp_Object time, Lisp_Object universal) { time_t value; int size; @@ -1751,8 +1727,7 @@ otherwise nil. ZONE is an integer indicating the number of seconds east of Greenwich. (Note that Common Lisp has different meanings for DOW and ZONE.) */) - (specified_time) - Lisp_Object specified_time; + (Lisp_Object specified_time) { time_t time_spec; struct tm save_tm; @@ -1812,9 +1787,7 @@ year values as low as 1901 do work. usage: (encode-time SECOND MINUTE HOUR DAY MONTH YEAR &optional ZONE) */) - (nargs, args) - int nargs; - register Lisp_Object *args; + (int nargs, register Lisp_Object *args) { time_t time; struct tm tm; @@ -1900,8 +1873,7 @@ Thus, you can use times obtained from `current-time' and from `file-attributes'. SPECIFIED-TIME can also have the form (HIGH . LOW), but this is considered obsolete. */) - (specified_time) - Lisp_Object specified_time; + (Lisp_Object specified_time) { time_t value; struct tm *tm; @@ -1963,8 +1935,7 @@ Some operating systems cannot provide all this information to Emacs; in this case, `current-time-zone' returns a list containing nil for the data it can't find. */) - (specified_time) - Lisp_Object specified_time; + (Lisp_Object specified_time) { time_t value; struct tm *t; @@ -2028,8 +1999,7 @@ doc: /* Set the local time zone using TZ, a string specifying a time zone rule. If TZ is nil, use implementation-defined default time zone information. If TZ is t, use Universal Time. */) - (tz) - Lisp_Object tz; + (Lisp_Object tz) { char *tzstring; @@ -2225,9 +2195,7 @@ and insert the result. usage: (insert &rest ARGS) */) - (nargs, args) - int nargs; - register Lisp_Object *args; + (int nargs, register Lisp_Object *args) { general_insert_function (insert, insert_from_string, 0, nargs, args); return Qnil; @@ -2246,9 +2214,7 @@ to unibyte for insertion. usage: (insert-and-inherit &rest ARGS) */) - (nargs, args) - int nargs; - register Lisp_Object *args; + (int nargs, register Lisp_Object *args) { general_insert_function (insert_and_inherit, insert_from_string, 1, nargs, args); @@ -2265,9 +2231,7 @@ to unibyte for insertion. usage: (insert-before-markers &rest ARGS) */) - (nargs, args) - int nargs; - register Lisp_Object *args; + (int nargs, register Lisp_Object *args) { general_insert_function (insert_before_markers, insert_from_string_before_markers, 0, @@ -2286,9 +2250,7 @@ to unibyte for insertion. usage: (insert-before-markers-and-inherit &rest ARGS) */) - (nargs, args) - int nargs; - register Lisp_Object *args; + (int nargs, register Lisp_Object *args) { general_insert_function (insert_before_markers_and_inherit, insert_from_string_before_markers, 1, @@ -2301,8 +2263,7 @@ Point, and before-insertion markers, are relocated as in the function `insert'. The optional third arg INHERIT, if non-nil, says to inherit text properties from adjoining text, if those properties are sticky. */) - (character, count, inherit) - Lisp_Object character, count, inherit; + (Lisp_Object character, Lisp_Object count, Lisp_Object inherit) { register unsigned char *string; register int strlen; @@ -2354,8 +2315,7 @@ Point, and before-insertion markers, are relocated as in the function `insert'. The optional third arg INHERIT, if non-nil, says to inherit text properties from adjoining text, if those properties are sticky. */) - (byte, count, inherit) - Lisp_Object byte, count, inherit; + (Lisp_Object byte, Lisp_Object count, Lisp_Object inherit) { CHECK_NUMBER (byte); if (XINT (byte) < 0 || XINT (byte) > 255) @@ -2418,8 +2378,7 @@ result = make_uninit_multibyte_string (end - start, end_byte - start_byte); else result = make_uninit_string (end - start); - bcopy (BYTE_POS_ADDR (start_byte), SDATA (result), - end_byte - start_byte); + memcpy (SDATA (result), BYTE_POS_ADDR (start_byte), end_byte - start_byte); /* If desired, update and copy the text properties. */ if (props) @@ -2478,8 +2437,7 @@ This function copies the text properties of that part of the buffer into the result string; if you don't want the text properties, use `buffer-substring-no-properties' instead. */) - (start, end) - Lisp_Object start, end; + (Lisp_Object start, Lisp_Object end) { register int b, e; @@ -2495,8 +2453,7 @@ doc: /* Return the characters of part of the buffer, without the text properties. The two arguments START and END are character positions; they can be in either order. */) - (start, end) - Lisp_Object start, end; + (Lisp_Object start, Lisp_Object end) { register int b, e; @@ -2511,7 +2468,7 @@ doc: /* Return the contents of the current buffer as a string. If narrowing is in effect, this function returns only the visible part of the buffer. */) - () + (void) { return make_buffer_string (BEGV, ZV, 1); } @@ -2522,8 +2479,7 @@ BUFFER may be a buffer or a buffer name. Arguments START and END are character positions specifying the substring. They default to the values of (point-min) and (point-max) in BUFFER. */) - (buffer, start, end) - Lisp_Object buffer, start, end; + (Lisp_Object buffer, Lisp_Object start, Lisp_Object end) { register int b, e, temp; register struct buffer *bp, *obuf; @@ -2576,8 +2532,7 @@ The value of `case-fold-search' in the current buffer determines whether case is significant or ignored. */) - (buffer1, start1, end1, buffer2, start2, end2) - Lisp_Object buffer1, start1, end1, buffer2, start2, end2; + (Lisp_Object buffer1, Lisp_Object start1, Lisp_Object end1, Lisp_Object buffer2, Lisp_Object start2, Lisp_Object end2) { register int begp1, endp1, begp2, endp2, temp; register struct buffer *bp1, *bp2; @@ -2744,8 +2699,7 @@ If optional arg NOUNDO is non-nil, don't record this change for undo and don't mark the buffer as really changed. Both characters must have the same length of multi-byte form. */) - (start, end, fromchar, tochar, noundo) - Lisp_Object start, end, fromchar, tochar, noundo; + (Lisp_Object start, Lisp_Object end, Lisp_Object fromchar, Lisp_Object tochar, Lisp_Object noundo) { register int pos, pos_byte, stop, i, len, end_byte; /* Keep track of the first change in the buffer: @@ -2986,10 +2940,7 @@ TABLE is a string or a char-table; the Nth character in it is the mapping for the character with code N. It returns the number of characters changed. */) - (start, end, table) - Lisp_Object start; - Lisp_Object end; - register Lisp_Object table; + (Lisp_Object start, Lisp_Object end, register Lisp_Object table) { register unsigned char *tt; /* Trans table. */ register int nc; /* New character. */ @@ -3155,8 +3106,7 @@ When called from a program, expects two arguments, positions (integers or markers) specifying the stretch to be deleted. */) - (start, end) - Lisp_Object start, end; + (Lisp_Object start, Lisp_Object end) { validate_region (&start, &end); del_range (XINT (start), XINT (end)); @@ -3166,8 +3116,7 @@ DEFUN ("delete-and-extract-region", Fdelete_and_extract_region, Sdelete_and_extract_region, 2, 2, 0, doc: /* Delete the text between START and END and return it. */) - (start, end) - Lisp_Object start, end; + (Lisp_Object start, Lisp_Object end) { validate_region (&start, &end); if (XINT (start) == XINT (end)) @@ -3178,7 +3127,7 @@ DEFUN ("widen", Fwiden, Swiden, 0, 0, "", doc: /* Remove restrictions (narrowing) from current buffer. This allows the buffer's full text to be seen and edited. */) - () + (void) { if (BEG != BEGV || Z != ZV) current_buffer->clip_changed = 1; @@ -3199,8 +3148,7 @@ When calling from a program, pass two arguments; positions (integers or markers) bounding the text that should remain visible. */) - (start, end) - register Lisp_Object start, end; + (register Lisp_Object start, Lisp_Object end) { CHECK_NUMBER_COERCE_MARKER (start); CHECK_NUMBER_COERCE_MARKER (end); @@ -3333,8 +3281,7 @@ (save-excursion (save-restriction ...)) usage: (save-restriction &rest BODY) */) - (body) - Lisp_Object body; + (Lisp_Object body) { register Lisp_Object val; int count = SPECPDL_INDEX (); @@ -3367,9 +3314,7 @@ also `current-message'. usage: (message FORMAT-STRING &rest ARGS) */) - (nargs, args) - int nargs; - Lisp_Object *args; + (int nargs, Lisp_Object *args) { if (NILP (args[0]) || (STRINGP (args[0]) @@ -3397,9 +3342,7 @@ message; let the minibuffer contents show. usage: (message-box FORMAT-STRING &rest ARGS) */) - (nargs, args) - int nargs; - Lisp_Object *args; + (int nargs, Lisp_Object *args) { if (NILP (args[0])) { @@ -3437,7 +3380,7 @@ message_length = SBYTES (val); message_text = (char *)xrealloc (message_text, message_length); } - bcopy (SDATA (val), message_text, SBYTES (val)); + memcpy (message_text, SDATA (val), SBYTES (val)); message2 (message_text, SBYTES (val), STRING_MULTIBYTE (val)); return val; @@ -3459,9 +3402,7 @@ message; let the minibuffer contents show. usage: (message-or-box FORMAT-STRING &rest ARGS) */) - (nargs, args) - int nargs; - Lisp_Object *args; + (int nargs, Lisp_Object *args) { #ifdef HAVE_MENUS if ((NILP (last_nonmenu_event) || CONSP (last_nonmenu_event)) @@ -3473,7 +3414,7 @@ DEFUN ("current-message", Fcurrent_message, Scurrent_message, 0, 0, 0, doc: /* Return the string currently displayed in the echo area, or nil if none. */) - () + (void) { return current_message (); } @@ -3485,9 +3426,7 @@ Remaining arguments form a sequence of PROPERTY VALUE pairs for text properties to add to the result. usage: (propertize STRING &rest PROPERTIES) */) - (nargs, args) - int nargs; - Lisp_Object *args; + (int nargs, Lisp_Object *args) { Lisp_Object properties, string; struct gcpro gcpro1, gcpro2; @@ -3569,9 +3508,7 @@ specifier truncates the string to the given width. usage: (format STRING &rest OBJECTS) */) - (nargs, args) - int nargs; - register Lisp_Object *args; + (int nargs, register Lisp_Object *args) { register int n; /* The number of the next arg to substitute */ register int total; /* An estimate of the final length */ @@ -3654,12 +3591,12 @@ int i; if (!info) info = (struct info *) alloca (nbytes); - bzero (info, nbytes); + memset (info, 0, nbytes); for (i = 0; i <= nargs; i++) info[i].start = -1; if (!discarded) SAFE_ALLOCA (discarded, char *, SBYTES (args[0])); - bzero (discarded, SBYTES (args[0])); + memset (discarded, 0, SBYTES (args[0])); } /* Add to TOTAL enough space to hold the converted arguments. */ @@ -3973,8 +3910,8 @@ { int this_nchars; - bcopy (this_format_start, this_format, - format - this_format_start); + memcpy (this_format, this_format_start, + format - this_format_start); this_format[format - this_format_start] = 0; if (format[-1] == 'e' || format[-1] == 'f' || format[-1] == 'g') @@ -4187,8 +4124,7 @@ doc: /* Return t if two characters match, optionally ignoring case. Both arguments must be characters (i.e. integers). Case is ignored if `case-fold-search' is non-nil in the current buffer. */) - (c1, c2) - register Lisp_Object c1, c2; + (register Lisp_Object c1, Lisp_Object c2) { int i1, i2; /* Check they're chars, not just integers, otherwise we could get array @@ -4314,8 +4250,7 @@ any markers that happen to be located in the regions. Transposing beyond buffer boundaries is an error. */) - (startr1, endr1, startr2, endr2, leave_markers) - Lisp_Object startr1, endr1, startr2, endr2, leave_markers; + (Lisp_Object startr1, Lisp_Object endr1, Lisp_Object startr2, Lisp_Object endr2, Lisp_Object leave_markers) { register EMACS_INT start1, end1, start2, end2; EMACS_INT start1_byte, start2_byte, len1_byte, len2_byte; @@ -4451,9 +4386,9 @@ start1_addr = BYTE_POS_ADDR (start1_byte); start2_addr = BYTE_POS_ADDR (start2_byte); - bcopy (start2_addr, temp, len2_byte); - bcopy (start1_addr, start1_addr + len2_byte, len1_byte); - bcopy (temp, start1_addr, len2_byte); + memcpy (temp, start2_addr, len2_byte); + memcpy (start1_addr + len2_byte, start1_addr, len1_byte); + memcpy (start1_addr, temp, len2_byte); SAFE_FREE (); } else @@ -4464,9 +4399,9 @@ SAFE_ALLOCA (temp, unsigned char *, len1_byte); start1_addr = BYTE_POS_ADDR (start1_byte); start2_addr = BYTE_POS_ADDR (start2_byte); - bcopy (start1_addr, temp, len1_byte); - bcopy (start2_addr, start1_addr, len2_byte); - bcopy (temp, start1_addr + len2_byte, len1_byte); + memcpy (temp, start1_addr, len1_byte); + memcpy (start1_addr, start2_addr, len2_byte); + memcpy (start1_addr + len2_byte, temp, len1_byte); SAFE_FREE (); } graft_intervals_into_buffer (tmp_interval1, start1 + len2, @@ -4504,9 +4439,9 @@ SAFE_ALLOCA (temp, unsigned char *, len1_byte); start1_addr = BYTE_POS_ADDR (start1_byte); start2_addr = BYTE_POS_ADDR (start2_byte); - bcopy (start1_addr, temp, len1_byte); - bcopy (start2_addr, start1_addr, len2_byte); - bcopy (temp, start2_addr, len1_byte); + memcpy (temp, start1_addr, len1_byte); + memcpy (start1_addr, start2_addr, len2_byte); + memcpy (start2_addr, temp, len1_byte); SAFE_FREE (); graft_intervals_into_buffer (tmp_interval1, start2, @@ -4534,10 +4469,10 @@ SAFE_ALLOCA (temp, unsigned char *, len2_byte); start1_addr = BYTE_POS_ADDR (start1_byte); start2_addr = BYTE_POS_ADDR (start2_byte); - bcopy (start2_addr, temp, len2_byte); - bcopy (start1_addr, start1_addr + len_mid + len2_byte, len1_byte); - safe_bcopy (start1_addr + len1_byte, start1_addr + len2_byte, len_mid); - bcopy (temp, start1_addr, len2_byte); + memcpy (temp, start2_addr, len2_byte); + memcpy (start1_addr + len_mid + len2_byte, start1_addr, len1_byte); + memmove (start1_addr + len2_byte, start1_addr + len1_byte, len_mid); + memcpy (start1_addr, temp, len2_byte); SAFE_FREE (); graft_intervals_into_buffer (tmp_interval1, end2 - len1, @@ -4567,10 +4502,10 @@ SAFE_ALLOCA (temp, unsigned char *, len1_byte); start1_addr = BYTE_POS_ADDR (start1_byte); start2_addr = BYTE_POS_ADDR (start2_byte); - bcopy (start1_addr, temp, len1_byte); - bcopy (start2_addr, start1_addr, len2_byte); - bcopy (start1_addr + len1_byte, start1_addr + len2_byte, len_mid); - bcopy (temp, start1_addr + len2_byte + len_mid, len1_byte); + memcpy (temp, start1_addr, len1_byte); + memcpy (start1_addr, start2_addr, len2_byte); + memcpy (start1_addr + len2_byte, start1_addr + len1_byte, len_mid); + memcpy (start1_addr + len2_byte + len_mid, temp, len1_byte); SAFE_FREE (); graft_intervals_into_buffer (tmp_interval1, end2 - len1,
--- a/src/emacs.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/emacs.c Thu Jul 08 22:47:34 2010 +0000 @@ -585,7 +585,7 @@ DEFUN ("invocation-name", Finvocation_name, Sinvocation_name, 0, 0, 0, doc: /* Return the program name that was used to run Emacs. Any directory names are omitted. */) - () + (void) { return Fcopy_sequence (Vinvocation_name); } @@ -593,7 +593,7 @@ DEFUN ("invocation-directory", Finvocation_directory, Sinvocation_directory, 0, 0, 0, doc: /* Return the directory name in which the Emacs executable was located. */) - () + (void) { return Fcopy_sequence (Vinvocation_directory); } @@ -1761,13 +1761,14 @@ extern char etext; #endif extern void safe_bcopy (); - extern void dump_opcode_frequencies (); atexit (_mcleanup); /* This uses safe_bcopy because that function comes first in the Emacs executable. It might be better to use something that gives the start of the text segment, but start_of_text is not defined on all systems now. */ + /* FIXME: Does not work on architectures with function + descriptors. */ monstartup (safe_bcopy, &etext); } else @@ -2058,7 +2059,7 @@ while (to < argc) new[to++] = 0; - bcopy (new, argv, sizeof (char *) * argc); + memcpy (argv, new, sizeof (char *) * argc); xfree (options); xfree (new); @@ -2073,8 +2074,7 @@ The value of `kill-emacs-hook', if not void, is a list of functions (of no args), all of which are called before Emacs is actually killed. */) - (arg) - Lisp_Object arg; + (Lisp_Object arg) { struct gcpro gcpro1; @@ -2204,8 +2204,7 @@ This is used in the file `loadup.el' when building Emacs. You must run Emacs in batch mode in order to dump it. */) - (filename, symfile) - Lisp_Object filename, symfile; + (Lisp_Object filename, Lisp_Object symfile) { extern char my_edata[]; Lisp_Object tem; @@ -2408,7 +2407,7 @@ DEFUN ("daemonp", Fdaemonp, Sdaemonp, 0, 0, 0, doc: /* Return non-nil if the current emacs process is a daemon. If the daemon was given a name argument, return that name. */) - () + (void) { if (IS_DAEMON) if (daemon_name) @@ -2423,7 +2422,7 @@ doc: /* Mark the Emacs daemon as being initialized. This finishes the daemonization process by doing the other half of detaching from the parent process and its tty file descriptors. */) - () + (void) { int nfd;
--- a/src/eval.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/eval.c Thu Jul 08 22:47:34 2010 +0000 @@ -296,8 +296,7 @@ The remaining args are not evalled at all. If all args return nil, return nil. usage: (or CONDITIONS...) */) - (args) - Lisp_Object args; + (Lisp_Object args) { register Lisp_Object val = Qnil; struct gcpro gcpro1; @@ -321,8 +320,7 @@ The remaining args are not evalled at all. If no arg yields nil, return the last arg's value. usage: (and CONDITIONS...) */) - (args) - Lisp_Object args; + (Lisp_Object args) { register Lisp_Object val = Qt; struct gcpro gcpro1; @@ -347,8 +345,7 @@ THEN must be one expression, but ELSE... can be zero or more expressions. If COND yields nil, and there are no ELSE's, the value is nil. usage: (if COND THEN ELSE...) */) - (args) - Lisp_Object args; + (Lisp_Object args) { register Lisp_Object cond; struct gcpro gcpro1; @@ -372,8 +369,7 @@ If a clause has one element, as in (CONDITION), CONDITION's value if non-nil is returned from the cond-form. usage: (cond CLAUSES...) */) - (args) - Lisp_Object args; + (Lisp_Object args) { register Lisp_Object clause, val; struct gcpro gcpro1; @@ -400,8 +396,7 @@ DEFUN ("progn", Fprogn, Sprogn, 0, UNEVALLED, 0, doc: /* Eval BODY forms sequentially and return value of last one. usage: (progn BODY...) */) - (args) - Lisp_Object args; + (Lisp_Object args) { register Lisp_Object val = Qnil; struct gcpro gcpro1; @@ -423,8 +418,7 @@ The value of FIRST is saved during the evaluation of the remaining args, whose values are discarded. usage: (prog1 FIRST BODY...) */) - (args) - Lisp_Object args; + (Lisp_Object args) { Lisp_Object val; register Lisp_Object args_left; @@ -457,8 +451,7 @@ The value of FORM2 is saved during the evaluation of the remaining args, whose values are discarded. usage: (prog2 FORM1 FORM2 BODY...) */) - (args) - Lisp_Object args; + (Lisp_Object args) { Lisp_Object val; register Lisp_Object args_left; @@ -497,8 +490,7 @@ each VAL can use the new value of variables set earlier in the `setq'. The return value of the `setq' form is the value of the last VAL. usage: (setq [SYM VAL]...) */) - (args) - Lisp_Object args; + (Lisp_Object args) { register Lisp_Object args_left; register Lisp_Object val, sym; @@ -526,8 +518,7 @@ DEFUN ("quote", Fquote, Squote, 1, UNEVALLED, 0, doc: /* Return the argument, without evaluating it. `(quote x)' yields `x'. usage: (quote ARG) */) - (args) - Lisp_Object args; + (Lisp_Object args) { if (!NILP (Fcdr (args))) xsignal2 (Qwrong_number_of_arguments, Qquote, Flength (args)); @@ -539,8 +530,7 @@ In byte compilation, `function' causes its argument to be compiled. `quote' cannot do that. usage: (function ARG) */) - (args) - Lisp_Object args; + (Lisp_Object args) { if (!NILP (Fcdr (args))) xsignal2 (Qwrong_number_of_arguments, Qfunction, Flength (args)); @@ -565,7 +555,7 @@ either (i) add an extra optional argument and give it an `interactive' spec that specifies non-nil unconditionally (such as \"p\"); or (ii) use `called-interactively-p'. */) - () + (void) { return (INTERACTIVE && interactive_p (1)) ? Qt : Qnil; } @@ -591,8 +581,7 @@ cleaner to give your function an extra optional argument whose `interactive' spec specifies non-nil unconditionally (\"p\" is a good way to do this), or via (not (or executing-kbd-macro noninteractive)). */) - (kind) - Lisp_Object kind; + (Lisp_Object kind) { return ((INTERACTIVE || !EQ (kind, intern ("interactive"))) && interactive_p (1)) ? Qt : Qnil; @@ -653,8 +642,7 @@ The definition is (lambda ARGLIST [DOCSTRING] BODY...). See also the function `interactive'. usage: (defun NAME ARGLIST [DOCSTRING] BODY...) */) - (args) - Lisp_Object args; + (Lisp_Object args) { register Lisp_Object fn_name; register Lisp_Object defn; @@ -697,8 +685,7 @@ Set NAME's `doc-string-elt' property to ELT. usage: (defmacro NAME ARGLIST [DOCSTRING] [DECL] BODY...) */) - (args) - Lisp_Object args; + (Lisp_Object args) { register Lisp_Object fn_name; register Lisp_Object defn; @@ -756,8 +743,7 @@ itself an alias. If NEW-ALIAS is bound, and BASE-VARIABLE is not, then the value of BASE-VARIABLE is set to that of NEW-ALIAS. The return value is BASE-VARIABLE. */) - (new_alias, base_variable, docstring) - Lisp_Object new_alias, base_variable, docstring; + (Lisp_Object new_alias, Lisp_Object base_variable, Lisp_Object docstring) { struct Lisp_Symbol *sym; @@ -828,8 +814,7 @@ for these variables. \(`defconst' and `defcustom' behave similarly in this respect.) usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */) - (args) - Lisp_Object args; + (Lisp_Object args) { register Lisp_Object sym, tem, tail; @@ -901,8 +886,7 @@ value. However, you should normally not make local bindings for variables defined with this form. usage: (defconst SYMBOL INITVALUE [DOCSTRING]) */) - (args) - Lisp_Object args; + (Lisp_Object args) { register Lisp_Object sym, tem; @@ -950,8 +934,7 @@ \(3) it is an alias for another user variable. Return nil if VARIABLE is an alias and there is a loop in the chain of symbols. */) - (variable) - Lisp_Object variable; + (Lisp_Object variable) { Lisp_Object documentation; @@ -998,8 +981,7 @@ or a list (SYMBOL VALUEFORM) (which binds SYMBOL to the value of VALUEFORM). Each VALUEFORM can refer to the symbols already bound by this VARLIST. usage: (let* VARLIST BODY...) */) - (args) - Lisp_Object args; + (Lisp_Object args) { Lisp_Object varlist, val, elt; int count = SPECPDL_INDEX (); @@ -1035,8 +1017,7 @@ or a list (SYMBOL VALUEFORM) (which binds SYMBOL to the value of VALUEFORM). All the VALUEFORMs are evalled before any symbols are bound. usage: (let VARLIST BODY...) */) - (args) - Lisp_Object args; + (Lisp_Object args) { Lisp_Object *temps, tem; register Lisp_Object elt, varlist; @@ -1089,8 +1070,7 @@ The order of execution is thus TEST, BODY, TEST, BODY and so on until TEST returns nil. usage: (while TEST BODY...) */) - (args) - Lisp_Object args; + (Lisp_Object args) { Lisp_Object test, body; struct gcpro gcpro1, gcpro2; @@ -1117,9 +1097,7 @@ The second optional arg ENVIRONMENT specifies an environment of macro definitions to shadow the loaded ones for use in file byte-compilation. */) - (form, environment) - Lisp_Object form; - Lisp_Object environment; + (Lisp_Object form, Lisp_Object environment) { /* With cleanups from Hallvard Furuseth. */ register Lisp_Object expander, sym, def, tem; @@ -1197,8 +1175,7 @@ If no throw happens, `catch' returns the value of the last BODY form. If a throw happens, it specifies the value to return from `catch'. usage: (catch TAG BODY...) */) - (args) - Lisp_Object args; + (Lisp_Object args) { register Lisp_Object tag; struct gcpro gcpro1; @@ -1311,8 +1288,7 @@ DEFUN ("throw", Fthrow, Sthrow, 2, 2, 0, doc: /* Throw to the catch for TAG and return VALUE from it. Both TAG and VALUE are evalled. */) - (tag, value) - register Lisp_Object tag, value; + (register Lisp_Object tag, Lisp_Object value) { register struct catchtag *c; @@ -1332,8 +1308,7 @@ after executing the UNWINDFORMS. If BODYFORM exits nonlocally, the UNWINDFORMS are executed anyway. usage: (unwind-protect BODYFORM UNWINDFORMS...) */) - (args) - Lisp_Object args; + (Lisp_Object args) { Lisp_Object val; int count = SPECPDL_INDEX (); @@ -1373,8 +1348,7 @@ See also the function `signal' for more info. usage: (condition-case VAR BODYFORM &rest HANDLERS) */) - (args) - Lisp_Object args; +(Lisp_Object args) { register Lisp_Object bodyform, handlers; volatile Lisp_Object var; @@ -1661,8 +1635,7 @@ error message is constructed. If the signal is handled, DATA is made available to the handler. See also the function `condition-case'. */) - (error_symbol, data) - Lisp_Object error_symbol, data; + (Lisp_Object error_symbol, Lisp_Object data) { /* When memory is full, ERROR-SYMBOL is nil, and DATA is (REAL-ERROR-SYMBOL . REAL-DATA). @@ -2085,8 +2058,7 @@ If the optional argument FOR-CALL-INTERACTIVELY is non-nil, then strings and vectors are not accepted. */) - (function, for_call_interactively) - Lisp_Object function, for_call_interactively; + (Lisp_Object function, Lisp_Object for_call_interactively) { register Lisp_Object fun; register Lisp_Object funcar; @@ -2150,8 +2122,7 @@ They default to nil. If FUNCTION is already defined other than as an autoload, this does nothing and returns nil. */) - (function, file, docstring, interactive, type) - Lisp_Object function, file, docstring, interactive, type; + (Lisp_Object function, Lisp_Object file, Lisp_Object docstring, Lisp_Object interactive, Lisp_Object type) { CHECK_SYMBOL (function); CHECK_STRING (file); @@ -2252,8 +2223,7 @@ DEFUN ("eval", Feval, Seval, 1, 1, 0, doc: /* Evaluate FORM and return its value. */) - (form) - Lisp_Object form; + (Lisp_Object form) { Lisp_Object fun, val, original_fun, original_args; Lisp_Object funcar; @@ -2463,9 +2433,7 @@ Then return the value FUNCTION returns. Thus, (apply '+ 1 2 '(3 4)) returns 10. usage: (apply FUNCTION &rest ARGUMENTS) */) - (nargs, args) - int nargs; - Lisp_Object *args; + (int nargs, Lisp_Object *args) { register int i, numargs; register Lisp_Object spread_arg; @@ -2529,7 +2497,7 @@ gcpro1.nvars = 1 + numargs; } - bcopy (args, funcall_args, nargs * sizeof (Lisp_Object)); + memcpy (funcall_args, args, nargs * sizeof (Lisp_Object)); /* Spread the last arg we got. Its first element goes in the slot that it used to occupy, hence this value of I. */ i = nargs - 1; @@ -2564,9 +2532,7 @@ Do not use `make-local-variable' to make a hook variable buffer-local. Instead, use `add-hook' and specify t for the LOCAL argument. usage: (run-hooks &rest HOOKS) */) - (nargs, args) - int nargs; - Lisp_Object *args; + (int nargs, Lisp_Object *args) { Lisp_Object hook[1]; register int i; @@ -2595,9 +2561,7 @@ Do not use `make-local-variable' to make a hook variable buffer-local. Instead, use `add-hook' and specify t for the LOCAL argument. usage: (run-hook-with-args HOOK &rest ARGS) */) - (nargs, args) - int nargs; - Lisp_Object *args; + (int nargs, Lisp_Object *args) { return run_hook_with_args (nargs, args, to_completion); } @@ -2617,9 +2581,7 @@ Do not use `make-local-variable' to make a hook variable buffer-local. Instead, use `add-hook' and specify t for the LOCAL argument. usage: (run-hook-with-args-until-success HOOK &rest ARGS) */) - (nargs, args) - int nargs; - Lisp_Object *args; + (int nargs, Lisp_Object *args) { return run_hook_with_args (nargs, args, until_success); } @@ -2638,9 +2600,7 @@ Do not use `make-local-variable' to make a hook variable buffer-local. Instead, use `add-hook' and specify t for the LOCAL argument. usage: (run-hook-with-args-until-failure HOOK &rest ARGS) */) - (nargs, args) - int nargs; - Lisp_Object *args; + (int nargs, Lisp_Object *args) { return run_hook_with_args (nargs, args, until_failure); } @@ -2946,9 +2906,7 @@ Return the value that function returns. Thus, (funcall 'cons 'x 'y) returns (x . y). usage: (funcall FUNCTION &rest ARGUMENTS) */) - (nargs, args) - int nargs; - Lisp_Object *args; + (int nargs, Lisp_Object *args) { Lisp_Object fun, original_fun; Lisp_Object funcar; @@ -3018,7 +2976,7 @@ if (XSUBR (fun)->max_args > numargs) { internal_args = (Lisp_Object *) alloca (XSUBR (fun)->max_args * sizeof (Lisp_Object)); - bcopy (args + 1, internal_args, numargs * sizeof (Lisp_Object)); + memcpy (internal_args, args + 1, numargs * sizeof (Lisp_Object)); for (i = numargs; i < XSUBR (fun)->max_args; i++) internal_args[i] = Qnil; } @@ -3223,8 +3181,7 @@ DEFUN ("fetch-bytecode", Ffetch_bytecode, Sfetch_bytecode, 1, 1, 0, doc: /* If byte-compiled OBJECT is lazy-loaded, fetch it now. */) - (object) - Lisp_Object object; + (Lisp_Object object) { Lisp_Object tem; @@ -3456,8 +3413,7 @@ DEFUN ("backtrace-debug", Fbacktrace_debug, Sbacktrace_debug, 2, 2, 0, doc: /* Set the debug-on-exit flag of eval frame LEVEL levels down to FLAG. The debugger is entered when that frame exits, if the flag is non-nil. */) - (level, flag) - Lisp_Object level, flag; + (Lisp_Object level, Lisp_Object flag) { register struct backtrace *backlist = backtrace_list; register int i; @@ -3478,7 +3434,7 @@ DEFUN ("backtrace", Fbacktrace, Sbacktrace, 0, 0, "", doc: /* Print a trace of Lisp function calls currently active. Output stream used is value of `standard-output'. */) - () + (void) { register struct backtrace *backlist = backtrace_list; register int i; @@ -3543,8 +3499,7 @@ FUNCTION is whatever was supplied as car of evaluated list, or a lambda expression for macro calls. If NFRAMES is more than the number of frames, the value is nil. */) - (nframes) - Lisp_Object nframes; + (Lisp_Object nframes) { register struct backtrace *backlist = backtrace_list; register int i;
--- a/src/fileio.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/fileio.c Thu Jul 08 22:47:34 2010 +0000 @@ -346,8 +346,7 @@ any handlers that are members of `inhibit-file-name-handlers', but we still do run any other handlers. This lets handlers use the standard functions without calling themselves recursively. */) - (filename, operation) - Lisp_Object filename, operation; + (Lisp_Object filename, Lisp_Object operation) { /* This function must not munge the match data. */ Lisp_Object chain, inhibited_handlers, result; @@ -403,8 +402,7 @@ Return nil if FILENAME does not include a directory. Otherwise return a directory name. Given a Unix syntax file name, returns a string ending in slash. */) - (filename) - Lisp_Object filename; + (Lisp_Object filename) { #ifndef DOS_NT register const unsigned char *beg; @@ -425,7 +423,7 @@ filename = FILE_SYSTEM_CASE (filename); #ifdef DOS_NT beg = (unsigned char *) alloca (SBYTES (filename) + 1); - bcopy (SDATA (filename), beg, SBYTES (filename) + 1); + memcpy (beg, SDATA (filename), SBYTES (filename) + 1); #else beg = SDATA (filename); #endif @@ -478,8 +476,7 @@ For example, in a Unix-syntax file name, this is everything after the last slash, or the entire name if it contains no slash. */) - (filename) - Lisp_Object filename; + (Lisp_Object filename) { register const unsigned char *beg, *p, *end; Lisp_Object handler; @@ -519,8 +516,7 @@ then this should return nil. The `call-process' and `start-process' functions use this function to get a current directory to run processes in. */) - (filename) - Lisp_Object filename; + (Lisp_Object filename) { Lisp_Object handler; @@ -569,8 +565,7 @@ The result can be used as the value of `default-directory' or passed as second argument to `expand-file-name'. For a Unix-syntax file name, just appends a slash. */) - (file) - Lisp_Object file; + (Lisp_Object file) { char *buf; Lisp_Object handler; @@ -628,8 +623,7 @@ This operation exists because a directory is also a file, but its name as a directory is different from its name as a file. In Unix-syntax, this function just removes the final slash. */) - (directory) - Lisp_Object directory; + (Lisp_Object directory) { char *buf; Lisp_Object handler; @@ -725,10 +719,10 @@ if (!STRING_MULTIBYTE (prefix)) STRING_SET_UNIBYTE (val); data = SDATA (val); - bcopy(SDATA (prefix), data, len); + memcpy (data, SDATA (prefix), len); p = data + len; - bcopy (pidbuf, p, pidlen); + memcpy (p, pidbuf, pidlen); p += pidlen; /* Here we try to minimize useless stat'ing when this function is @@ -801,8 +795,7 @@ * If you are creating the file in the user's home directory. * If you are creating a directory rather than an ordinary file. * If you are taking special precautions as `make-temp-file' does. */) - (prefix) - Lisp_Object prefix; + (Lisp_Object prefix) { return make_temp_name (prefix, 0); } @@ -827,8 +820,7 @@ \(expand-file-name ".." "/") returns "/..". For this reason, use (directory-file-name (file-name-directory dirname)) to traverse a filesystem tree, not (expand-file-name ".." dirname). */) - (name, default_directory) - Lisp_Object name, default_directory; + (Lisp_Object name, Lisp_Object default_directory) { /* These point to SDATA and need to be careful with string-relocation during GC (via DECODE_FILE). */ @@ -939,7 +931,7 @@ /* Make a local copy of nm[] to protect it from GC in DECODE_FILE below. */ nm = (unsigned char *) alloca (SBYTES (name) + 1); - bcopy (SDATA (name), nm, SBYTES (name) + 1); + memcpy (nm, SDATA (name), SBYTES (name) + 1); #ifdef DOS_NT /* Note if special escape prefix is present, but remove for now. */ @@ -1093,7 +1085,7 @@ unsigned char *o, *p; for (p = nm; *p && (!IS_DIRECTORY_SEP (*p)); p++); o = alloca (p - nm + 1); - bcopy ((char *) nm, o, p - nm); + memcpy (o, nm, p - nm); o [p - nm] = 0; BLOCK_INPUT; @@ -1244,7 +1236,7 @@ ) { unsigned char *temp = (unsigned char *) alloca (length); - bcopy (newdir, temp, length - 1); + memcpy (temp, newdir, length - 1); temp[length - 1] = 0; newdir = temp; } @@ -1467,7 +1459,7 @@ int len = ptr ? ptr - user : strlen (user); /* Copy the user name into temp storage. */ o = (unsigned char *) alloca (len + 1); - bcopy ((char *) user, o, len); + memcpy (o, user, len); o[len] = 0; /* Look up the user name. */ @@ -1583,7 +1575,7 @@ { unsigned char *o = alloca (s - p + 1); struct passwd *pw; - bcopy (p, o, s - p); + memcpy (o, p, s - p); o [s - p] = 0; /* If we have ~user and `user' exists, discard @@ -1613,8 +1605,7 @@ If `/~' appears, all of FILENAME through that `/' is discarded. If `//' appears, everything up to and including the first of those `/' is discarded. */) - (filename) - Lisp_Object filename; + (Lisp_Object filename) { unsigned char *nm; @@ -1640,7 +1631,7 @@ decode of environment variables, causing the original Lisp_String data to be relocated. */ nm = (unsigned char *) alloca (SBYTES (filename) + 1); - bcopy (SDATA (filename), nm, SBYTES (filename) + 1); + memcpy (nm, SDATA (filename), SBYTES (filename) + 1); #ifdef DOS_NT dostounix_filename (nm); @@ -1905,9 +1896,7 @@ If PRESERVE-SELINUX-CONTEXT is non-nil and SELinux is enabled on the system, we copy the SELinux context of FILE to NEWNAME. */) - (file, newname, ok_if_already_exists, keep_time, preserve_uid_gid, preserve_selinux_context) - Lisp_Object file, newname, ok_if_already_exists, keep_time; - Lisp_Object preserve_uid_gid, preserve_selinux_context; + (Lisp_Object file, Lisp_Object newname, Lisp_Object ok_if_already_exists, Lisp_Object keep_time, Lisp_Object preserve_uid_gid, Lisp_Object preserve_selinux_context) { int ifd, ofd, n; char buf[16 * 1024]; @@ -2118,8 +2107,7 @@ DEFUN ("make-directory-internal", Fmake_directory_internal, Smake_directory_internal, 1, 1, 0, doc: /* Create a new directory named DIRECTORY. */) - (directory) - Lisp_Object directory; + (Lisp_Object directory) { const unsigned char *dir; Lisp_Object handler; @@ -2149,8 +2137,7 @@ DEFUN ("delete-directory-internal", Fdelete_directory_internal, Sdelete_directory_internal, 1, 1, 0, doc: /* Delete the directory named DIRECTORY. Does not follow symlinks. */) - (directory) - Lisp_Object directory; + (Lisp_Object directory) { const unsigned char *dir; Lisp_Object handler; @@ -2180,9 +2167,7 @@ When called interactively, TRASH is t if no prefix argument is given. With a prefix argument, TRASH is nil. */) - (filename, trash) - Lisp_Object filename; - Lisp_Object trash; + (Lisp_Object filename, Lisp_Object trash) { Lisp_Object handler; Lisp_Object encoded_file; @@ -2238,8 +2223,7 @@ unless optional third argument OK-IF-ALREADY-EXISTS is non-nil. A number as third arg means request confirmation if NEWNAME already exists. This is what happens in interactive use with M-x. */) - (file, newname, ok_if_already_exists) - Lisp_Object file, newname, ok_if_already_exists; + (Lisp_Object file, Lisp_Object newname, Lisp_Object ok_if_already_exists) { Lisp_Object handler; struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; @@ -2336,8 +2320,7 @@ unless optional third argument OK-IF-ALREADY-EXISTS is non-nil. A number as third arg means request confirmation if NEWNAME already exists. This is what happens in interactive use with M-x. */) - (file, newname, ok_if_already_exists) - Lisp_Object file, newname, ok_if_already_exists; + (Lisp_Object file, Lisp_Object newname, Lisp_Object ok_if_already_exists) { Lisp_Object handler; Lisp_Object encoded_file, encoded_newname; @@ -2392,8 +2375,7 @@ unless optional third argument OK-IF-ALREADY-EXISTS is non-nil. A number as third arg means request confirmation if LINKNAME already exists. This happens for interactive use with M-x. */) - (filename, linkname, ok_if_already_exists) - Lisp_Object filename, linkname, ok_if_already_exists; + (Lisp_Object filename, Lisp_Object linkname, Lisp_Object ok_if_already_exists) { Lisp_Object handler; Lisp_Object encoded_filename, encoded_linkname; @@ -2468,8 +2450,7 @@ 1, 1, 0, doc: /* Return t if file FILENAME specifies an absolute file name. On Unix, this is a name starting with a `/' or a `~'. */) - (filename) - Lisp_Object filename; + (Lisp_Object filename) { CHECK_STRING (filename); return file_name_absolute_p (SDATA (filename)) ? Qt : Qnil; @@ -2528,8 +2509,7 @@ See also `file-readable-p' and `file-attributes'. This returns nil for a symlink to a nonexistent file. Use `file-symlink-p' to test for such links. */) - (filename) - Lisp_Object filename; + (Lisp_Object filename) { Lisp_Object absname; Lisp_Object handler; @@ -2552,8 +2532,7 @@ DEFUN ("file-executable-p", Ffile_executable_p, Sfile_executable_p, 1, 1, 0, doc: /* Return t if FILENAME can be executed by you. For a directory, this means you can access files in that directory. */) - (filename) - Lisp_Object filename; + (Lisp_Object filename) { Lisp_Object absname; Lisp_Object handler; @@ -2575,8 +2554,7 @@ DEFUN ("file-readable-p", Ffile_readable_p, Sfile_readable_p, 1, 1, 0, doc: /* Return t if file FILENAME exists and you can read it. See also `file-exists-p' and `file-attributes'. */) - (filename) - Lisp_Object filename; + (Lisp_Object filename) { Lisp_Object absname; Lisp_Object handler; @@ -2625,8 +2603,7 @@ on the RT/PC. */ DEFUN ("file-writable-p", Ffile_writable_p, Sfile_writable_p, 1, 1, 0, doc: /* Return t if file FILENAME can be written or created by you. */) - (filename) - Lisp_Object filename; + (Lisp_Object filename) { Lisp_Object absname, dir, encoded; Lisp_Object handler; @@ -2670,8 +2647,7 @@ doc: /* Access file FILENAME, and get an error if that does not work. The second argument STRING is used in the error message. If there is no error, returns nil. */) - (filename, string) - Lisp_Object filename, string; + (Lisp_Object filename, Lisp_Object string) { Lisp_Object handler, encoded_filename, absname; int fd; @@ -2704,8 +2680,7 @@ This function returns t when given the name of a symlink that points to a nonexistent file. */) - (filename) - Lisp_Object filename; + (Lisp_Object filename) { Lisp_Object handler; @@ -2733,7 +2708,7 @@ { bufsize *= 2; buf = (char *) xrealloc (buf, bufsize); - bzero (buf, bufsize); + memset (buf, 0, bufsize); errno = 0; valsize = readlink (SDATA (filename), buf, bufsize); @@ -2769,8 +2744,7 @@ doc: /* Return t if FILENAME names an existing directory. Symbolic links to directories count as directories. See `file-symlink-p' to distinguish symlinks. */) - (filename) - Lisp_Object filename; + (Lisp_Object filename) { register Lisp_Object absname; struct stat st; @@ -2799,8 +2773,7 @@ A directory name spec may be given instead; then the value is t if the directory so specified exists and really is a readable and searchable directory. */) - (filename) - Lisp_Object filename; + (Lisp_Object filename) { Lisp_Object handler; int tem; @@ -2824,8 +2797,7 @@ This is the sort of file that holds an ordinary stream of data bytes. Symbolic links to regular files count as regular files. See `file-symlink-p' to distinguish symlinks. */) - (filename) - Lisp_Object filename; + (Lisp_Object filename) { register Lisp_Object absname; struct stat st; @@ -2867,8 +2839,7 @@ doc: /* Return SELinux context of file named FILENAME, as a list ("user", "role", "type", "range"). Return (nil, nil, nil, nil) if file does not exist, is not accessible, or SELinux is disabled */) - (filename) - Lisp_Object filename; + (Lisp_Object filename) { Lisp_Object absname; Lisp_Object values[4]; @@ -2923,8 +2894,7 @@ doc: /* Set SELinux context of file named FILENAME to CONTEXT as a list ("user", "role", "type", "range"). Has no effect if SELinux is disabled. */) - (filename, context) - Lisp_Object filename, context; + (Lisp_Object filename, Lisp_Object context) { Lisp_Object absname, encoded_absname; Lisp_Object handler; @@ -2999,8 +2969,7 @@ DEFUN ("file-modes", Ffile_modes, Sfile_modes, 1, 1, 0, doc: /* Return mode bits of file named FILENAME, as an integer. Return nil, if file does not exist or is not accessible. */) - (filename) - Lisp_Object filename; + (Lisp_Object filename) { Lisp_Object absname; struct stat st; @@ -3030,8 +2999,7 @@ Interactively, mode bits are read by `read-file-modes', which accepts symbolic notation, like the `chmod' command from GNU Coreutils. */) - (filename, mode) - Lisp_Object filename, mode; + (Lisp_Object filename, Lisp_Object mode) { Lisp_Object absname, encoded_absname; Lisp_Object handler; @@ -3057,8 +3025,7 @@ doc: /* Set the file permission bits for newly created files. The argument MODE should be an integer; only the low 9 bits are used. This setting is inherited by subprocesses. */) - (mode) - Lisp_Object mode; + (Lisp_Object mode) { CHECK_NUMBER (mode); @@ -3070,7 +3037,7 @@ DEFUN ("default-file-modes", Fdefault_file_modes, Sdefault_file_modes, 0, 0, 0, doc: /* Return the default file protection for created files. The value is an integer. */) - () + (void) { int realmask; Lisp_Object value; @@ -3090,8 +3057,7 @@ Return t on success, else nil. Use the current time if TIME is nil. TIME is in the format of `current-time'. */) - (filename, time) - Lisp_Object filename, time; + (Lisp_Object filename, Lisp_Object time) { Lisp_Object absname, encoded_absname; Lisp_Object handler; @@ -3138,7 +3104,7 @@ #ifdef HAVE_SYNC DEFUN ("unix-sync", Funix_sync, Sunix_sync, 0, 0, "", doc: /* Tell Unix to finish all pending disk updates. */) - () + (void) { sync (); return Qnil; @@ -3150,8 +3116,7 @@ doc: /* Return t if file FILE1 is newer than file FILE2. If FILE1 does not exist, the answer is nil; otherwise, if FILE2 does not exist, the answer is t. */) - (file1, file2) - Lisp_Object file1, file2; + (Lisp_Object file1, Lisp_Object file2) { Lisp_Object absname1, absname2; struct stat st; @@ -3300,8 +3265,7 @@ This function does code conversion according to the value of `coding-system-for-read' or `file-coding-system-alist', and sets the variable `last-coding-system-used' to the coding system actually used. */) - (filename, visit, beg, end, replace) - Lisp_Object filename, visit, beg, end, replace; + (Lisp_Object filename, Lisp_Object visit, Lisp_Object beg, Lisp_Object end, Lisp_Object replace) { struct stat st; register int fd; @@ -3837,7 +3801,7 @@ conversion_buffer); unprocessed = coding.carryover_bytes; if (coding.carryover_bytes > 0) - bcopy (coding.carryover, read_buf, unprocessed); + memcpy (read_buf, coding.carryover, unprocessed); } UNGCPRO; emacs_close (fd); @@ -4580,8 +4544,7 @@ This calls `write-region-annotate-functions' at the start, and `write-region-post-annotation-function' at the end. */) - (start, end, filename, append, visit, lockname, mustbenew) - Lisp_Object start, end, filename, append, visit, lockname, mustbenew; + (Lisp_Object start, Lisp_Object end, Lisp_Object filename, Lisp_Object append, Lisp_Object visit, Lisp_Object lockname, Lisp_Object mustbenew) { register int desc; int failure; @@ -4886,8 +4849,7 @@ DEFUN ("car-less-than-car", Fcar_less_than_car, Scar_less_than_car, 2, 2, 0, doc: /* Return t if (car A) is numerically less than (car B). */) - (a, b) - Lisp_Object a, b; + (Lisp_Object a, Lisp_Object b) { return Flss (Fcar (a), Fcar (b)); } @@ -5114,8 +5076,7 @@ doc: /* Return t if last mod time of BUF's visited file matches what BUF records. This means that the file has not been changed since it was visited or saved. See Info node `(elisp)Modification Time' for more details. */) - (buf) - Lisp_Object buf; + (Lisp_Object buf) { struct buffer *b; struct stat st; @@ -5161,7 +5122,7 @@ Sclear_visited_file_modtime, 0, 0, 0, doc: /* Clear out records of last mod time of visited file. Next attempt to save will certainly not complain of a discrepancy. */) - () + (void) { current_buffer->modtime = 0; current_buffer->modtime_size = -1; @@ -5175,7 +5136,7 @@ that `file-attributes' returns. If the current buffer has no recorded file modification time, this function returns 0. See Info node `(elisp)Modification Time' for more details. */) - () + (void) { if (! current_buffer->modtime) return make_number (0); @@ -5190,8 +5151,7 @@ An argument specifies the modification time value to use \(instead of that of the visited file), in the form of a list \(HIGH . LOW) or (HIGH LOW). */) - (time_list) - Lisp_Object time_list; + (Lisp_Object time_list) { if (!NILP (time_list)) { @@ -5245,7 +5205,7 @@ GCPRO1 (msg); nbytes = SBYTES (msg); SAFE_ALLOCA (msgbuf, char *, nbytes); - bcopy (SDATA (msg), msgbuf, nbytes); + memcpy (msgbuf, SDATA (msg), nbytes); for (i = 0; i < 3; ++i) { @@ -5337,8 +5297,7 @@ A non-nil NO-MESSAGE argument means do not print any message if successful. A non-nil CURRENT-ONLY argument means save only current buffer. */) - (no_message, current_only) - Lisp_Object no_message, current_only; + (Lisp_Object no_message, Lisp_Object current_only) { struct buffer *old = current_buffer, *b; Lisp_Object tail, buf; @@ -5539,7 +5498,7 @@ Sset_buffer_auto_saved, 0, 0, 0, doc: /* Mark current buffer as auto-saved with its current text. No auto-save file will be written until the buffer changes again. */) - () + (void) { /* FIXME: This should not be called in indirect buffers, since they're not autosaved. */ @@ -5552,7 +5511,7 @@ DEFUN ("clear-buffer-auto-save-failure", Fclear_buffer_auto_save_failure, Sclear_buffer_auto_save_failure, 0, 0, 0, doc: /* Clear any record of a recent auto-save failure in the current buffer. */) - () + (void) { current_buffer->auto_save_failure_time = -1; return Qnil; @@ -5564,7 +5523,7 @@ More precisely, if it has been auto-saved since last read from or saved in the visited file. If the buffer has no visited file, then any auto-save counts as "recent". */) - () + (void) { /* FIXME: maybe we should return nil for indirect buffers since they're never autosaved. */ @@ -5578,7 +5537,7 @@ doc: /* Return t if a call to `read-file-name' will use a dialog. The return value is only relevant for a call to `read-file-name' that happens before any other event (mouse or keypress) is handled. */) - () + (void) { #if defined (USE_MOTIF) || defined (HAVE_NTGUI) || defined (USE_GTK) if ((NILP (last_nonmenu_event) || CONSP (last_nonmenu_event))
--- a/src/filelock.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/filelock.c Thu Jul 08 22:47:34 2010 +0000 @@ -34,9 +34,7 @@ #ifdef HAVE_FCNTL_H #include <fcntl.h> #endif -#ifdef HAVE_STRING_H #include <string.h> -#endif #ifdef HAVE_UNISTD_H #include <unistd.h> @@ -667,8 +665,7 @@ doc: /* Lock FILE, if current buffer is modified. FILE defaults to current buffer's visited file, or else nothing is done if current buffer isn't visiting a file. */) - (file) - Lisp_Object file; + (Lisp_Object file) { if (NILP (file)) file = current_buffer->file_truename; @@ -685,7 +682,7 @@ doc: /* Unlock the file visited in the current buffer. If the buffer is not modified, this does nothing because the file should not be locked in that case. */) - () + (void) { if (SAVE_MODIFF < MODIFF && STRINGP (current_buffer->file_truename)) @@ -707,8 +704,7 @@ doc: /* Return a value indicating whether FILENAME is locked. The value is nil if the FILENAME is not locked, t if it is locked by you, else a string saying which user has locked it. */) - (filename) - Lisp_Object filename; + (Lisp_Object filename) { Lisp_Object ret; register char *lfname;
--- a/src/filemode.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/filemode.c Thu Jul 08 22:47:34 2010 +0000 @@ -17,10 +17,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifdef HAVE_CONFIG_H #include <config.h> -#endif - #include <sys/types.h> #include <sys/stat.h>
--- a/src/floatfns.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/floatfns.c Thu Jul 08 22:47:34 2010 +0000 @@ -206,8 +206,7 @@ DEFUN ("acos", Facos, Sacos, 1, 1, 0, doc: /* Return the inverse cosine of ARG. */) - (arg) - register Lisp_Object arg; + (register Lisp_Object arg) { double d = extract_float (arg); #ifdef FLOAT_CHECK_DOMAIN @@ -220,8 +219,7 @@ DEFUN ("asin", Fasin, Sasin, 1, 1, 0, doc: /* Return the inverse sine of ARG. */) - (arg) - register Lisp_Object arg; + (register Lisp_Object arg) { double d = extract_float (arg); #ifdef FLOAT_CHECK_DOMAIN @@ -238,8 +236,7 @@ If two arguments Y and X are given, return the inverse tangent of Y divided by X, i.e. the angle in radians between the vector (X, Y) and the x-axis. */) - (y, x) - register Lisp_Object y, x; + (register Lisp_Object y, Lisp_Object x) { double d = extract_float (y); @@ -256,8 +253,7 @@ DEFUN ("cos", Fcos, Scos, 1, 1, 0, doc: /* Return the cosine of ARG. */) - (arg) - register Lisp_Object arg; + (register Lisp_Object arg) { double d = extract_float (arg); IN_FLOAT (d = cos (d), "cos", arg); @@ -266,8 +262,7 @@ DEFUN ("sin", Fsin, Ssin, 1, 1, 0, doc: /* Return the sine of ARG. */) - (arg) - register Lisp_Object arg; + (register Lisp_Object arg) { double d = extract_float (arg); IN_FLOAT (d = sin (d), "sin", arg); @@ -276,8 +271,7 @@ DEFUN ("tan", Ftan, Stan, 1, 1, 0, doc: /* Return the tangent of ARG. */) - (arg) - register Lisp_Object arg; + (register Lisp_Object arg) { double d = extract_float (arg); double c = cos (d); @@ -292,8 +286,7 @@ #if defined HAVE_ISNAN && defined HAVE_COPYSIGN DEFUN ("isnan", Fisnan, Sisnan, 1, 1, 0, doc: /* Return non nil iff argument X is a NaN. */) - (x) - Lisp_Object x; + (Lisp_Object x) { CHECK_FLOAT (x); return isnan (XFLOAT_DATA (x)) ? Qt : Qnil; @@ -302,8 +295,7 @@ DEFUN ("copysign", Fcopysign, Scopysign, 1, 2, 0, doc: /* Copy sign of X2 to value of X1, and return the result. Cause an error if X1 or X2 is not a float. */) - (x1, x2) - Lisp_Object x1, x2; + (Lisp_Object x1, Lisp_Object x2) { double f1, f2; @@ -326,8 +318,7 @@ The function returns the cons cell (SGNFCAND . EXP). If X is zero, both parts (SGNFCAND and EXP) are zero. */) - (x) - Lisp_Object x; + (Lisp_Object x) { double f = XFLOATINT (x); @@ -345,8 +336,7 @@ doc: /* Construct number X from significand SGNFCAND and exponent EXP. Returns the floating point value resulting from multiplying SGNFCAND (the significand) by 2 raised to the power of EXP (the exponent). */) - (sgnfcand, exp) - Lisp_Object sgnfcand, exp; + (Lisp_Object sgnfcand, Lisp_Object exp) { CHECK_NUMBER (exp); return make_float (ldexp (XFLOATINT (sgnfcand), XINT (exp))); @@ -357,8 +347,7 @@ DEFUN ("bessel-j0", Fbessel_j0, Sbessel_j0, 1, 1, 0, doc: /* Return the bessel function j0 of ARG. */) - (arg) - register Lisp_Object arg; + (register Lisp_Object arg) { double d = extract_float (arg); IN_FLOAT (d = j0 (d), "bessel-j0", arg); @@ -367,8 +356,7 @@ DEFUN ("bessel-j1", Fbessel_j1, Sbessel_j1, 1, 1, 0, doc: /* Return the bessel function j1 of ARG. */) - (arg) - register Lisp_Object arg; + (register Lisp_Object arg) { double d = extract_float (arg); IN_FLOAT (d = j1 (d), "bessel-j1", arg); @@ -378,8 +366,7 @@ DEFUN ("bessel-jn", Fbessel_jn, Sbessel_jn, 2, 2, 0, doc: /* Return the order N bessel function output jn of ARG. The first arg (the order) is truncated to an integer. */) - (n, arg) - register Lisp_Object n, arg; + (register Lisp_Object n, Lisp_Object arg) { int i1 = extract_float (n); double f2 = extract_float (arg); @@ -390,8 +377,7 @@ DEFUN ("bessel-y0", Fbessel_y0, Sbessel_y0, 1, 1, 0, doc: /* Return the bessel function y0 of ARG. */) - (arg) - register Lisp_Object arg; + (register Lisp_Object arg) { double d = extract_float (arg); IN_FLOAT (d = y0 (d), "bessel-y0", arg); @@ -400,8 +386,7 @@ DEFUN ("bessel-y1", Fbessel_y1, Sbessel_y1, 1, 1, 0, doc: /* Return the bessel function y1 of ARG. */) - (arg) - register Lisp_Object arg; + (register Lisp_Object arg) { double d = extract_float (arg); IN_FLOAT (d = y1 (d), "bessel-y0", arg); @@ -411,8 +396,7 @@ DEFUN ("bessel-yn", Fbessel_yn, Sbessel_yn, 2, 2, 0, doc: /* Return the order N bessel function output yn of ARG. The first arg (the order) is truncated to an integer. */) - (n, arg) - register Lisp_Object n, arg; + (register Lisp_Object n, Lisp_Object arg) { int i1 = extract_float (n); double f2 = extract_float (arg); @@ -427,8 +411,7 @@ DEFUN ("erf", Ferf, Serf, 1, 1, 0, doc: /* Return the mathematical error function of ARG. */) - (arg) - register Lisp_Object arg; + (register Lisp_Object arg) { double d = extract_float (arg); IN_FLOAT (d = erf (d), "erf", arg); @@ -437,8 +420,7 @@ DEFUN ("erfc", Ferfc, Serfc, 1, 1, 0, doc: /* Return the complementary error function of ARG. */) - (arg) - register Lisp_Object arg; + (register Lisp_Object arg) { double d = extract_float (arg); IN_FLOAT (d = erfc (d), "erfc", arg); @@ -447,8 +429,7 @@ DEFUN ("log-gamma", Flog_gamma, Slog_gamma, 1, 1, 0, doc: /* Return the log gamma of ARG. */) - (arg) - register Lisp_Object arg; + (register Lisp_Object arg) { double d = extract_float (arg); IN_FLOAT (d = lgamma (d), "log-gamma", arg); @@ -457,8 +438,7 @@ DEFUN ("cube-root", Fcube_root, Scube_root, 1, 1, 0, doc: /* Return the cube root of ARG. */) - (arg) - register Lisp_Object arg; + (register Lisp_Object arg) { double d = extract_float (arg); #ifdef HAVE_CBRT @@ -476,8 +456,7 @@ DEFUN ("exp", Fexp, Sexp, 1, 1, 0, doc: /* Return the exponential base e of ARG. */) - (arg) - register Lisp_Object arg; + (register Lisp_Object arg) { double d = extract_float (arg); #ifdef FLOAT_CHECK_DOMAIN @@ -493,8 +472,7 @@ DEFUN ("expt", Fexpt, Sexpt, 2, 2, 0, doc: /* Return the exponential ARG1 ** ARG2. */) - (arg1, arg2) - register Lisp_Object arg1, arg2; + (register Lisp_Object arg1, Lisp_Object arg2) { double f1, f2, f3; @@ -552,8 +530,7 @@ DEFUN ("log", Flog, Slog, 1, 2, 0, doc: /* Return the natural logarithm of ARG. If the optional argument BASE is given, return log ARG using that base. */) - (arg, base) - register Lisp_Object arg, base; + (register Lisp_Object arg, Lisp_Object base) { double d = extract_float (arg); @@ -581,8 +558,7 @@ DEFUN ("log10", Flog10, Slog10, 1, 1, 0, doc: /* Return the logarithm base 10 of ARG. */) - (arg) - register Lisp_Object arg; + (register Lisp_Object arg) { double d = extract_float (arg); #ifdef FLOAT_CHECK_DOMAIN @@ -595,8 +571,7 @@ DEFUN ("sqrt", Fsqrt, Ssqrt, 1, 1, 0, doc: /* Return the square root of ARG. */) - (arg) - register Lisp_Object arg; + (register Lisp_Object arg) { double d = extract_float (arg); #ifdef FLOAT_CHECK_DOMAIN @@ -611,8 +586,7 @@ DEFUN ("acosh", Facosh, Sacosh, 1, 1, 0, doc: /* Return the inverse hyperbolic cosine of ARG. */) - (arg) - register Lisp_Object arg; + (register Lisp_Object arg) { double d = extract_float (arg); #ifdef FLOAT_CHECK_DOMAIN @@ -629,8 +603,7 @@ DEFUN ("asinh", Fasinh, Sasinh, 1, 1, 0, doc: /* Return the inverse hyperbolic sine of ARG. */) - (arg) - register Lisp_Object arg; + (register Lisp_Object arg) { double d = extract_float (arg); #ifdef HAVE_INVERSE_HYPERBOLIC @@ -643,8 +616,7 @@ DEFUN ("atanh", Fatanh, Satanh, 1, 1, 0, doc: /* Return the inverse hyperbolic tangent of ARG. */) - (arg) - register Lisp_Object arg; + (register Lisp_Object arg) { double d = extract_float (arg); #ifdef FLOAT_CHECK_DOMAIN @@ -661,8 +633,7 @@ DEFUN ("cosh", Fcosh, Scosh, 1, 1, 0, doc: /* Return the hyperbolic cosine of ARG. */) - (arg) - register Lisp_Object arg; + (register Lisp_Object arg) { double d = extract_float (arg); #ifdef FLOAT_CHECK_DOMAIN @@ -675,8 +646,7 @@ DEFUN ("sinh", Fsinh, Ssinh, 1, 1, 0, doc: /* Return the hyperbolic sine of ARG. */) - (arg) - register Lisp_Object arg; + (register Lisp_Object arg) { double d = extract_float (arg); #ifdef FLOAT_CHECK_DOMAIN @@ -689,8 +659,7 @@ DEFUN ("tanh", Ftanh, Stanh, 1, 1, 0, doc: /* Return the hyperbolic tangent of ARG. */) - (arg) - register Lisp_Object arg; + (register Lisp_Object arg) { double d = extract_float (arg); IN_FLOAT (d = tanh (d), "tanh", arg); @@ -700,8 +669,7 @@ DEFUN ("abs", Fabs, Sabs, 1, 1, 0, doc: /* Return the absolute value of ARG. */) - (arg) - register Lisp_Object arg; + (register Lisp_Object arg) { CHECK_NUMBER_OR_FLOAT (arg); @@ -715,8 +683,7 @@ DEFUN ("float", Ffloat, Sfloat, 1, 1, 0, doc: /* Return the floating point number equal to ARG. */) - (arg) - register Lisp_Object arg; + (register Lisp_Object arg) { CHECK_NUMBER_OR_FLOAT (arg); @@ -729,8 +696,7 @@ DEFUN ("logb", Flogb, Slogb, 1, 1, 0, doc: /* Returns largest integer <= the base 2 log of the magnitude of ARG. This is the same as the exponent of a float. */) - (arg) - Lisp_Object arg; + (Lisp_Object arg) { Lisp_Object val; EMACS_INT value; @@ -891,8 +857,7 @@ doc: /* Return the smallest integer no less than ARG. This rounds the value towards +inf. With optional DIVISOR, return the smallest integer no less than ARG/DIVISOR. */) - (arg, divisor) - Lisp_Object arg, divisor; + (Lisp_Object arg, Lisp_Object divisor) { return rounding_driver (arg, divisor, ceil, ceiling2, "ceiling"); } @@ -901,8 +866,7 @@ doc: /* Return the largest integer no greater than ARG. This rounds the value towards -inf. With optional DIVISOR, return the largest integer no greater than ARG/DIVISOR. */) - (arg, divisor) - Lisp_Object arg, divisor; + (Lisp_Object arg, Lisp_Object divisor) { return rounding_driver (arg, divisor, floor, floor2, "floor"); } @@ -915,8 +879,7 @@ integer closer to zero, or it may prefer an even integer, depending on your machine. For example, \(round 2.5\) can return 3 on some systems, but 2 on others. */) - (arg, divisor) - Lisp_Object arg, divisor; + (Lisp_Object arg, Lisp_Object divisor) { return rounding_driver (arg, divisor, emacs_rint, round2, "round"); } @@ -925,8 +888,7 @@ doc: /* Truncate a floating point number to an int. Rounds ARG toward zero. With optional DIVISOR, truncate ARG/DIVISOR. */) - (arg, divisor) - Lisp_Object arg, divisor; + (Lisp_Object arg, Lisp_Object divisor) { return rounding_driver (arg, divisor, double_identity, truncate2, "truncate"); @@ -956,8 +918,7 @@ DEFUN ("fceiling", Ffceiling, Sfceiling, 1, 1, 0, doc: /* Return the smallest integer no less than ARG, as a float. \(Round toward +inf.\) */) - (arg) - register Lisp_Object arg; + (register Lisp_Object arg) { double d = extract_float (arg); IN_FLOAT (d = ceil (d), "fceiling", arg); @@ -967,8 +928,7 @@ DEFUN ("ffloor", Fffloor, Sffloor, 1, 1, 0, doc: /* Return the largest integer no greater than ARG, as a float. \(Round towards -inf.\) */) - (arg) - register Lisp_Object arg; + (register Lisp_Object arg) { double d = extract_float (arg); IN_FLOAT (d = floor (d), "ffloor", arg); @@ -977,8 +937,7 @@ DEFUN ("fround", Ffround, Sfround, 1, 1, 0, doc: /* Return the nearest integer to ARG, as a float. */) - (arg) - register Lisp_Object arg; + (register Lisp_Object arg) { double d = extract_float (arg); IN_FLOAT (d = emacs_rint (d), "fround", arg); @@ -988,8 +947,7 @@ DEFUN ("ftruncate", Fftruncate, Sftruncate, 1, 1, 0, doc: /* Truncate a floating point number to an integral float value. Rounds the value toward zero. */) - (arg) - register Lisp_Object arg; + (register Lisp_Object arg) { double d = extract_float (arg); if (d >= 0.0)
--- a/src/fns.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/fns.c Thu Jul 08 22:47:34 2010 +0000 @@ -85,8 +85,7 @@ DEFUN ("identity", Fidentity, Sidentity, 1, 1, 0, doc: /* Return the argument unchanged. */) - (arg) - Lisp_Object arg; + (Lisp_Object arg) { return arg; } @@ -98,8 +97,7 @@ With positive integer LIMIT, return random number in interval [0,LIMIT). With argument t, set the random number seed from the current time and pid. Other values of LIMIT are ignored. */) - (limit) - Lisp_Object limit; + (Lisp_Object limit) { EMACS_INT val; Lisp_Object lispy_val; @@ -135,8 +133,7 @@ If the string contains multibyte characters, this is not necessarily the number of bytes in the string; it is the number of characters. To get the number of bytes, use `string-bytes'. */) - (sequence) - register Lisp_Object sequence; + (register Lisp_Object sequence) { register Lisp_Object val; register int i; @@ -186,8 +183,7 @@ This function never gets an error. If LIST is not really a list, it returns 0. If LIST is circular, it returns a finite value which is at least the number of distinct elements. */) - (list) - Lisp_Object list; + (Lisp_Object list) { Lisp_Object tail, halftail, length; int len = 0; @@ -210,8 +206,7 @@ DEFUN ("string-bytes", Fstring_bytes, Sstring_bytes, 1, 1, 0, doc: /* Return the number of bytes in STRING. If STRING is multibyte, this may be greater than the length of STRING. */) - (string) - Lisp_Object string; + (Lisp_Object string) { CHECK_STRING (string); return make_number (SBYTES (string)); @@ -221,8 +216,7 @@ doc: /* Return t if two strings have identical contents. Case is significant, but text properties are ignored. Symbols are also allowed; their print names are used instead. */) - (s1, s2) - register Lisp_Object s1, s2; + (register Lisp_Object s1, Lisp_Object s2) { if (SYMBOLP (s1)) s1 = SYMBOL_NAME (s1); @@ -233,7 +227,7 @@ if (SCHARS (s1) != SCHARS (s2) || SBYTES (s1) != SBYTES (s2) - || bcmp (SDATA (s1), SDATA (s2), SBYTES (s1))) + || memcmp (SDATA (s1), SDATA (s2), SBYTES (s1))) return Qnil; return Qt; } @@ -253,8 +247,7 @@ - 1 - N is the number of characters that match at the beginning. If string STR1 is greater, the value is a positive number N; N - 1 is the number of characters that match at the beginning. */) - (str1, start1, end1, str2, start2, end2, ignore_case) - Lisp_Object str1, start1, end1, start2, str2, end2, ignore_case; + (Lisp_Object str1, Lisp_Object start1, Lisp_Object end1, Lisp_Object str2, Lisp_Object start2, Lisp_Object end2, Lisp_Object ignore_case) { register int end1_char, end2_char; register int i1, i1_byte, i2, i2_byte; @@ -345,8 +338,7 @@ doc: /* Return t if first arg string is less than second in lexicographic order. Case is significant. Symbols are also allowed; their print names are used instead. */) - (s1, s2) - register Lisp_Object s1, s2; + (register Lisp_Object s1, Lisp_Object s2) { register int end; register int i1, i1_byte, i2, i2_byte; @@ -415,9 +407,7 @@ Each argument may be a list, vector or string. The last argument is not copied, just used as the tail of the new list. usage: (append &rest SEQUENCES) */) - (nargs, args) - int nargs; - Lisp_Object *args; + (int nargs, Lisp_Object *args) { return concat (nargs, args, Lisp_Cons, 1); } @@ -427,9 +417,7 @@ The result is a string whose elements are the elements of all the arguments. Each argument may be a string or a list or vector of characters (integers). usage: (concat &rest SEQUENCES) */) - (nargs, args) - int nargs; - Lisp_Object *args; + (int nargs, Lisp_Object *args) { return concat (nargs, args, Lisp_String, 0); } @@ -439,9 +427,7 @@ The result is a vector whose elements are the elements of all the arguments. Each argument may be a list, vector or string. usage: (vconcat &rest SEQUENCES) */) - (nargs, args) - int nargs; - Lisp_Object *args; + (int nargs, Lisp_Object *args) { return concat (nargs, args, Lisp_Vectorlike, 0); } @@ -451,8 +437,7 @@ doc: /* Return a copy of a list, vector, string or char-table. The elements of a list or vector are not copied; they are shared with the original. */) - (arg) - Lisp_Object arg; + (Lisp_Object arg) { if (NILP (arg)) return arg; @@ -469,8 +454,8 @@ / BOOL_VECTOR_BITS_PER_CHAR); val = Fmake_bool_vector (Flength (arg), Qnil); - bcopy (XBOOL_VECTOR (arg)->data, XBOOL_VECTOR (val)->data, - size_in_chars); + memcpy (XBOOL_VECTOR (val)->data, XBOOL_VECTOR (arg)->data, + size_in_chars); return val; } @@ -637,8 +622,7 @@ { int thislen_byte = SBYTES (this); - bcopy (SDATA (this), SDATA (val) + toindex_byte, - SBYTES (this)); + memcpy (SDATA (val) + toindex_byte, SDATA (this), SBYTES (this)); if (! NULL_INTERVAL_P (STRING_INTERVALS (this))) { textprops[num_textprops].argnum = argnum; @@ -953,7 +937,7 @@ return make_multibyte_string (SDATA (string), nbytes, nbytes); SAFE_ALLOCA (buf, unsigned char *, nbytes); - bcopy (SDATA (string), buf, SBYTES (string)); + memcpy (buf, SDATA (string), SBYTES (string)); str_to_multibyte (buf, nbytes, SBYTES (string)); ret = make_multibyte_string (buf, SCHARS (string), nbytes); @@ -999,8 +983,7 @@ STRING is unibyte and entirely ASCII, the returned string is unibyte. \(When the characters are all ASCII, Emacs primitives will treat the string the same way whether it is unibyte or multibyte.) */) - (string) - Lisp_Object string; + (Lisp_Object string) { CHECK_STRING (string); @@ -1014,8 +997,7 @@ `nonascii-translation-table' or, if that is nil, `nonascii-insert-offset'. If the lookup in the translation table fails, this function takes just the low 8 bits of each character. */) - (string) - Lisp_Object string; + (Lisp_Object string) { CHECK_STRING (string); @@ -1029,8 +1011,7 @@ Otherwise it is a newly created string, with no text properties. If STRING is multibyte and contains a character of charset `eight-bit', it is converted to the corresponding single byte. */) - (string) - Lisp_Object string; + (Lisp_Object string) { CHECK_STRING (string); @@ -1039,7 +1020,7 @@ int bytes = SBYTES (string); unsigned char *str = (unsigned char *) xmalloc (bytes); - bcopy (SDATA (string), str, bytes); + memcpy (str, SDATA (string), bytes); bytes = str_as_unibyte (str, bytes); string = make_unibyte_string (str, bytes); xfree (str); @@ -1062,8 +1043,7 @@ It is similar to (decode-coding-string STRING 'utf-8-emacs). If you're not sure, whether to use `string-as-multibyte' or `string-to-multibyte', use `string-to-multibyte'. */) - (string) - Lisp_Object string; + (Lisp_Object string) { CHECK_STRING (string); @@ -1076,8 +1056,7 @@ SBYTES (string), &nchars, &nbytes); new_string = make_uninit_multibyte_string (nchars, nbytes); - bcopy (SDATA (string), SDATA (new_string), - SBYTES (string)); + memcpy (SDATA (new_string), SDATA (string), SBYTES (string)); if (nbytes != SBYTES (string)) str_as_multibyte (SDATA (new_string), nbytes, SBYTES (string), NULL); @@ -1099,8 +1078,7 @@ This differs from `string-as-multibyte' by converting each byte of a correct utf-8 sequence to an eight-bit character, not just bytes that don't form a correct sequence. */) - (string) - Lisp_Object string; + (Lisp_Object string) { CHECK_STRING (string); @@ -1115,8 +1093,7 @@ where each `eight-bit' character is converted to the corresponding byte. If STRING contains a non-ASCII, non-`eight-bit' character, an error is signaled. */) - (string) - Lisp_Object string; + (Lisp_Object string) { CHECK_STRING (string); @@ -1142,8 +1119,7 @@ The objects mapped (cars and cdrs of elements of the alist) are shared, however. Elements of ALIST that are not conses are also shared. */) - (alist) - Lisp_Object alist; + (Lisp_Object alist) { register Lisp_Object tem; @@ -1173,9 +1149,7 @@ The STRING argument may also be a vector. In that case, the return value is a new vector that contains the elements between index FROM \(inclusive) and index TO (exclusive) of that vector argument. */) - (string, from, to) - Lisp_Object string; - register Lisp_Object from, to; + (Lisp_Object string, register Lisp_Object from, Lisp_Object to) { Lisp_Object res; int size; @@ -1244,9 +1218,7 @@ If FROM or TO is negative, it counts from the end. With one argument, just copy STRING without its properties. */) - (string, from, to) - Lisp_Object string; - register Lisp_Object from, to; + (Lisp_Object string, register Lisp_Object from, Lisp_Object to) { int size, size_byte; int from_char, to_char; @@ -1333,9 +1305,7 @@ DEFUN ("nthcdr", Fnthcdr, Snthcdr, 2, 2, 0, doc: /* Take cdr N times on LIST, returns the result. */) - (n, list) - Lisp_Object n; - register Lisp_Object list; + (Lisp_Object n, Lisp_Object list) { register int i, num; CHECK_NUMBER (n); @@ -1352,16 +1322,14 @@ DEFUN ("nth", Fnth, Snth, 2, 2, 0, doc: /* Return the Nth element of LIST. N counts from zero. If LIST is not that long, nil is returned. */) - (n, list) - Lisp_Object n, list; + (Lisp_Object n, Lisp_Object list) { return Fcar (Fnthcdr (n, list)); } DEFUN ("elt", Felt, Selt, 2, 2, 0, doc: /* Return element of SEQUENCE at index N. */) - (sequence, n) - register Lisp_Object sequence, n; + (register Lisp_Object sequence, Lisp_Object n) { CHECK_NUMBER (n); if (CONSP (sequence) || NILP (sequence)) @@ -1375,9 +1343,7 @@ DEFUN ("member", Fmember, Smember, 2, 2, 0, doc: /* Return non-nil if ELT is an element of LIST. Comparison done with `equal'. The value is actually the tail of LIST whose car is ELT. */) - (elt, list) - register Lisp_Object elt; - Lisp_Object list; + (register Lisp_Object elt, Lisp_Object list) { register Lisp_Object tail; for (tail = list; CONSP (tail); tail = XCDR (tail)) @@ -1395,8 +1361,7 @@ DEFUN ("memq", Fmemq, Smemq, 2, 2, 0, doc: /* Return non-nil if ELT is an element of LIST. Comparison done with `eq'. The value is actually the tail of LIST whose car is ELT. */) - (elt, list) - register Lisp_Object elt, list; + (register Lisp_Object elt, Lisp_Object list) { while (1) { @@ -1422,9 +1387,7 @@ DEFUN ("memql", Fmemql, Smemql, 2, 2, 0, doc: /* Return non-nil if ELT is an element of LIST. Comparison done with `eql'. The value is actually the tail of LIST whose car is ELT. */) - (elt, list) - register Lisp_Object elt; - Lisp_Object list; + (register Lisp_Object elt, Lisp_Object list) { register Lisp_Object tail; @@ -1447,8 +1410,7 @@ doc: /* Return non-nil if KEY is `eq' to the car of an element of LIST. The value is actually the first element of LIST whose car is KEY. Elements of LIST that are not conses are ignored. */) - (key, list) - Lisp_Object key, list; + (Lisp_Object key, Lisp_Object list) { while (1) { @@ -1493,8 +1455,7 @@ DEFUN ("assoc", Fassoc, Sassoc, 2, 2, 0, doc: /* Return non-nil if KEY is `equal' to the car of an element of LIST. The value is actually the first element of LIST whose car equals KEY. */) - (key, list) - Lisp_Object key, list; + (Lisp_Object key, Lisp_Object list) { Lisp_Object car; @@ -1545,9 +1506,7 @@ DEFUN ("rassq", Frassq, Srassq, 2, 2, 0, doc: /* Return non-nil if KEY is `eq' to the cdr of an element of LIST. The value is actually the first element of LIST whose cdr is KEY. */) - (key, list) - register Lisp_Object key; - Lisp_Object list; + (register Lisp_Object key, Lisp_Object list) { while (1) { @@ -1578,8 +1537,7 @@ DEFUN ("rassoc", Frassoc, Srassoc, 2, 2, 0, doc: /* Return non-nil if KEY is `equal' to the cdr of an element of LIST. The value is actually the first element of LIST whose cdr equals KEY. */) - (key, list) - Lisp_Object key, list; + (Lisp_Object key, Lisp_Object list) { Lisp_Object cdr; @@ -1618,9 +1576,7 @@ If the first member of LIST is ELT, there is no way to remove it by side effect; therefore, write `(setq foo (delq element foo))' to be sure of changing the value of `foo'. */) - (elt, list) - register Lisp_Object elt; - Lisp_Object list; + (register Lisp_Object elt, Lisp_Object list) { register Lisp_Object tail, prev; register Lisp_Object tem; @@ -1654,8 +1610,7 @@ is not a side effect; it is simply using a different sequence. Therefore, write `(setq foo (delete element foo))' to be sure of changing the value of `foo'. */) - (elt, seq) - Lisp_Object elt, seq; + (Lisp_Object elt, Lisp_Object seq) { if (VECTORP (seq)) { @@ -1770,8 +1725,7 @@ DEFUN ("nreverse", Fnreverse, Snreverse, 1, 1, 0, doc: /* Reverse LIST by modifying cdr pointers. Return the reversed list. */) - (list) - Lisp_Object list; + (Lisp_Object list) { register Lisp_Object prev, tail, next; @@ -1793,8 +1747,7 @@ DEFUN ("reverse", Freverse, Sreverse, 1, 1, 0, doc: /* Reverse LIST, copying. Return the reversed list. See also the function `nreverse', which is used more often. */) - (list) - Lisp_Object list; + (Lisp_Object list) { Lisp_Object new; @@ -1814,8 +1767,7 @@ Returns the sorted list. LIST is modified by side effects. PREDICATE is called with two elements of LIST, and should return non-nil if the first element should sort before the second. */) - (list, predicate) - Lisp_Object list, predicate; + (Lisp_Object list, Lisp_Object predicate) { Lisp_Object front, back; register Lisp_Object len, tem; @@ -1907,9 +1859,7 @@ \(PROP1 VALUE1 PROP2 VALUE2...). This function returns the value corresponding to the given PROP, or nil if PROP is not one of the properties on the list. This function never signals an error. */) - (plist, prop) - Lisp_Object plist; - Lisp_Object prop; + (Lisp_Object plist, Lisp_Object prop) { Lisp_Object tail, halftail; @@ -1939,8 +1889,7 @@ DEFUN ("get", Fget, Sget, 2, 2, 0, doc: /* Return the value of SYMBOL's PROPNAME property. This is the last value stored with `(put SYMBOL PROPNAME VALUE)'. */) - (symbol, propname) - Lisp_Object symbol, propname; + (Lisp_Object symbol, Lisp_Object propname) { CHECK_SYMBOL (symbol); return Fplist_get (XSYMBOL (symbol)->plist, propname); @@ -1954,10 +1903,7 @@ otherwise the new PROP VAL pair is added. The new plist is returned; use `(setq x (plist-put x prop val))' to be sure to use the new value. The PLIST is modified by side effects. */) - (plist, prop, val) - Lisp_Object plist; - register Lisp_Object prop; - Lisp_Object val; + (Lisp_Object plist, register Lisp_Object prop, Lisp_Object val) { register Lisp_Object tail, prev; Lisp_Object newcell; @@ -1985,8 +1931,7 @@ DEFUN ("put", Fput, Sput, 3, 3, 0, doc: /* Store SYMBOL's PROPNAME property with value VALUE. It can be retrieved with `(get SYMBOL PROPNAME)'. */) - (symbol, propname, value) - Lisp_Object symbol, propname, value; + (Lisp_Object symbol, Lisp_Object propname, Lisp_Object value) { CHECK_SYMBOL (symbol); XSYMBOL (symbol)->plist @@ -2000,9 +1945,7 @@ \(PROP1 VALUE1 PROP2 VALUE2...). This function returns the value corresponding to the given PROP, or nil if PROP is not one of the properties on the list. */) - (plist, prop) - Lisp_Object plist; - Lisp_Object prop; + (Lisp_Object plist, Lisp_Object prop) { Lisp_Object tail; @@ -2029,10 +1972,7 @@ otherwise the new PROP VAL pair is added. The new plist is returned; use `(setq x (lax-plist-put x prop val))' to be sure to use the new value. The PLIST is modified by side effects. */) - (plist, prop, val) - Lisp_Object plist; - register Lisp_Object prop; - Lisp_Object val; + (Lisp_Object plist, register Lisp_Object prop, Lisp_Object val) { register Lisp_Object tail, prev; Lisp_Object newcell; @@ -2060,8 +2000,7 @@ DEFUN ("eql", Feql, Seql, 2, 2, 0, doc: /* Return t if the two args are the same Lisp object. Floating-point numbers of equal value are `eql', but they may not be `eq'. */) - (obj1, obj2) - Lisp_Object obj1, obj2; + (Lisp_Object obj1, Lisp_Object obj2) { if (FLOATP (obj1)) return internal_equal (obj1, obj2, 0, 0) ? Qt : Qnil; @@ -2077,8 +2016,7 @@ Numbers are compared by value, but integers cannot equal floats. (Use `=' if you want integers and floats to be able to be equal.) Symbols must match exactly. */) - (o1, o2) - register Lisp_Object o1, o2; + (register Lisp_Object o1, Lisp_Object o2) { return internal_equal (o1, o2, 0, 0) ? Qt : Qnil; } @@ -2087,8 +2025,7 @@ doc: /* Return t if two Lisp objects have similar structure and contents. This is like `equal' except that it compares the text properties of strings. (`equal' ignores text properties.) */) - (o1, o2) - register Lisp_Object o1, o2; + (register Lisp_Object o1, Lisp_Object o2) { return internal_equal (o1, o2, 0, 1) ? Qt : Qnil; } @@ -2170,8 +2107,8 @@ if (XBOOL_VECTOR (o1)->size != XBOOL_VECTOR (o2)->size) return 0; - if (bcmp (XBOOL_VECTOR (o1)->data, XBOOL_VECTOR (o2)->data, - size_in_chars)) + if (memcmp (XBOOL_VECTOR (o1)->data, XBOOL_VECTOR (o2)->data, + size_in_chars)) return 0; return 1; } @@ -2205,8 +2142,7 @@ return 0; if (SBYTES (o1) != SBYTES (o2)) return 0; - if (bcmp (SDATA (o1), SDATA (o2), - SBYTES (o1))) + if (memcmp (SDATA (o1), SDATA (o2), SBYTES (o1))) return 0; if (props && !compare_string_intervals (o1, o2)) return 0; @@ -2223,8 +2159,7 @@ DEFUN ("fillarray", Ffillarray, Sfillarray, 2, 2, 0, doc: /* Store each element of ARRAY with ITEM. ARRAY is a vector, string, char-table, or bool-vector. */) - (array, item) - Lisp_Object array, item; + (Lisp_Object array, Lisp_Object item) { register int size, index, charval; if (VECTORP (array)) @@ -2298,13 +2233,12 @@ 1, 1, 0, doc: /* Clear the contents of STRING. This makes STRING unibyte and may change its length. */) - (string) - Lisp_Object string; + (Lisp_Object string) { int len; CHECK_STRING (string); len = SBYTES (string); - bzero (SDATA (string), len); + memset (SDATA (string), 0, len); STRING_SET_CHARS (string, len); STRING_SET_UNIBYTE (string); return Qnil; @@ -2324,9 +2258,7 @@ doc: /* Concatenate any number of lists by altering them. Only the last argument is not altered, and need not be a list. usage: (nconc &rest LISTS) */) - (nargs, args) - int nargs; - Lisp_Object *args; + (int nargs, Lisp_Object *args) { register int argnum; register Lisp_Object tail, tem, val; @@ -2447,8 +2379,7 @@ In between each pair of results, stick in SEPARATOR. Thus, " " as SEPARATOR results in spaces between the values returned by FUNCTION. SEQUENCE may be a list, a vector, a bool-vector, or a string. */) - (function, sequence, separator) - Lisp_Object function, sequence, separator; + (Lisp_Object function, Lisp_Object sequence, Lisp_Object separator) { Lisp_Object len; register int leni; @@ -2488,8 +2419,7 @@ doc: /* Apply FUNCTION to each element of SEQUENCE, and make a list of the results. The result is a list just as long as SEQUENCE. SEQUENCE may be a list, a vector, a bool-vector, or a string. */) - (function, sequence) - Lisp_Object function, sequence; + (Lisp_Object function, Lisp_Object sequence) { register Lisp_Object len; register int leni; @@ -2516,8 +2446,7 @@ doc: /* Apply FUNCTION to each element of SEQUENCE for side effects only. Unlike `mapcar', don't accumulate the results. Return SEQUENCE. SEQUENCE may be a list, a vector, a bool-vector, or a string. */) - (function, sequence) - Lisp_Object function, sequence; + (Lisp_Object function, Lisp_Object sequence) { register int leni; @@ -2543,8 +2472,7 @@ Under a windowing system a dialog box will be used if `last-nonmenu-event' is nil and `use-dialog-box' is non-nil. */) - (prompt) - Lisp_Object prompt; + (Lisp_Object prompt) { register Lisp_Object obj, key, def, map; register int answer; @@ -2692,8 +2620,7 @@ Under a windowing system a dialog box will be used if `last-nonmenu-event' is nil, and `use-dialog-box' is non-nil. */) - (prompt) - Lisp_Object prompt; + (Lisp_Object prompt) { register Lisp_Object ans; Lisp_Object args[2]; @@ -2765,8 +2692,7 @@ cases making it work would require Emacs being installed setuid or setgid so that it can read kernel information, and that usually isn't advisable. */) - (use_floats) - Lisp_Object use_floats; + (Lisp_Object use_floats) { double load_ave[3]; int loads = getloadavg (load_ave, 3); @@ -2797,8 +2723,7 @@ Use `provide' to declare that a feature is available. This function looks at the value of the variable `features'. The optional argument SUBFEATURE can be used to check a specific subfeature of FEATURE. */) - (feature, subfeature) - Lisp_Object feature, subfeature; + (Lisp_Object feature, Lisp_Object subfeature) { register Lisp_Object tem; CHECK_SYMBOL (feature); @@ -2812,8 +2737,7 @@ doc: /* Announce that FEATURE is a feature of the current Emacs. The optional argument SUBFEATURES should be a list of symbols listing particular subfeatures supported in this version of FEATURE. */) - (feature, subfeatures) - Lisp_Object feature, subfeatures; + (Lisp_Object feature, Lisp_Object subfeatures) { register Lisp_Object tem; CHECK_SYMBOL (feature); @@ -2859,8 +2783,7 @@ then return nil if the file is not found instead of signaling an error. Normally the return value is FEATURE. The normal messages at start and end of loading FILENAME are suppressed. */) - (feature, filename, noerror) - Lisp_Object feature, filename, noerror; + (Lisp_Object feature, Lisp_Object filename, Lisp_Object noerror) { register Lisp_Object tem; struct gcpro gcpro1, gcpro2; @@ -2955,8 +2878,7 @@ Unlike `plist-get', this allows you to distinguish between a missing property and a property with the value nil. The value is actually the tail of PLIST whose car is PROP. */) - (plist, prop) - Lisp_Object plist, prop; + (Lisp_Object plist, Lisp_Object prop) { while (CONSP (plist) && !EQ (XCAR (plist), prop)) { @@ -2970,8 +2892,7 @@ DEFUN ("widget-put", Fwidget_put, Swidget_put, 3, 3, 0, doc: /* In WIDGET, set PROPERTY to VALUE. The value can later be retrieved with `widget-get'. */) - (widget, property, value) - Lisp_Object widget, property, value; + (Lisp_Object widget, Lisp_Object property, Lisp_Object value) { CHECK_CONS (widget); XSETCDR (widget, Fplist_put (XCDR (widget), property, value)); @@ -2982,8 +2903,7 @@ doc: /* In WIDGET, get the value of PROPERTY. The value could either be specified when the widget was created, or later with `widget-put'. */) - (widget, property) - Lisp_Object widget, property; + (Lisp_Object widget, Lisp_Object property) { Lisp_Object tmp; @@ -3009,9 +2929,7 @@ doc: /* Apply the value of WIDGET's PROPERTY to the widget itself. ARGS are passed as extra arguments to the function. usage: (widget-apply WIDGET PROPERTY &rest ARGS) */) - (nargs, args) - int nargs; - Lisp_Object *args; + (int nargs, Lisp_Object *args) { /* This function can GC. */ Lisp_Object newargs[3]; @@ -3050,8 +2968,7 @@ See also Info node `(libc)Locales'. The data read from the system are decoded using `locale-coding-system'. */) - (item) - Lisp_Object item; + (Lisp_Object item) { char *str = NULL; #ifdef HAVE_LANGINFO_CODESET @@ -3205,8 +3122,7 @@ Return the length of the encoded text. Optional third argument NO-LINE-BREAK means do not break long lines into shorter lines. */) - (beg, end, no_line_break) - Lisp_Object beg, end, no_line_break; + (Lisp_Object beg, Lisp_Object end, Lisp_Object no_line_break) { char *encoded; int allength, length; @@ -3265,8 +3181,7 @@ doc: /* Base64-encode STRING and return the result. Optional second argument NO-LINE-BREAK means do not break long lines into shorter lines. */) - (string, no_line_break) - Lisp_Object string, no_line_break; + (Lisp_Object string, Lisp_Object no_line_break) { int allength, length, encoded_length; char *encoded; @@ -3404,8 +3319,7 @@ doc: /* Base64-decode the region between BEG and END. Return the length of the decoded text. If the region can't be decoded, signal an error and don't modify the buffer. */) - (beg, end) - Lisp_Object beg, end; + (Lisp_Object beg, Lisp_Object end) { int ibeg, iend, length, allength; char *decoded; @@ -3465,8 +3379,7 @@ DEFUN ("base64-decode-string", Fbase64_decode_string, Sbase64_decode_string, 1, 1, 0, doc: /* Base64-decode STRING and return the result. */) - (string) - Lisp_Object string; + (Lisp_Object string) { char *decoded; int length, decoded_length; @@ -3709,8 +3622,7 @@ xassert (new_size >= old_size); v = allocate_vector (new_size); - bcopy (XVECTOR (vec)->contents, v->contents, - old_size * sizeof *v->contents); + memcpy (v->contents, XVECTOR (vec)->contents, old_size * sizeof *v->contents); for (i = old_size; i < new_size; ++i) v->contents[i] = init; XSETVECTOR (vec, v); @@ -3947,7 +3859,7 @@ h2 = allocate_hash_table (); next = h2->vec_next; - bcopy (h1, h2, sizeof *h2); + memcpy (h2, h1, sizeof *h2); h2->vec_next = next; h2->key_and_value = Fcopy_sequence (h1->key_and_value); h2->hash = Fcopy_sequence (h1->hash); @@ -4501,8 +4413,7 @@ DEFUN ("sxhash", Fsxhash, Ssxhash, 1, 1, 0, doc: /* Compute a hash code for OBJ and return it as integer. */) - (obj) - Lisp_Object obj; + (Lisp_Object obj) { unsigned hash = sxhash (obj, 0); return make_number (hash); @@ -4541,9 +4452,7 @@ is nil. usage: (make-hash-table &rest KEYWORD-ARGS) */) - (nargs, args) - int nargs; - Lisp_Object *args; + (int nargs, Lisp_Object *args) { Lisp_Object test, size, rehash_size, rehash_threshold, weak; Lisp_Object user_test, user_hash; @@ -4553,7 +4462,7 @@ /* The vector `used' is used to keep track of arguments that have been consumed. */ used = (char *) alloca (nargs * sizeof *used); - bzero (used, nargs * sizeof *used); + memset (used, 0, nargs * sizeof *used); /* See if there's a `:test TEST' among the arguments. */ i = get_key_arg (QCtest, nargs, args, used); @@ -4620,8 +4529,7 @@ DEFUN ("copy-hash-table", Fcopy_hash_table, Scopy_hash_table, 1, 1, 0, doc: /* Return a copy of hash table TABLE. */) - (table) - Lisp_Object table; + (Lisp_Object table) { return copy_hash_table (check_hash_table (table)); } @@ -4629,8 +4537,7 @@ DEFUN ("hash-table-count", Fhash_table_count, Shash_table_count, 1, 1, 0, doc: /* Return the number of elements in TABLE. */) - (table) - Lisp_Object table; + (Lisp_Object table) { return make_number (check_hash_table (table)->count); } @@ -4639,8 +4546,7 @@ DEFUN ("hash-table-rehash-size", Fhash_table_rehash_size, Shash_table_rehash_size, 1, 1, 0, doc: /* Return the current rehash size of TABLE. */) - (table) - Lisp_Object table; + (Lisp_Object table) { return check_hash_table (table)->rehash_size; } @@ -4649,8 +4555,7 @@ DEFUN ("hash-table-rehash-threshold", Fhash_table_rehash_threshold, Shash_table_rehash_threshold, 1, 1, 0, doc: /* Return the current rehash threshold of TABLE. */) - (table) - Lisp_Object table; + (Lisp_Object table) { return check_hash_table (table)->rehash_threshold; } @@ -4661,8 +4566,7 @@ The size can be used as an argument to `make-hash-table' to create a hash table than can hold as many elements of TABLE holds without need for resizing. */) - (table) - Lisp_Object table; + (Lisp_Object table) { struct Lisp_Hash_Table *h = check_hash_table (table); return make_number (HASH_TABLE_SIZE (h)); @@ -4671,8 +4575,7 @@ DEFUN ("hash-table-test", Fhash_table_test, Shash_table_test, 1, 1, 0, doc: /* Return the test TABLE uses. */) - (table) - Lisp_Object table; + (Lisp_Object table) { return check_hash_table (table)->test; } @@ -4681,8 +4584,7 @@ DEFUN ("hash-table-weakness", Fhash_table_weakness, Shash_table_weakness, 1, 1, 0, doc: /* Return the weakness of TABLE. */) - (table) - Lisp_Object table; + (Lisp_Object table) { return check_hash_table (table)->weak; } @@ -4690,8 +4592,7 @@ DEFUN ("hash-table-p", Fhash_table_p, Shash_table_p, 1, 1, 0, doc: /* Return t if OBJ is a Lisp hash table object. */) - (obj) - Lisp_Object obj; + (Lisp_Object obj) { return HASH_TABLE_P (obj) ? Qt : Qnil; } @@ -4699,8 +4600,7 @@ DEFUN ("clrhash", Fclrhash, Sclrhash, 1, 1, 0, doc: /* Clear hash table TABLE and return it. */) - (table) - Lisp_Object table; + (Lisp_Object table) { hash_clear (check_hash_table (table)); /* Be compatible with XEmacs. */ @@ -4711,8 +4611,7 @@ DEFUN ("gethash", Fgethash, Sgethash, 2, 3, 0, doc: /* Look up KEY in TABLE and return its associated value. If KEY is not found, return DFLT which defaults to nil. */) - (key, table, dflt) - Lisp_Object key, table, dflt; + (Lisp_Object key, Lisp_Object table, Lisp_Object dflt) { struct Lisp_Hash_Table *h = check_hash_table (table); int i = hash_lookup (h, key, NULL); @@ -4724,8 +4623,7 @@ doc: /* Associate KEY with VALUE in hash table TABLE. If KEY is already present in table, replace its current value with VALUE. */) - (key, value, table) - Lisp_Object key, value, table; + (Lisp_Object key, Lisp_Object value, Lisp_Object table) { struct Lisp_Hash_Table *h = check_hash_table (table); int i; @@ -4743,8 +4641,7 @@ DEFUN ("remhash", Fremhash, Sremhash, 2, 2, 0, doc: /* Remove KEY from TABLE. */) - (key, table) - Lisp_Object key, table; + (Lisp_Object key, Lisp_Object table) { struct Lisp_Hash_Table *h = check_hash_table (table); hash_remove_from_table (h, key); @@ -4755,8 +4652,7 @@ DEFUN ("maphash", Fmaphash, Smaphash, 2, 2, 0, doc: /* Call FUNCTION for all entries in hash table TABLE. FUNCTION is called with two arguments, KEY and VALUE. */) - (function, table) - Lisp_Object function, table; + (Lisp_Object function, Lisp_Object table) { struct Lisp_Hash_Table *h = check_hash_table (table); Lisp_Object args[3]; @@ -4787,8 +4683,7 @@ argument and return an integer that is the hash code of the argument. Hash code computation should use the whole value range of integers, including negative integers. */) - (name, test, hash) - Lisp_Object name, test, hash; + (Lisp_Object name, Lisp_Object test, Lisp_Object hash) { return Fput (name, Qhash_table_test, list2 (test, hash)); } @@ -4828,8 +4723,7 @@ If NOERROR is non-nil, silently assume the `raw-text' coding if the guesswork fails. Normally, an error is signaled in such case. */) - (object, start, end, coding_system, noerror) - Lisp_Object object, start, end, coding_system, noerror; + (Lisp_Object object, Lisp_Object start, Lisp_Object end, Lisp_Object coding_system, Lisp_Object noerror) { unsigned char digest[16]; unsigned char value[33];
--- a/src/font.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/font.c Thu Jul 08 22:47:34 2010 +0000 @@ -3925,8 +3925,7 @@ Optional 2nd argument EXTRA-TYPE, if non-nil, specifies to check which kind of font it is. It must be one of `font-spec', `font-entity', `font-object'. */) - (object, extra_type) - Lisp_Object object, extra_type; + (Lisp_Object object, Lisp_Object extra_type) { if (NILP (extra_type)) return (FONTP (object) ? Qt : Qnil); @@ -4004,9 +4003,7 @@ language system must contain `mark' feature. usage: (font-spec ARGS...) */) - (nargs, args) - int nargs; - Lisp_Object *args; + (int nargs, Lisp_Object *args) { Lisp_Object spec = font_make_spec (); int i; @@ -4047,8 +4044,7 @@ DEFUN ("copy-font-spec", Fcopy_font_spec, Scopy_font_spec, 1, 1, 0, doc: /* Return a copy of FONT as a font-spec. */) - (font) - Lisp_Object font; + (Lisp_Object font) { Lisp_Object new_spec, tail, prev, extra; int i; @@ -4076,8 +4072,7 @@ doc: /* Merge font-specs FROM and TO, and return a new font-spec. Every specified properties in FROM override the corresponding properties in TO. */) - (from, to) - Lisp_Object from, to; + (Lisp_Object from, Lisp_Object to) { Lisp_Object extra, tail; int i; @@ -4111,8 +4106,7 @@ See the documentation of `font-spec' for their meanings. If FONT is a font-entity or font-object, the value of :script may be a list of scripts that are supported by the font. */) - (font, key) - Lisp_Object font, key; + (Lisp_Object font, Lisp_Object key) { int idx; @@ -4142,8 +4136,7 @@ The optional argument FRAME specifies the frame that the face attributes are to be displayed on. If omitted, the selected frame is used. */) - (font, frame) - Lisp_Object font, frame; + (Lisp_Object font, Lisp_Object frame) { struct frame *f; Lisp_Object plist[10]; @@ -4217,8 +4210,7 @@ DEFUN ("font-put", Ffont_put, Sfont_put, 3, 3, 0, doc: /* Set one property of FONT-SPEC: give property PROP value VAL. */) - (font_spec, prop, val) - Lisp_Object font_spec, prop, val; + (Lisp_Object font_spec, Lisp_Object prop, Lisp_Object val) { int idx; @@ -4238,8 +4230,7 @@ Optional 4th argument PREFER, if non-nil, is a font-spec to control the order of the returned list. Fonts are sorted by how close they are to PREFER. */) - (font_spec, frame, num, prefer) - Lisp_Object font_spec, frame, num, prefer; + (Lisp_Object font_spec, Lisp_Object frame, Lisp_Object num, Lisp_Object prefer) { Lisp_Object vec, list; int n = 0; @@ -4288,8 +4279,7 @@ DEFUN ("font-family-list", Ffont_family_list, Sfont_family_list, 0, 1, 0, doc: /* List available font families on the current frame. Optional argument FRAME, if non-nil, specifies the target frame. */) - (frame) - Lisp_Object frame; + (Lisp_Object frame) { FRAME_PTR f; struct font_driver_list *driver_list; @@ -4318,8 +4308,7 @@ DEFUN ("find-font", Ffind_font, Sfind_font, 1, 2, 0, doc: /* Return a font-entity matching with FONT-SPEC on the current frame. Optional 2nd argument FRAME, if non-nil, specifies the target frame. */) - (font_spec, frame) - Lisp_Object font_spec, frame; + (Lisp_Object font_spec, Lisp_Object frame) { Lisp_Object val = Flist_fonts (font_spec, frame, make_number (1), Qnil); @@ -4334,8 +4323,7 @@ If the name is too long for XLFD (maximum 255 chars), return nil. If the 2nd optional arg FOLD-WILDCARDS is non-nil, the consecutive wildcards are folded to one. */) - (font, fold_wildcards) - Lisp_Object font, fold_wildcards; + (Lisp_Object font, Lisp_Object fold_wildcards) { char name[256]; int pixel_size = 0; @@ -4375,7 +4363,7 @@ DEFUN ("clear-font-cache", Fclear_font_cache, Sclear_font_cache, 0, 0, 0, doc: /* Clear font cache. */) - () + (void) { Lisp_Object list, frame; @@ -4436,8 +4424,7 @@ If the shaping was successful, the value is GSTRING itself or a newly created glyph-string. Otherwise, the value is nil. */) - (gstring) - Lisp_Object gstring; + (Lisp_Object gstring) { struct font *font; Lisp_Object font_object, n, glyph; @@ -4514,8 +4501,7 @@ VARIATION-SELECTOR is a chracter code of variation selection (#xFE00..#xFE0F or #xE0100..#xE01EF) GLYPH-ID is a glyph code of the corresponding variation glyph. */) - (font_object, character) - Lisp_Object font_object, character; + (Lisp_Object font_object, Lisp_Object character) { unsigned variations[256]; struct font *font; @@ -4583,8 +4569,7 @@ See the documentation of `font-make-gstring' for the format of glyph-string. */) - (otf_features, gstring_in, from, to, gstring_out, index) - Lisp_Object otf_features, gstring_in, from, to, gstring_out, index; + (Lisp_Object otf_features, Lisp_Object gstring_in, Lisp_Object from, Lisp_Object to, Lisp_Object gstring_out, Lisp_Object index) { Lisp_Object font_object = LGSTRING_FONT (gstring_in); Lisp_Object val; @@ -4634,8 +4619,7 @@ where GLYPH-ID is a glyph index of the font, and CHARACTER is a character code corresponding to the glyph or nil if there's no corresponding character. */) - (font_object, character, otf_features) - Lisp_Object font_object, character, otf_features; + (Lisp_Object font_object, Lisp_Object character, Lisp_Object otf_features) { struct font *font; Lisp_Object gstring_in, gstring_out, g; @@ -4676,10 +4660,7 @@ DEFUN ("open-font", Fopen_font, Sopen_font, 1, 3, 0, doc: /* Open FONT-ENTITY. */) - (font_entity, size, frame) - Lisp_Object font_entity; - Lisp_Object size; - Lisp_Object frame; + (Lisp_Object font_entity, Lisp_Object size, Lisp_Object frame) { int isize; @@ -4705,8 +4686,7 @@ DEFUN ("close-font", Fclose_font, Sclose_font, 1, 2, 0, doc: /* Close FONT-OBJECT. */) - (font_object, frame) - Lisp_Object font_object, frame; + (Lisp_Object font_object, Lisp_Object frame) { CHECK_FONT_OBJECT (font_object); if (NILP (frame)) @@ -4757,8 +4737,7 @@ FEATURE is a symbol representing OpenType feature tag. If the font is not OpenType font, CAPABILITY is nil. */) - (font_object) - Lisp_Object font_object; + (Lisp_Object font_object) { struct font *font; Lisp_Object val; @@ -4782,8 +4761,7 @@ DEFUN ("get-font-glyphs", Fget_font_glyphs, Sget_font_glyphs, 2, 2, 0, doc: /* Return a vector of glyphs of FONT-OBJECT for drawing STRING. Each element is a vector [GLYPH-CODE LBEARING RBEARING WIDTH ASCENT DESCENT]. */) - (font_object, string) - Lisp_Object font_object, string; + (Lisp_Object font_object, Lisp_Object string) { struct font *font; int i, len; @@ -4825,8 +4803,7 @@ DEFUN ("font-match-p", Ffont_match_p, Sfont_match_p, 2, 2, 0, doc: /* Return t if and only if font-spec SPEC matches with FONT. FONT is a font-spec, font-entity, or font-object. */) - (spec, font) - Lisp_Object spec, font; + (Lisp_Object spec, Lisp_Object font) { CHECK_FONT_SPEC (spec); CHECK_FONT (font); @@ -4838,8 +4815,7 @@ doc: /* Return a font-object for displaying a character at POSITION. Optional second arg WINDOW, if non-nil, is a window displaying the current buffer. It defaults to the currently selected window. */) - (position, window, string) - Lisp_Object position, window, string; + (Lisp_Object position, Lisp_Object window, Lisp_Object string) { struct window *w; EMACS_INT pos; @@ -4872,8 +4848,7 @@ doc: /* Draw STRING by FONT-OBJECT on the top left corner of the current frame. The value is a number of glyphs drawn. Type C-l to recover what previously shown. */) - (font_object, string) - Lisp_Object font_object, string; + (Lisp_Object font_object, Lisp_Object string) { Lisp_Object frame = selected_frame; FRAME_PTR f = XFRAME (frame); @@ -4927,8 +4902,7 @@ RELATIVE-COMPOSE and DEFAULT-ASCENT are the numbers controlling how to compose characters. If the named font is not yet loaded, return nil. */) - (name, frame) - Lisp_Object name, frame; + (Lisp_Object name, Lisp_Object frame) { FRAME_PTR f; struct font *font;
--- a/src/fontset.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/fontset.c Thu Jul 08 22:47:34 2010 +0000 @@ -1186,8 +1186,7 @@ PATTERN can contain `*' or `?' as a wildcard just as X font name matching algorithm allows. If REGEXPP is non-nil, PATTERN is a regular expression. */) - (pattern, regexpp) - Lisp_Object pattern, regexpp; + (Lisp_Object pattern, Lisp_Object regexpp) { Lisp_Object fontset; int id; @@ -1435,8 +1434,7 @@ to the font specifications for TARGET previously set. If it is `prepend', FONT-SPEC is prepended. If it is `append', FONT-SPEC is appended. By default, FONT-SPEC overrides the previous settings. */) - (name, target, font_spec, frame, add) - Lisp_Object name, target, font_spec, frame, add; + (Lisp_Object name, Lisp_Object target, Lisp_Object font_spec, Lisp_Object frame, Lisp_Object add) { Lisp_Object fontset; Lisp_Object font_def, registry, family; @@ -1645,8 +1643,7 @@ FONT-SPEC is a vector, a cons, or a string. See the documentation of `set-fontset-font' for the meaning. */) - (name, fontlist) - Lisp_Object name, fontlist; + (Lisp_Object name, Lisp_Object fontlist) { Lisp_Object fontset; int id; @@ -1821,8 +1818,7 @@ DEFUN ("internal-char-font", Finternal_char_font, Sinternal_char_font, 1, 2, 0, doc: /* For internal use only. */) - (position, ch) - Lisp_Object position, ch; + (Lisp_Object position, Lisp_Object ch) { EMACS_INT pos, pos_byte, dummy; int face_id; @@ -1912,8 +1908,7 @@ fontset, the value the extra slot is a char-table containing the information about the derived fonts from the default fontset. The format is the same as above. */) - (fontset, frame) - Lisp_Object fontset, frame; + (Lisp_Object fontset, Lisp_Object frame) { FRAME_PTR f; Lisp_Object *realized[2], fontsets[2], tables[2]; @@ -2048,8 +2043,7 @@ If the 2nd optional arg ALL is non-nil, return a list of all font name patterns. */) - (name, ch, all) - Lisp_Object name, ch, all; + (Lisp_Object name, Lisp_Object ch, Lisp_Object all) { int c; Lisp_Object fontset, elt, list, repertory, val; @@ -2109,7 +2103,7 @@ DEFUN ("fontset-list", Ffontset_list, Sfontset_list, 0, 0, 0, doc: /* Return a list of all defined fontset names. */) - () + (void) { Lisp_Object fontset, list; int i; @@ -2166,7 +2160,7 @@ DEFUN ("fontset-list-all", Ffontset_list_all, Sfontset_list_all, 0, 0, 0, doc: /* Return a brief summary of all fontsets for debug use. */) - () + (void) { Lisp_Object val; int i;
--- a/src/frame.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/frame.c Thu Jul 08 22:47:34 2010 +0000 @@ -213,8 +213,7 @@ `ns' for an Emacs frame on a GNUstep or Macintosh Cocoa display, `pc' for a direct-write MS-DOS frame. See also `frame-live-p'. */) - (object) - Lisp_Object object; + (Lisp_Object object) { if (!FRAMEP (object)) return Qnil; @@ -244,8 +243,7 @@ frame, the return value indicates what sort of terminal device it is displayed on. See the documentation of `framep' for possible return values. */) - (object) - Lisp_Object object; + (Lisp_Object object) { return ((FRAMEP (object) && FRAME_LIVE_P (XFRAME (object))) @@ -259,8 +257,7 @@ The value is nil if Emacs is using a text-only terminal. FRAME defaults to the currently selected frame. */) - (frame) - Lisp_Object frame; + (Lisp_Object frame) { Lisp_Object type; if (NILP (frame)) @@ -658,8 +655,7 @@ Note that changing the size of one terminal frame automatically affects all frames on the same terminal device. */) - (parms) - Lisp_Object parms; + (Lisp_Object parms) { struct frame *f; struct terminal *t = NULL; @@ -886,8 +882,7 @@ next redisplay will display FRAME. This function returns FRAME, or nil if FRAME has been deleted. */) - (frame, norecord) - Lisp_Object frame, norecord; + (Lisp_Object frame, Lisp_Object norecord) { return do_switch_frame (frame, 1, 0, norecord); } @@ -902,8 +897,7 @@ If EVENT is frame object, handle it as if it were a switch-frame event to that frame. */) - (event) - Lisp_Object event; + (Lisp_Object event) { /* Preserve prefix arg that the command loop just cleared. */ current_kboard->Vprefix_arg = Vcurrent_prefix_arg; @@ -913,15 +907,14 @@ DEFUN ("selected-frame", Fselected_frame, Sselected_frame, 0, 0, 0, doc: /* Return the frame that is now selected. */) - () + (void) { return selected_frame; } DEFUN ("window-frame", Fwindow_frame, Swindow_frame, 1, 1, 0, doc: /* Return the frame object that window WINDOW is on. */) - (window) - Lisp_Object window; + (Lisp_Object window) { CHECK_LIVE_WINDOW (window); return XWINDOW (window)->frame; @@ -930,8 +923,7 @@ DEFUN ("frame-first-window", Fframe_first_window, Sframe_first_window, 0, 1, 0, doc: /* Returns the topmost, leftmost window of FRAME. If omitted, FRAME defaults to the currently selected frame. */) - (frame) - Lisp_Object frame; + (Lisp_Object frame) { Lisp_Object w; @@ -957,7 +949,7 @@ DEFUN ("active-minibuffer-window", Factive_minibuffer_window, Sactive_minibuffer_window, 0, 0, 0, doc: /* Return the currently active minibuffer window, or nil if none. */) - () + (void) { return minibuf_level ? minibuf_window : Qnil; } @@ -965,8 +957,7 @@ DEFUN ("frame-root-window", Fframe_root_window, Sframe_root_window, 0, 1, 0, doc: /* Returns the root-window of FRAME. If omitted, FRAME defaults to the currently selected frame. */) - (frame) - Lisp_Object frame; + (Lisp_Object frame) { Lisp_Object window; @@ -985,8 +976,7 @@ Sframe_selected_window, 0, 1, 0, doc: /* Return the selected window of FRAME. FRAME defaults to the currently selected frame. */) - (frame) - Lisp_Object frame; + (Lisp_Object frame) { Lisp_Object window; @@ -1009,8 +999,7 @@ Optional argument NORECORD non-nil means to neither change the order of recently selected windows nor the buffer list. Return WINDOW. */) - (frame, window, norecord) - Lisp_Object frame, window, norecord; + (Lisp_Object frame, Lisp_Object window, Lisp_Object norecord) { if (NILP (frame)) frame = selected_frame; @@ -1031,7 +1020,7 @@ DEFUN ("frame-list", Fframe_list, Sframe_list, 0, 0, 0, doc: /* Return a list of all live frames. */) - () + (void) { Lisp_Object frames; frames = Fcopy_sequence (Vframe_list); @@ -1212,8 +1201,7 @@ If MINIFRAME is `visible', include all visible frames. If MINIFRAME is 0, include all visible and iconified frames. Otherwise, include all frames. */) - (frame, miniframe) - Lisp_Object frame, miniframe; + (Lisp_Object frame, Lisp_Object miniframe) { if (NILP (frame)) frame = selected_frame; @@ -1233,8 +1221,7 @@ If MINIFRAME is `visible', include all visible frames. If MINIFRAME is 0, include all visible and iconified frames. Otherwise, include all frames. */) - (frame, miniframe) - Lisp_Object frame, miniframe; + (Lisp_Object frame, Lisp_Object miniframe) { if (NILP (frame)) frame = selected_frame; @@ -1631,8 +1618,7 @@ This function runs `delete-frame-functions' before actually deleting the frame, unless the frame is a tooltip. The functions are run with one argument, the frame to be deleted. */) - (frame, force) - Lisp_Object frame, force; + (Lisp_Object frame, Lisp_Object force) { return delete_frame (frame, !NILP (force) ? Qt : Qnil); } @@ -1651,7 +1637,7 @@ If `mouse-position-function' is non-nil, `mouse-position' calls it, passing the normal return value to that function as an argument, and returns whatever that function returns. */) - () + (void) { FRAME_PTR f; Lisp_Object lispy_dummy; @@ -1697,7 +1683,7 @@ If Emacs is running on a mouseless terminal or hasn't been programmed to read the mouse position, it returns the selected frame for FRAME and nil for X and Y. */) - () + (void) { FRAME_PTR f; Lisp_Object lispy_dummy; @@ -1734,8 +1720,7 @@ If you have just created a frame, you must wait for it to become visible before calling this function on it, like this. (while (not (frame-visible-p frame)) (sleep-for .5)) */) - (frame, x, y) - Lisp_Object frame, x, y; + (Lisp_Object frame, Lisp_Object x, Lisp_Object y) { CHECK_LIVE_FRAME (frame); CHECK_NUMBER (x); @@ -1776,8 +1761,7 @@ If you have just created a frame, you must wait for it to become visible before calling this function on it, like this. (while (not (frame-visible-p frame)) (sleep-for .5)) */) - (frame, x, y) - Lisp_Object frame, x, y; + (Lisp_Object frame, Lisp_Object x, Lisp_Object y) { CHECK_LIVE_FRAME (frame); CHECK_NUMBER (x); @@ -1814,8 +1798,7 @@ 0, 1, "", doc: /* Make the frame FRAME visible (assuming it is an X window). If omitted, FRAME defaults to the currently selected frame. */) - (frame) - Lisp_Object frame; + (Lisp_Object frame) { if (NILP (frame)) frame = selected_frame; @@ -1874,8 +1857,7 @@ This function has no effect on text-only terminal frames. Such frames are always considered visible, whether or not they are currently being displayed in the terminal. */) - (frame, force) - Lisp_Object frame, force; + (Lisp_Object frame, Lisp_Object force) { if (NILP (frame)) frame = selected_frame; @@ -1916,8 +1898,7 @@ 0, 1, "", doc: /* Make the frame FRAME into an icon. If omitted, FRAME defaults to the currently selected frame. */) - (frame) - Lisp_Object frame; + (Lisp_Object frame) { if (NILP (frame)) frame = selected_frame; @@ -1962,8 +1943,7 @@ If FRAME is a text-only terminal frame, this always returns t. Such frames are always considered visible, whether or not they are currently being displayed on the terminal. */) - (frame) - Lisp_Object frame; + (Lisp_Object frame) { CHECK_LIVE_FRAME (frame); @@ -1979,7 +1959,7 @@ DEFUN ("visible-frame-list", Fvisible_frame_list, Svisible_frame_list, 0, 0, 0, doc: /* Return a list of all frames now \"visible\" (being updated). */) - () + (void) { Lisp_Object tail, frame; struct frame *f; @@ -2005,8 +1985,7 @@ If you don't specify a frame, the selected frame is used. If Emacs is displaying on an ordinary terminal or some other device which doesn't support multiple overlapping frames, this function selects FRAME. */) - (frame) - Lisp_Object frame; + (Lisp_Object frame) { struct frame *f; if (NILP (frame)) @@ -2035,8 +2014,7 @@ If you don't specify a frame, the selected frame is used. If Emacs is displaying on an ordinary terminal or some other device which doesn't support multiple overlapping frames, this function does nothing. */) - (frame) - Lisp_Object frame; + (Lisp_Object frame) { struct frame *f; @@ -2079,8 +2057,7 @@ is affected by `select-frame', while the latter is not. The redirection lasts until `redirect-frame-focus' is called to change it. */) - (frame, focus_frame) - Lisp_Object frame, focus_frame; + (Lisp_Object frame, Lisp_Object focus_frame) { struct frame *f; @@ -2107,8 +2084,7 @@ doc: /* Return the frame to which FRAME's keystrokes are currently being sent. This returns nil if FRAME's focus is not redirected. See `redirect-frame-focus'. */) - (frame) - Lisp_Object frame; + (Lisp_Object frame) { CHECK_LIVE_FRAME (frame); @@ -2329,8 +2305,7 @@ It is a list of elements of the form (PARM . VALUE), where PARM is a symbol. The meaningful PARMs depend on the kind of frame. If FRAME is omitted, return information on the currently selected frame. */) - (frame) - Lisp_Object frame; + (Lisp_Object frame) { Lisp_Object alist; FRAME_PTR f; @@ -2427,8 +2402,7 @@ DEFUN ("frame-parameter", Fframe_parameter, Sframe_parameter, 2, 2, 0, doc: /* Return FRAME's value for parameter PARAMETER. If FRAME is nil, describe the currently selected frame. */) - (frame, parameter) - Lisp_Object frame, parameter; + (Lisp_Object frame, Lisp_Object parameter) { struct frame *f; Lisp_Object value; @@ -2518,8 +2492,7 @@ enabled such bindings for that variable with `make-variable-frame-local'. Note that this functionality is obsolete as of Emacs 22.2, and its use is not recommended. Explicitly check for a frame-parameter instead. */) - (frame, alist) - Lisp_Object frame, alist; + (Lisp_Object frame, Lisp_Object alist) { FRAME_PTR f; register Lisp_Object tail, prop, val; @@ -2584,8 +2557,7 @@ doc: /* Height in pixels of a line in the font in frame FRAME. If FRAME is omitted, the selected frame is used. For a terminal frame, the value is always 1. */) - (frame) - Lisp_Object frame; + (Lisp_Object frame) { struct frame *f; @@ -2609,8 +2581,7 @@ If FRAME is omitted, the selected frame is used. On a graphical screen, the width is the standard width of the default font. For a terminal screen, the value is always 1. */) - (frame) - Lisp_Object frame; + (Lisp_Object frame) { struct frame *f; @@ -2646,8 +2617,7 @@ For a text-only terminal, it includes the menu bar. In this case, the result is really in characters rather than pixels (i.e., is identical to `frame-height'). */) - (frame) - Lisp_Object frame; + (Lisp_Object frame) { struct frame *f; @@ -2669,8 +2639,7 @@ doc: /* Return FRAME's width in pixels. For a terminal frame, the result really gives the width in characters. If FRAME is omitted, the selected frame is used. */) - (frame) - Lisp_Object frame; + (Lisp_Object frame) { struct frame *f; @@ -2691,8 +2660,7 @@ doc: /* Specify that the frame FRAME has LINES lines. Optional third arg non-nil means that redisplay should use LINES lines but that the idea of the actual height of the frame should not be changed. */) - (frame, lines, pretend) - Lisp_Object frame, lines, pretend; + (Lisp_Object frame, Lisp_Object lines, Lisp_Object pretend) { register struct frame *f; @@ -2720,8 +2688,7 @@ doc: /* Specify that the frame FRAME has COLS columns. Optional third arg non-nil means that redisplay should use COLS columns but that the idea of the actual width of the frame should not be changed. */) - (frame, cols, pretend) - Lisp_Object frame, cols, pretend; + (Lisp_Object frame, Lisp_Object cols, Lisp_Object pretend) { register struct frame *f; CHECK_NUMBER (cols); @@ -2746,8 +2713,7 @@ DEFUN ("set-frame-size", Fset_frame_size, Sset_frame_size, 3, 3, 0, doc: /* Sets size of FRAME to COLS by ROWS, measured in characters. */) - (frame, cols, rows) - Lisp_Object frame, cols, rows; + (Lisp_Object frame, Lisp_Object cols, Lisp_Object rows) { register struct frame *f; @@ -2779,8 +2745,7 @@ This is actually the position of the upper left corner of the frame. Negative values for XOFFSET or YOFFSET are interpreted relative to the rightmost or bottommost possible position (that stays within the screen). */) - (frame, xoffset, yoffset) - Lisp_Object frame, xoffset, yoffset; + (Lisp_Object frame, Lisp_Object xoffset, Lisp_Object yoffset) { register struct frame *f; @@ -3833,8 +3798,7 @@ class, respectively. You must specify both of them or neither. If you specify them, the key is `INSTANCE.COMPONENT.ATTRIBUTE' and the class is `Emacs.CLASS.SUBCLASS'. */) - (attribute, class, component, subclass) - Lisp_Object attribute, class, component, subclass; + (Lisp_Object attribute, Lisp_Object class, Lisp_Object component, Lisp_Object subclass) { #ifdef HAVE_X_WINDOWS check_x (); @@ -4047,8 +4011,7 @@ or a list (+ N) meaning N pixels relative to top/left corner, or a list (- N) meaning -N pixels relative to bottom/right corner. On Nextstep, this just calls `ns-parse-geometry'. */) - (string) - Lisp_Object string; + (Lisp_Object string) { #ifdef HAVE_NS call1 (Qns_parse_geometry, string);
--- a/src/fringe.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/fringe.c Thu Jul 08 22:47:34 2010 +0000 @@ -1276,8 +1276,7 @@ 1, 1, 0, doc: /* Destroy fringe bitmap BITMAP. If BITMAP overrides a standard fringe bitmap, the original bitmap is restored. */) - (bitmap) - Lisp_Object bitmap; + (Lisp_Object bitmap) { int n; @@ -1388,8 +1387,7 @@ list (ALIGN PERIODIC) where PERIODIC non-nil specifies that the bitmap should be repeated. If BITMAP already exists, the existing definition is replaced. */) - (bitmap, bits, height, width, align) - Lisp_Object bitmap, bits, height, width, align; + (Lisp_Object bitmap, Lisp_Object bits, Lisp_Object height, Lisp_Object width, Lisp_Object align) { int n, h, i, j; unsigned short *b; @@ -1493,7 +1491,7 @@ xfb = (struct fringe_bitmap *) xmalloc (sizeof fb + fb.height * BYTES_PER_BITMAP_ROW); fb.bits = b = (unsigned short *) (xfb + 1); - bzero (b, fb.height); + memset (b, 0, fb.height); j = 0; while (j < fb.height) @@ -1520,8 +1518,7 @@ 1, 2, 0, doc: /* Set face for fringe bitmap BITMAP to FACE. If FACE is nil, reset face to default fringe face. */) - (bitmap, face) - Lisp_Object bitmap, face; + (Lisp_Object bitmap, Lisp_Object face) { int n; int face_id; @@ -1553,8 +1550,7 @@ RIGHT is similar for the right fringe, and OV is non-nil if there is an overlay arrow in the left fringe. Return nil if POS is not visible in WINDOW. */) - (pos, window) - Lisp_Object pos, window; + (Lisp_Object pos, Lisp_Object window) { struct window *w; struct glyph_row *row;
--- a/src/ftfont.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/ftfont.c Thu Jul 08 22:47:34 2010 +0000 @@ -1365,7 +1365,7 @@ if (ftfont_info->ft_size != ft_face->size) FT_Activate_Size (ftfont_info->ft_size); if (metrics) - bzero (metrics, sizeof (struct font_metrics)); + memset (metrics, 0, sizeof (struct font_metrics)); for (i = 0, first = 1; i < nglyphs; i++) { if (FT_Load_Glyph (ft_face, code[i], FT_LOAD_DEFAULT) == 0)
--- a/src/getloadavg.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/getloadavg.c Thu Jul 08 22:47:34 2010 +0000 @@ -713,7 +713,7 @@ for (i = 0; i < conf.config_maxclass; ++i) { struct class_stats stats; - bzero ((char *) &stats, sizeof stats); + memset (&stats, 0, sizeof stats); desc.sd_type = CPUTYPE_CLASS; desc.sd_objid = i;
--- a/src/image.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/image.c Thu Jul 08 22:47:34 2010 +0000 @@ -625,7 +625,7 @@ /* Make a copy of TYPE to avoid a bus error in a dumped Emacs. The initialized data segment is read-only. */ struct image_type *p = (struct image_type *) xmalloc (sizeof *p); - bcopy (type, p, sizeof *p); + memcpy (p, type, sizeof *p); p->next = image_types; image_types = p; success = Qt; @@ -926,8 +926,7 @@ size in canonical character units. FRAME is the frame on which the image will be displayed. FRAME nil or omitted means use the selected frame. */) - (spec, pixels, frame) - Lisp_Object spec, pixels, frame; + (Lisp_Object spec, Lisp_Object pixels, Lisp_Object frame) { Lisp_Object size; @@ -957,8 +956,7 @@ doc: /* Return t if image SPEC has a mask bitmap. FRAME is the frame on which the image will be displayed. FRAME nil or omitted means use the selected frame. */) - (spec, frame) - Lisp_Object spec, frame; + (Lisp_Object spec, Lisp_Object frame) { Lisp_Object mask; @@ -981,8 +979,7 @@ doc: /* Return metadata for image SPEC. FRAME is the frame on which the image will be displayed. FRAME nil or omitted means use the selected frame. */) - (spec, frame) - Lisp_Object spec, frame; + (Lisp_Object spec, Lisp_Object frame) { Lisp_Object ext; @@ -1020,7 +1017,7 @@ Lisp_Object file = image_spec_value (spec, QCfile, NULL); xassert (valid_image_p (spec)); - bzero (img, sizeof *img); + memset (img, 0, sizeof *img); img->dependencies = NILP (file) ? Qnil : list1 (file); img->type = lookup_image_type (image_spec_value (spec, QCtype, NULL)); xassert (img->type != NULL); @@ -1424,12 +1421,12 @@ struct image_cache *c = (struct image_cache *) xmalloc (sizeof *c); int size; - bzero (c, sizeof *c); + memset (c, 0, sizeof *c); c->size = 50; c->images = (struct image **) xmalloc (c->size * sizeof *c->images); size = IMAGE_CACHE_BUCKETS_SIZE * sizeof *c->buckets; c->buckets = (struct image **) xmalloc (size); - bzero (c->buckets, size); + memset (c->buckets, 0, size); return c; } @@ -1610,8 +1607,7 @@ FILTER t means clear the image caches of all frames. Anything else, means only clear those images which refer to FILTER, which is then usually a filename. */) - (filter) - Lisp_Object filter; + (Lisp_Object filter) { if (!(EQ (filter, Qnil) || FRAMEP (filter))) clear_image_caches (filter); @@ -1631,8 +1627,7 @@ FRAME nil or omitted means use the selected frame. FRAME t means refresh the image on all frames. */) - (spec, frame) - Lisp_Object spec, frame; + (Lisp_Object spec, Lisp_Object frame) { if (!valid_image_p (spec)) error ("Invalid image specification"); @@ -2048,8 +2043,8 @@ return 0; } - header = &((*ximg)->info.bmiHeader); - bzero (&((*ximg)->info), sizeof (BITMAPINFO)); + header = &(*ximg)->info.bmiHeader; + memset (&(*ximg)->info, 0, sizeof (BITMAPINFO)); header->biSize = sizeof (*header); header->biWidth = width; header->biHeight = -height; /* negative indicates a top-down bitmap. */ @@ -2353,7 +2348,7 @@ { struct image_keyword kw[XBM_LAST]; - bcopy (xbm_format, kw, sizeof kw); + memcpy (kw, xbm_format, sizeof kw); if (!parse_image_spec (object, kw, XBM_LAST, Qxbm)) return 0; @@ -2543,7 +2538,7 @@ w1 = (width + 7) / 8; /* nb of 8bits elt in X bitmap */ w2 = ((width + 15) / 16) * 2; /* nb of 16bits elt in W32 bitmap */ bits = (unsigned char *) alloca (height * w2); - bzero (bits, height * w2); + memset (bits, 0, height * w2); for (i = 0; i < height; i++) { p = bits + i*w2; @@ -2918,7 +2913,7 @@ in_memory_file_p = xbm_file_p (data); /* Parse the image specification. */ - bcopy (xbm_format, fmt, sizeof fmt); + memcpy (fmt, xbm_format, sizeof fmt); parsed_p = parse_image_spec (img->spec, fmt, XBM_LAST, Qxbm); xassert (parsed_p); @@ -2964,9 +2959,9 @@ { Lisp_Object line = XVECTOR (data)->contents[i]; if (STRINGP (line)) - bcopy (SDATA (line), p, nbytes); + memcpy (p, SDATA (line), nbytes); else - bcopy (XBOOL_VECTOR (line)->data, p, nbytes); + memcpy (p, XBOOL_VECTOR (line)->data, nbytes); } } else if (STRINGP (data)) @@ -3248,7 +3243,7 @@ with transparency, and it's useful. */ else if (strcmp ("opaque", color_name) == 0) { - bzero (color, sizeof (XColor)); /* Is this necessary/correct? */ + memset (color, 0, sizeof (XColor)); /* Is this necessary/correct? */ color->pixel = FRAME_FOREGROUND_PIXEL (f); p = xpm_cache_color (f, color_name, color, h); } @@ -3337,7 +3332,7 @@ xpm_image_p (Lisp_Object object) { struct image_keyword fmt[XPM_LAST]; - bcopy (xpm_format, fmt, sizeof fmt); + memcpy (fmt, xpm_format, sizeof fmt); return (parse_image_spec (object, fmt, XPM_LAST, Qxpm) /* Either `:file' or `:data' must be present. */ && fmt[XPM_FILE].count + fmt[XPM_DATA].count == 1 @@ -3358,7 +3353,7 @@ XpmAttributes attrs; Pixmap bitmap, mask; - bzero (&attrs, sizeof attrs); + memset (&attrs, 0, sizeof attrs); attrs.visual = FRAME_X_VISUAL (f); attrs.colormap = FRAME_X_COLORMAP (f); @@ -3406,7 +3401,7 @@ /* Configure the XPM lib. Use the visual of frame F. Allocate close colors. Return colors allocated. */ - bzero (&attrs, sizeof attrs); + memset (&attrs, 0, sizeof attrs); #ifndef HAVE_NTGUI attrs.visual = FRAME_X_VISUAL (f); @@ -3453,7 +3448,7 @@ /* Allocate an XpmColorSymbol array. */ size = attrs.numsymbols * sizeof *xpm_syms; xpm_syms = (XpmColorSymbol *) alloca (size); - bzero (xpm_syms, size); + memset (xpm_syms, 0, size); attrs.colorsymbols = xpm_syms; /* Fill the color symbol array. */ @@ -4152,7 +4147,7 @@ { int size = CT_SIZE * sizeof (*ct_table); ct_table = (struct ct_color **) xmalloc (size); - bzero (ct_table, size); + memset (ct_table, 0, size); ct_colors_allocated = 0; } @@ -4848,7 +4843,7 @@ /* Create the bit array serving as mask. */ row_width = (img->width + 7) / 8; mask_img = xmalloc (row_width * img->height); - bzero (mask_img, row_width * img->height); + memset (mask_img, 0, row_width * img->height); /* Create a memory device context for IMG->pixmap. */ frame_dc = get_frame_dc (f); @@ -5000,7 +4995,7 @@ { struct image_keyword fmt[PBM_LAST]; - bcopy (pbm_format, fmt, sizeof fmt); + memcpy (fmt, pbm_format, sizeof fmt); if (!parse_image_spec (object, fmt, PBM_LAST, Qpbm)) return 0; @@ -5212,7 +5207,7 @@ unsigned long bg = FRAME_BACKGROUND_PIXEL (f); /* Parse the image specification. */ - bcopy (pbm_format, fmt, sizeof fmt); + memcpy (fmt, pbm_format, sizeof fmt); parse_image_spec (img->spec, fmt, PBM_LAST, Qpbm); /* Get foreground and background colors, maybe allocate colors. */ @@ -5415,7 +5410,7 @@ png_image_p (Lisp_Object object) { struct image_keyword fmt[PNG_LAST]; - bcopy (png_format, fmt, sizeof fmt); + memcpy (fmt, png_format, sizeof fmt); if (!parse_image_spec (object, fmt, PNG_LAST, Qpng)) return 0; @@ -5554,7 +5549,7 @@ if (length > tbr->len - tbr->index) fn_png_error (png_ptr, "Read error"); - bcopy (tbr->bytes + tbr->index, data, length); + memcpy (data, tbr->bytes + tbr->index, length); tbr->index = tbr->index + length; } @@ -5756,7 +5751,7 @@ { png_color_16 user_bg; - bzero (&user_bg, sizeof user_bg); + memset (&user_bg, 0, sizeof user_bg); user_bg.red = color.red >> shift; user_bg.green = color.green >> shift; user_bg.blue = color.blue >> shift; @@ -5776,7 +5771,7 @@ color.pixel = FRAME_BACKGROUND_PIXEL (f); x_query_color (f, &color); - bzero (&frame_background, sizeof frame_background); + memset (&frame_background, 0, sizeof frame_background); frame_background.red = color.red >> shift; frame_background.green = color.green >> shift; frame_background.blue = color.blue >> shift; @@ -6005,7 +6000,7 @@ { struct image_keyword fmt[JPEG_LAST]; - bcopy (jpeg_format, fmt, sizeof fmt); + memcpy (fmt, jpeg_format, sizeof fmt); if (!parse_image_spec (object, fmt, JPEG_LAST, Qjpeg)) return 0; @@ -6561,7 +6556,7 @@ tiff_image_p (Lisp_Object object) { struct image_keyword fmt[TIFF_LAST]; - bcopy (tiff_format, fmt, sizeof fmt); + memcpy (fmt, tiff_format, sizeof fmt); if (!parse_image_spec (object, fmt, TIFF_LAST, Qtiff)) return 0; @@ -6644,7 +6639,7 @@ if (size > src->len - src->index) return (size_t) -1; - bcopy (src->bytes + src->index, buf, size); + memcpy (buf, src->bytes + src->index, size); src->index += size; return size; } @@ -6999,7 +6994,7 @@ gif_image_p (Lisp_Object object) { struct image_keyword fmt[GIF_LAST]; - bcopy (gif_format, fmt, sizeof fmt); + memcpy (fmt, gif_format, sizeof fmt); if (!parse_image_spec (object, fmt, GIF_LAST, Qgif)) return 0; @@ -7086,7 +7081,7 @@ if (len > src->len - src->index) return -1; - bcopy (src->bytes + src->index, buf, len); + memcpy (buf, src->bytes + src->index, len); src->index += len; return len; } @@ -7222,7 +7217,7 @@ if (!gif_color_map) gif_color_map = gif->SColorMap; init_color_table (); - bzero (pixel_colors, sizeof pixel_colors); + memset (pixel_colors, 0, sizeof pixel_colors); if (gif_color_map) for (i = 0; i < gif_color_map->ColorCount; ++i) @@ -7432,7 +7427,7 @@ svg_image_p (Lisp_Object object) { struct image_keyword fmt[SVG_LAST]; - bcopy (svg_format, fmt, sizeof fmt); + memcpy (fmt, svg_format, sizeof fmt); if (!parse_image_spec (object, fmt, SVG_LAST, Qsvg)) return 0; @@ -7839,7 +7834,7 @@ Lisp_Object tem; int i; - bcopy (gs_format, fmt, sizeof fmt); + memcpy (fmt, gs_format, sizeof fmt); if (!parse_image_spec (object, fmt, GS_LAST, Qpostscript)) return 0; @@ -8049,16 +8044,14 @@ DEFUN ("imagep", Fimagep, Simagep, 1, 1, 0, doc: /* Value is non-nil if SPEC is a valid image specification. */) - (spec) - Lisp_Object spec; + (Lisp_Object spec) { return valid_image_p (spec) ? Qt : Qnil; } DEFUN ("lookup-image", Flookup_image, Slookup_image, 1, 1, 0, "") - (spec) - Lisp_Object spec; + (Lisp_Object spec) { int id = -1; @@ -8093,8 +8086,7 @@ Image types pbm and xbm are prebuilt; other types are loaded here. Libraries to load are specified in alist LIBRARIES (usually, the value of `image-library-alist', which see). */) - (type, libraries) - Lisp_Object type, libraries; + (Lisp_Object type, Lisp_Object libraries) { Lisp_Object tested;
--- a/src/indent.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/indent.c Thu Jul 08 22:47:34 2010 +0000 @@ -312,7 +312,7 @@ however, ^M is treated as end of line when `selective-display' is t. Text that has an invisible property is considered as having width 0, unless `buffer-invisibility-spec' specifies that it is replaced by an ellipsis. */) - () + (void) { Lisp_Object temp; XSETFASTINT (temp, (int) current_column ()); /* iftc */ @@ -546,7 +546,7 @@ w = ! NILP (window) ? XWINDOW (window) : NULL; if (tab_width <= 0 || tab_width > 1000) tab_width = 8; - bzero (&cmp_it, sizeof cmp_it); + memset (&cmp_it, 0, sizeof cmp_it); cmp_it.id = -1; composition_compute_stop_pos (&cmp_it, scan, scan_byte, end, Qnil); @@ -812,8 +812,7 @@ even if that goes past COLUMN; by default, MINIMUM is zero. The return value is COLUMN. */) - (column, minimum) - Lisp_Object column, minimum; + (Lisp_Object column, Lisp_Object minimum) { int mincol; register int fromcol; @@ -864,7 +863,7 @@ doc: /* Return the indentation of the current line. This is the horizontal position of the character following any initial whitespace. */) - () + (void) { Lisp_Object val; int opoint = PT, opoint_byte = PT_BYTE; @@ -998,8 +997,7 @@ COLUMN, add spaces/tabs to get there. The return value is the current column. */) - (column, force) - Lisp_Object column, force; + (Lisp_Object column, Lisp_Object force) { EMACS_INT pos; EMACS_INT col, prev_col; @@ -1214,7 +1212,7 @@ pos_byte = prev_pos_byte = CHAR_TO_BYTE (from); contin_hpos = 0; prev_tab_offset = tab_offset; - bzero (&cmp_it, sizeof cmp_it); + memset (&cmp_it, 0, sizeof cmp_it); cmp_it.id = -1; composition_compute_stop_pos (&cmp_it, pos, pos_byte, to, Qnil); @@ -1757,9 +1755,7 @@ and the window's upper-left coordinates as FROMPOS. Pass the buffer's (point-max) as TO, to limit the scan to the end of the visible section of the buffer, and pass LINE and COL as TOPOS. */) - (from, frompos, to, topos, width, offsets, window) - Lisp_Object from, frompos, to, topos; - Lisp_Object width, offsets, window; + (Lisp_Object from, Lisp_Object frompos, Lisp_Object to, Lisp_Object topos, Lisp_Object width, Lisp_Object offsets, Lisp_Object window) { struct window *w; Lisp_Object bufpos, hpos, vpos, prevhpos; @@ -2001,8 +1997,7 @@ This is consistent with other cursor motion functions and makes it possible to use `vertical-motion' in any buffer, whether or not it is currently displayed in some window. */) - (lines, window) - Lisp_Object lines, window; + (Lisp_Object lines, Lisp_Object window) { struct it it; struct text_pos pt;
--- a/src/insdel.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/insdel.c Thu Jul 08 22:47:34 2010 +0000 @@ -164,28 +164,9 @@ /* Move at most 32000 chars before checking again for a quit. */ if (i > 32000) i = 32000; -#ifdef GAP_USE_BCOPY - if (i >= 128 - /* bcopy is safe if the two areas of memory do not overlap - or on systems where bcopy is always safe for moving upward. */ - && (BCOPY_UPWARD_SAFE - || to - from >= 128)) - { - /* If overlap is not safe, avoid it by not moving too many - characters at once. */ - if (!BCOPY_UPWARD_SAFE && i > to - from) - i = to - from; - new_s1 -= i; - from -= i, to -= i; - bcopy (from, to, i); - } - else -#endif - { - new_s1 -= i; - while (--i >= 0) - *--to = *--from; - } + new_s1 -= i; + from -= i, to -= i; + memmove (to, from, i); } /* Adjust markers, and buffer data structure, to put the gap at BYTEPOS. @@ -238,28 +219,9 @@ /* Move at most 32000 chars before checking again for a quit. */ if (i > 32000) i = 32000; -#ifdef GAP_USE_BCOPY - if (i >= 128 - /* bcopy is safe if the two areas of memory do not overlap - or on systems where bcopy is always safe for moving downward. */ - && (BCOPY_DOWNWARD_SAFE - || from - to >= 128)) - { - /* If overlap is not safe, avoid it by not moving too many - characters at once. */ - if (!BCOPY_DOWNWARD_SAFE && i > from - to) - i = from - to; - new_s1 += i; - bcopy (from, to, i); - from += i, to += i; - } - else -#endif - { - new_s1 += i; - while (--i >= 0) - *to++ = *from++; - } + new_s1 += i; + memmove (to, from, i); + from += i, to += i; } adjust_markers_gap_motion (GPT_BYTE + GAP_SIZE, bytepos + GAP_SIZE, @@ -585,7 +547,7 @@ /* Pretend that the last unwanted part of the gap is the entire gap, and that the first desired part of the gap is part of the buffer text. */ - bzero (GPT_ADDR, new_gap_size); + memset (GPT_ADDR, 0, new_gap_size); GPT += new_gap_size; GPT_BYTE += new_gap_size; Z += new_gap_size; @@ -636,7 +598,7 @@ { if (from_multibyte == to_multibyte) { - bcopy (from_addr, to_addr, nbytes); + memcpy (to_addr, from_addr, nbytes); return nbytes; } else if (from_multibyte) @@ -966,7 +928,7 @@ MODIFF++; CHARS_MODIFF = MODIFF; - bcopy (string, GPT_ADDR, nbytes); + memcpy (GPT_ADDR, string, nbytes); GAP_SIZE -= nbytes; GPT += nchars; @@ -1007,7 +969,7 @@ copy them into the buffer. It does not work to use `insert' for this, because a GC could happen - before we bcopy the stuff into the buffer, and relocate the string + before we copy the stuff into the buffer, and relocate the string without insert noticing. */ void @@ -1182,7 +1144,7 @@ into the current buffer. It does not work to use `insert' for this, because a malloc could happen - and relocate BUF's text before the bcopy happens. */ + and relocate BUF's text before the copy happens. */ void insert_from_buffer (struct buffer *buf, @@ -1712,7 +1674,7 @@ make_gap (insbytes - GAP_SIZE); /* Copy the replacement text into the buffer. */ - bcopy (ins, GPT_ADDR, insbytes); + memcpy (GPT_ADDR, ins, insbytes); #ifdef BYTE_COMBINING_DEBUG /* We have copied text into the gap, but we have not marked @@ -2305,7 +2267,7 @@ DEFUN ("combine-after-change-execute", Fcombine_after_change_execute, Scombine_after_change_execute, 0, 0, 0, doc: /* This function is for use internally in `combine-after-change-calls'. */) - () + (void) { int count = SPECPDL_INDEX (); EMACS_INT beg, end, change;
--- a/src/intervals.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/intervals.c Thu Jul 08 22:47:34 2010 +0000 @@ -1558,7 +1558,7 @@ { register INTERVAL t = make_interval (); - bcopy (source, t, INTERVAL_SIZE); + memcpy (t, source, INTERVAL_SIZE); copy_properties (source, t); SET_INTERVAL_PARENT (t, parent); if (! NULL_LEFT_CHILD (source)) @@ -1574,7 +1574,7 @@ { register INTERVAL t = make_interval (); - bcopy (source, t, INTERVAL_SIZE); + memcpy (t, source, INTERVAL_SIZE); copy_properties (source, t); SET_INTERVAL_OBJECT (t, parent); if (! NULL_LEFT_CHILD (source))
--- a/src/keyboard.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/keyboard.c Thu Jul 08 22:47:34 2010 +0000 @@ -716,7 +716,7 @@ ptr = buffer + offset; } - bcopy (text, ptr, len); + memcpy (ptr, text, len); ptr += len; } @@ -975,7 +975,7 @@ that tells this function to return. Alternatively, `(throw 'exit t)' makes this function signal an error. This function is called by the editor initialization to begin editing. */) - () + (void) { int count = SPECPDL_INDEX (); Lisp_Object buffer; @@ -1366,7 +1366,7 @@ DEFUN ("top-level", Ftop_level, Stop_level, 0, 0, "", doc: /* Exit all recursive editing levels. This also exits all active minibuffers. */) - () + (void) { #ifdef HAVE_WINDOW_SYSTEM if (display_hourglass_p) @@ -1383,7 +1383,7 @@ DEFUN ("exit-recursive-edit", Fexit_recursive_edit, Sexit_recursive_edit, 0, 0, "", doc: /* Exit from the innermost recursive edit or minibuffer. */) - () + (void) { if (command_loop_level > 0 || minibuf_level > 0) Fthrow (Qexit, Qnil); @@ -1394,7 +1394,7 @@ DEFUN ("abort-recursive-edit", Fabort_recursive_edit, Sabort_recursive_edit, 0, 0, "", doc: /* Abort the command that requested this recursive edit or minibuffer input. */) - () + (void) { if (command_loop_level > 0 || minibuf_level > 0) Fthrow (Qexit, Qt); @@ -1435,8 +1435,7 @@ you can read with `read-event'. Normally, mouse motion is ignored. usage: (track-mouse BODY...) */) - (args) - Lisp_Object args; + (Lisp_Object args) { int count = SPECPDL_INDEX (); Lisp_Object val; @@ -3481,13 +3480,13 @@ static void save_getcjmp (jmp_buf temp) { - bcopy (getcjmp, temp, sizeof getcjmp); + memcpy (temp, getcjmp, sizeof getcjmp); } static void restore_getcjmp (jmp_buf temp) { - bcopy (temp, getcjmp, sizeof getcjmp); + memcpy (getcjmp, temp, sizeof getcjmp); } /* Low level keyboard/mouse input. @@ -3675,7 +3674,7 @@ if (hold_quit) { - bcopy (event, (char *) hold_quit, sizeof (*event)); + memcpy (hold_quit, event, sizeof (*event)); return; } @@ -4612,7 +4611,7 @@ The microsecond count is zero on systems that do not provide resolution finer than a second. */) - () + (void) { if (! EMACS_TIME_NEG_P (timer_idleness_start_time)) { @@ -6336,8 +6335,8 @@ new_name = make_uninit_multibyte_string (mod_len + base_len, mod_len + base_len_byte); - bcopy (new_mods, SDATA (new_name), mod_len); - bcopy (base, SDATA (new_name) + mod_len, base_len_byte); + memcpy (SDATA (new_name), new_mods, mod_len); + memcpy (SDATA (new_name) + mod_len, base, base_len_byte); return Fintern (new_name, Qnil); } @@ -6429,8 +6428,7 @@ DEFUN ("internal-event-symbol-parse-modifiers", Fevent_symbol_parse_modifiers, Sevent_symbol_parse_modifiers, 1, 1, 0, doc: /* Parse the event symbol. For internal use. */) - (symbol) - Lisp_Object symbol; + (Lisp_Object symbol) { /* Fill the cache if needed. */ parse_modifiers (symbol); @@ -6659,8 +6657,7 @@ drag, down, double or triple). The base must be last. The return value is an event type (a character or symbol) which has the same base event type and all the specified modifiers. */) - (event_desc) - Lisp_Object event_desc; + (Lisp_Object event_desc) { Lisp_Object base; int modifiers = 0; @@ -7448,7 +7445,7 @@ if (nstored == 0) { - bzero (&buf, sizeof buf); + memset (&buf, 0, sizeof buf); buf.kind = USER_SIGNAL_EVENT; buf.frame_or_window = selected_frame; } @@ -7552,7 +7549,7 @@ nmaps = 0; if (tem = get_local_map (PT, current_buffer, Qkeymap), !NILP (tem)) maps[nmaps++] = tem; - bcopy (tmaps, (void *) (maps + nmaps), nminor * sizeof (maps[0])); + memcpy (maps + nmaps, tmaps, nminor * sizeof (maps[0])); nmaps += nminor; maps[nmaps++] = get_local_map (PT, current_buffer, Qlocal_map); } @@ -7593,9 +7590,9 @@ tem2 = XVECTOR (menu_bar_items_vector)->contents[i + 2]; tem3 = XVECTOR (menu_bar_items_vector)->contents[i + 3]; if (end > i + 4) - bcopy (&XVECTOR (menu_bar_items_vector)->contents[i + 4], - &XVECTOR (menu_bar_items_vector)->contents[i], - (end - i - 4) * sizeof (Lisp_Object)); + memmove (&XVECTOR (menu_bar_items_vector)->contents[i], + &XVECTOR (menu_bar_items_vector)->contents[i + 4], + (end - i - 4) * sizeof (Lisp_Object)); XVECTOR (menu_bar_items_vector)->contents[end - 4] = tem0; XVECTOR (menu_bar_items_vector)->contents[end - 3] = tem1; XVECTOR (menu_bar_items_vector)->contents[end - 2] = tem2; @@ -7640,9 +7637,9 @@ if (EQ (key, XVECTOR (menu_bar_items_vector)->contents[i])) { if (menu_bar_items_index > i + 4) - bcopy (&XVECTOR (menu_bar_items_vector)->contents[i + 4], - &XVECTOR (menu_bar_items_vector)->contents[i], - (menu_bar_items_index - i - 4) * sizeof (Lisp_Object)); + memmove (&XVECTOR (menu_bar_items_vector)->contents[i], + &XVECTOR (menu_bar_items_vector)->contents[i + 4], + (menu_bar_items_index - i - 4) * sizeof (Lisp_Object)); menu_bar_items_index -= 4; } } @@ -8090,7 +8087,7 @@ nmaps = 0; if (tem = get_local_map (PT, current_buffer, Qkeymap), !NILP (tem)) maps[nmaps++] = tem; - bcopy (tmaps, (void *) (maps + nmaps), nminor * sizeof (maps[0])); + memcpy (maps + nmaps, tmaps, nminor * sizeof (maps[0])); nmaps += nminor; maps[nmaps++] = get_local_map (PT, current_buffer, Qlocal_map); } @@ -8140,9 +8137,9 @@ if (EQ (key, v[TOOL_BAR_ITEM_KEY])) { if (ntool_bar_items > i + TOOL_BAR_ITEM_NSLOTS) - bcopy (v + TOOL_BAR_ITEM_NSLOTS, v, - ((ntool_bar_items - i - TOOL_BAR_ITEM_NSLOTS) - * sizeof (Lisp_Object))); + memmove (v, v + TOOL_BAR_ITEM_NSLOTS, + ((ntool_bar_items - i - TOOL_BAR_ITEM_NSLOTS) + * sizeof (Lisp_Object))); ntool_bar_items -= TOOL_BAR_ITEM_NSLOTS; break; } @@ -8425,7 +8422,7 @@ tool_bar_items_vector. */ to = XVECTOR (tool_bar_items_vector)->contents + ntool_bar_items; from = XVECTOR (tool_bar_item_properties)->contents; - bcopy (from, to, TOOL_BAR_ITEM_NSLOTS * sizeof *to); + memcpy (to, from, TOOL_BAR_ITEM_NSLOTS * sizeof *to); ntool_bar_items += TOOL_BAR_ITEM_NSLOTS; } @@ -8718,7 +8715,7 @@ thiswidth = SCHARS (desc); if (thiswidth + i > width) thiswidth = width - i; - bcopy (SDATA (desc), menu + i, thiswidth); + memcpy (menu + i, SDATA (desc), thiswidth); i += thiswidth; strcpy (menu + i, " = "); i += 3; @@ -8728,7 +8725,7 @@ thiswidth = SCHARS (s); if (thiswidth + i > width) thiswidth = width - i; - bcopy (SDATA (s), menu + i, thiswidth); + memcpy (menu + i, SDATA (s), thiswidth); i += thiswidth; menu[i] = 0; } @@ -9212,8 +9209,7 @@ if (!NILP (orig_keymap)) submaps[nmaps++] = orig_keymap; - bcopy (maps, (void *) (submaps + nmaps), - nminor * sizeof (submaps[0])); + memcpy (submaps + nmaps, maps, nminor * sizeof (submaps[0])); nmaps += nminor; @@ -10128,10 +10124,7 @@ that this key sequence is being read by something that will read commands one after another. It should be nil if the caller will read just one key sequence. */) - (prompt, continue_echo, dont_downcase_last, can_return_switch_frame, - command_loop) - Lisp_Object prompt, continue_echo, dont_downcase_last; - Lisp_Object can_return_switch_frame, command_loop; + (Lisp_Object prompt, Lisp_Object continue_echo, Lisp_Object dont_downcase_last, Lisp_Object can_return_switch_frame, Lisp_Object command_loop) { Lisp_Object keybuf[30]; register int i; @@ -10147,7 +10140,7 @@ specbind (Qinput_method_use_echo_area, (NILP (command_loop) ? Qt : Qnil)); - bzero (keybuf, sizeof keybuf); + memset (keybuf, 0, sizeof keybuf); GCPRO1 (keybuf[0]); gcpro1.nvars = (sizeof keybuf/sizeof (keybuf[0])); @@ -10188,10 +10181,7 @@ DEFUN ("read-key-sequence-vector", Fread_key_sequence_vector, Sread_key_sequence_vector, 1, 5, 0, doc: /* Like `read-key-sequence' but always return a vector. */) - (prompt, continue_echo, dont_downcase_last, can_return_switch_frame, - command_loop) - Lisp_Object prompt, continue_echo, dont_downcase_last; - Lisp_Object can_return_switch_frame, command_loop; + (Lisp_Object prompt, Lisp_Object continue_echo, Lisp_Object dont_downcase_last, Lisp_Object can_return_switch_frame, Lisp_Object command_loop) { Lisp_Object keybuf[30]; register int i; @@ -10207,7 +10197,7 @@ specbind (Qinput_method_use_echo_area, (NILP (command_loop) ? Qt : Qnil)); - bzero (keybuf, sizeof keybuf); + memset (keybuf, 0, sizeof keybuf); GCPRO1 (keybuf[0]); gcpro1.nvars = (sizeof keybuf/sizeof (keybuf[0])); @@ -10251,8 +10241,7 @@ when reading the arguments; if it is nil, (this-command-keys) is used. The argument SPECIAL, if non-nil, means that this command is executing a special event, so ignore the prefix argument and don't clear it. */) - (cmd, record_flag, keys, special) - Lisp_Object cmd, record_flag, keys, special; + (Lisp_Object cmd, Lisp_Object record_flag, Lisp_Object keys, Lisp_Object special) { register Lisp_Object final; register Lisp_Object tem; @@ -10341,8 +10330,7 @@ Noninteractively, the argument PREFIXARG is the prefix argument to give to the command you invoke, if it asks for an argument. */) - (prefixarg) - Lisp_Object prefixarg; + (Lisp_Object prefixarg) { Lisp_Object function; char buf[40]; @@ -10572,7 +10560,7 @@ doc: /* Return t if command input is currently available with no wait. Actually, the value is nil only if we can be sure that no input is available; if there is a doubt, the value is t. */) - () + (void) { if (!NILP (Vunread_command_events) || unread_command_char != -1 || !NILP (Vunread_post_input_method_events) @@ -10587,7 +10575,7 @@ DEFUN ("recent-keys", Frecent_keys, Srecent_keys, 0, 0, 0, doc: /* Return vector of last 300 events, not counting those from keyboard macros. */) - () + (void) { Lisp_Object *keys = XVECTOR (recent_keys)->contents; Lisp_Object val; @@ -10597,12 +10585,10 @@ else { val = Fvector (NUM_RECENT_KEYS, keys); - bcopy (keys + recent_keys_index, - XVECTOR (val)->contents, - (NUM_RECENT_KEYS - recent_keys_index) * sizeof (Lisp_Object)); - bcopy (keys, - XVECTOR (val)->contents + NUM_RECENT_KEYS - recent_keys_index, - recent_keys_index * sizeof (Lisp_Object)); + memcpy (XVECTOR (val)->contents, keys + recent_keys_index, + (NUM_RECENT_KEYS - recent_keys_index) * sizeof (Lisp_Object)); + memcpy (XVECTOR (val)->contents + NUM_RECENT_KEYS - recent_keys_index, + keys, recent_keys_index * sizeof (Lisp_Object)); return val; } } @@ -10614,7 +10600,7 @@ The value is a string or a vector. See also `this-command-keys-vector'. */) - () + (void) { return make_event_array (this_command_key_count, XVECTOR (this_command_keys)->contents); @@ -10626,7 +10612,7 @@ the last key sequence that has been read. See also `this-command-keys'. */) - () + (void) { return Fvector (this_command_key_count, XVECTOR (this_command_keys)->contents); @@ -10640,7 +10626,7 @@ Unlike `this-command-keys', this function's value does not include prefix arguments. The value is always a vector. */) - () + (void) { return Fvector (this_command_key_count - this_single_command_key_start, @@ -10656,7 +10642,7 @@ Unlike `this-single-command-keys', this function's value shows the events before all translations (except for input methods). The value is always a vector. */) - () + (void) { return Fvector (raw_keybuf_count, (XVECTOR (raw_keybuf)->contents)); @@ -10674,7 +10660,7 @@ To achieve this, `universal-argument-other-key' calls `reset-this-command-lengths', which discards the record of reading these events the first time. */) - () + (void) { this_command_key_count = before_command_key_count; if (this_command_key_count < this_single_command_key_start) @@ -10694,8 +10680,7 @@ doc: /* Clear out the vector that `this-command-keys' returns. Also clear the record of the last 100 events, unless optional arg KEEP-RECORD is non-nil. */) - (keep_record) - Lisp_Object keep_record; + (Lisp_Object keep_record) { int i; @@ -10714,7 +10699,7 @@ DEFUN ("recursion-depth", Frecursion_depth, Srecursion_depth, 0, 0, 0, doc: /* Return the current depth in recursive edits. */) - () + (void) { Lisp_Object temp; XSETFASTINT (temp, command_loop_level + minibuf_level); @@ -10725,8 +10710,7 @@ "FOpen dribble file: ", doc: /* Start writing all keyboard characters to a dribble file called FILE. If FILE is nil, close any open dribble file. */) - (file) - Lisp_Object file; + (Lisp_Object file) { if (dribble) { @@ -10748,7 +10732,7 @@ DEFUN ("discard-input", Fdiscard_input, Sdiscard_input, 0, 0, 0, doc: /* Discard the contents of the terminal input buffer. Also end any kbd macro being defined. */) - () + (void) { if (!NILP (current_kboard->defining_kbd_macro)) { @@ -10783,8 +10767,7 @@ Some operating systems cannot stop the Emacs process and resume it later. On such systems, Emacs starts a subshell instead of suspending. */) - (stuffstring) - Lisp_Object stuffstring; + (Lisp_Object stuffstring) { int count = SPECPDL_INDEX (); int old_height, old_width; @@ -11104,8 +11087,7 @@ otherwise Emacs uses CBREAK mode. See also `current-input-mode'. */) - (interrupt) - Lisp_Object interrupt; + (Lisp_Object interrupt) { int new_interrupt_input; #ifdef SIGIO @@ -11155,8 +11137,7 @@ Emacs reads input in CBREAK mode; see `set-input-interrupt-mode'. See also `current-input-mode'. */) - (flow, terminal) - Lisp_Object flow, terminal; + (Lisp_Object flow, Lisp_Object terminal) { struct terminal *t = get_terminal (terminal, 1); struct tty_display_info *tty; @@ -11198,8 +11179,7 @@ the currently selected frame. See also `current-input-mode'. */) - (meta, terminal) - Lisp_Object meta, terminal; + (Lisp_Object meta, Lisp_Object terminal) { struct terminal *t = get_terminal (terminal, 1); struct tty_display_info *tty; @@ -11240,8 +11220,7 @@ process. See also `current-input-mode'. */) - (quit) - Lisp_Object quit; + (Lisp_Object quit) { struct terminal *t = get_named_tty ("/dev/tty"); struct tty_display_info *tty; @@ -11278,8 +11257,7 @@ Otherwise, accept 8-bit input and don't use the top bit for Meta. Optional fourth arg QUIT if non-nil specifies character to use for quitting. See also `current-input-mode'. */) - (interrupt, flow, meta, quit) - Lisp_Object interrupt, flow, meta, quit; + (Lisp_Object interrupt, Lisp_Object flow, Lisp_Object meta, Lisp_Object quit) { Fset_input_interrupt_mode (interrupt); Fset_output_flow_control (flow, Qnil); @@ -11303,7 +11281,7 @@ QUIT is the character Emacs currently uses to quit. The elements of this list correspond to the arguments of `set-input-mode'. */) - () + (void) { Lisp_Object val[4]; struct frame *sf = XFRAME (selected_frame); @@ -11337,8 +11315,7 @@ (WINDOW AREA-OR-POS (X . Y) TIMESTAMP OBJECT POS (COL . ROW) IMAGE (DX . DY) (WIDTH . HEIGHT)) The `posn-' functions access elements of such lists. */) - (x, y, frame_or_window, whole) - Lisp_Object x, y, frame_or_window, whole; + (Lisp_Object x, Lisp_Object y, Lisp_Object frame_or_window, Lisp_Object whole) { CHECK_NATNUM (x); CHECK_NATNUM (y); @@ -11378,8 +11355,7 @@ (WINDOW AREA-OR-POS (X . Y) TIMESTAMP OBJECT POS (COL . ROW) IMAGE (DX . DY) (WIDTH . HEIGHT)) The `posn-' functions access elements of such lists. */) - (pos, window) - Lisp_Object pos, window; + (Lisp_Object pos, Lisp_Object window) { Lisp_Object tem;
--- a/src/keymap.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/keymap.c Thu Jul 08 22:47:34 2010 +0000 @@ -142,8 +142,7 @@ The optional arg STRING supplies a menu name for the keymap in case you use it as a menu with `x-popup-menu'. */) - (string) - Lisp_Object string; + (Lisp_Object string) { Lisp_Object tail; if (!NILP (string)) @@ -163,8 +162,7 @@ The optional arg STRING supplies a menu name for the keymap in case you use it as a menu with `x-popup-menu'. */) - (string) - Lisp_Object string; + (Lisp_Object string) { if (!NILP (string)) { @@ -202,8 +200,7 @@ ALIST elements look like (CHAR . DEFN) or (SYMBOL . DEFN); a vector of densely packed bindings for small character codes is also allowed as an element. */) - (object) - Lisp_Object object; + (Lisp_Object object) { return (KEYMAPP (object) ? Qt : Qnil); } @@ -212,8 +209,7 @@ doc: /* Return the prompt-string of a keymap MAP. If non-nil, the prompt is shown in the echo-area when reading a key-sequence to be looked-up in this keymap. */) - (map) - Lisp_Object map; + (Lisp_Object map) { map = get_keymap (map, 0, 0); while (CONSP (map)) @@ -322,8 +318,7 @@ DEFUN ("keymap-parent", Fkeymap_parent, Skeymap_parent, 1, 1, 0, doc: /* Return the parent keymap of KEYMAP. If KEYMAP has no parent, return nil. */) - (keymap) - Lisp_Object keymap; + (Lisp_Object keymap) { return keymap_parent (keymap, 1); } @@ -343,8 +338,7 @@ DEFUN ("set-keymap-parent", Fset_keymap_parent, Sset_keymap_parent, 2, 2, 0, doc: /* Modify KEYMAP to set its parent map to PARENT. Return PARENT. PARENT should be nil or another keymap. */) - (keymap, parent) - Lisp_Object keymap, parent; + (Lisp_Object keymap, Lisp_Object parent) { Lisp_Object list, prev; struct gcpro gcpro1, gcpro2; @@ -729,8 +723,7 @@ FUNCTION is called with two arguments: the event that is bound, and the definition it is bound to. The event may be a character range. If KEYMAP has a parent, this function returns it without processing it. */) - (function, keymap) - Lisp_Object function, keymap; + (Lisp_Object function, Lisp_Object keymap) { struct gcpro gcpro1; GCPRO1 (function); @@ -749,8 +742,7 @@ This works recursively: if the parent has itself a parent, then the grandparent's bindings are also included and so on. usage: (map-keymap FUNCTION KEYMAP) */) - (function, keymap, sort_first) - Lisp_Object function, keymap, sort_first; + (Lisp_Object function, Lisp_Object keymap, Lisp_Object sort_first) { if (! NILP (sort_first)) return call2 (intern ("map-keymap-sorted"), function, keymap); @@ -1094,8 +1086,7 @@ Any key definitions that are subkeymaps are recursively copied. However, a key definition which is a symbol whose definition is a keymap is not copied. */) - (keymap) - Lisp_Object keymap; + (Lisp_Object keymap) { register Lisp_Object copy, tail; keymap = get_keymap (keymap, 1, 0); @@ -1158,10 +1149,7 @@ If KEYMAP is a sparse keymap with a binding for KEY, the existing binding is altered. If there is no binding for KEY, the new pair binding KEY to DEF is added at the front of KEYMAP. */) - (keymap, key, def) - Lisp_Object keymap; - Lisp_Object key; - Lisp_Object def; + (Lisp_Object keymap, Lisp_Object key, Lisp_Object def) { register int idx; register Lisp_Object c; @@ -1277,8 +1265,7 @@ If the optional argument KEYMAPS is non-nil, it should be a list of keymaps to search for command remapping. Otherwise, search for the remapping in all currently active keymaps. */) - (command, position, keymaps) - Lisp_Object command, position, keymaps; + (Lisp_Object command, Lisp_Object position, Lisp_Object keymaps) { if (!SYMBOLP (command)) return Qnil; @@ -1320,10 +1307,7 @@ usable as a general function for probing keymaps. However, if the third optional argument ACCEPT-DEFAULT is non-nil, `lookup-key' will recognize the default bindings, just as `read-key-sequence' does. */) - (keymap, key, accept_default) - Lisp_Object keymap; - Lisp_Object key; - Lisp_Object accept_default; + (Lisp_Object keymap, Lisp_Object key, Lisp_Object accept_default) { register int idx; register Lisp_Object cmd; @@ -1534,7 +1518,8 @@ { if (cmm_modes) { - bcopy (cmm_modes, newmodes, cmm_size * sizeof cmm_modes[0]); + memcpy (newmodes, cmm_modes, + cmm_size * sizeof cmm_modes[0]); free (cmm_modes); } cmm_modes = newmodes; @@ -1545,7 +1530,8 @@ { if (cmm_maps) { - bcopy (cmm_maps, newmaps, cmm_size * sizeof cmm_maps[0]); + memcpy (newmaps, cmm_maps, + cmm_size * sizeof cmm_maps[0]); free (cmm_maps); } cmm_maps = newmaps; @@ -1579,8 +1565,7 @@ OLP if non-nil indicates that we should obey `overriding-local-map' and `overriding-terminal-local-map'. POSITION can specify a click position like in the respective argument of `key-binding'. */) - (olp, position) - Lisp_Object olp, position; + (Lisp_Object olp, Lisp_Object position) { int count = SPECPDL_INDEX (); @@ -1743,8 +1728,7 @@ be a number or marker, in which case the keymap properties at the specified buffer position instead of point are used. */) - (key, accept_default, no_remap, position) - Lisp_Object key, accept_default, no_remap, position; + (Lisp_Object key, Lisp_Object accept_default, Lisp_Object no_remap, Lisp_Object position) { Lisp_Object *maps, value; int nmaps, i; @@ -1934,8 +1918,7 @@ If optional argument ACCEPT-DEFAULT is non-nil, recognize default bindings; see the description of `lookup-key' for more details about this. */) - (keys, accept_default) - Lisp_Object keys, accept_default; + (Lisp_Object keys, Lisp_Object accept_default) { register Lisp_Object map; map = current_buffer->keymap; @@ -1955,8 +1938,7 @@ If optional argument ACCEPT-DEFAULT is non-nil, recognize default bindings; see the description of `lookup-key' for more details about this. */) - (keys, accept_default) - Lisp_Object keys, accept_default; + (Lisp_Object keys, Lisp_Object accept_default) { return Flookup_key (current_global_map, keys, accept_default); } @@ -1975,8 +1957,7 @@ If optional argument ACCEPT-DEFAULT is non-nil, recognize default bindings; see the description of `lookup-key' for more details about this. */) - (key, accept_default) - Lisp_Object key, accept_default; + (Lisp_Object key, Lisp_Object accept_default) { Lisp_Object *modes, *maps; int nmaps; @@ -2015,8 +1996,7 @@ The third optional argument NAME, if given, supplies a menu name string for the map. This is required to use the keymap as a menu. This function returns COMMAND. */) - (command, mapvar, name) - Lisp_Object command, mapvar, name; + (Lisp_Object command, Lisp_Object mapvar, Lisp_Object name) { Lisp_Object map; map = Fmake_sparse_keymap (name); @@ -2030,8 +2010,7 @@ DEFUN ("use-global-map", Fuse_global_map, Suse_global_map, 1, 1, 0, doc: /* Select KEYMAP as the global keymap. */) - (keymap) - Lisp_Object keymap; + (Lisp_Object keymap) { keymap = get_keymap (keymap, 1, 1); current_global_map = keymap; @@ -2042,8 +2021,7 @@ DEFUN ("use-local-map", Fuse_local_map, Suse_local_map, 1, 1, 0, doc: /* Select KEYMAP as the local keymap. If KEYMAP is nil, that means no local keymap. */) - (keymap) - Lisp_Object keymap; + (Lisp_Object keymap) { if (!NILP (keymap)) keymap = get_keymap (keymap, 1, 1); @@ -2056,21 +2034,21 @@ DEFUN ("current-local-map", Fcurrent_local_map, Scurrent_local_map, 0, 0, 0, doc: /* Return current buffer's local keymap, or nil if it has none. Normally the local keymap is set by the major mode with `use-local-map'. */) - () + (void) { return current_buffer->keymap; } DEFUN ("current-global-map", Fcurrent_global_map, Scurrent_global_map, 0, 0, 0, doc: /* Return the current global keymap. */) - () + (void) { return current_global_map; } DEFUN ("current-minor-mode-maps", Fcurrent_minor_mode_maps, Scurrent_minor_mode_maps, 0, 0, 0, doc: /* Return a list of keymaps for the minor modes of the current buffer. */) - () + (void) { Lisp_Object *maps; int nmaps = current_minor_maps (0, &maps); @@ -2158,8 +2136,7 @@ so that the KEYS increase in length. The first element is ([] . KEYMAP). An optional argument PREFIX, if non-nil, should be a key sequence; then the value includes only maps for prefixes that start with PREFIX. */) - (keymap, prefix) - Lisp_Object keymap, prefix; + (Lisp_Object keymap, Lisp_Object prefix) { Lisp_Object maps, tail; int prefixlen = XINT (Flength (prefix)); @@ -2247,8 +2224,7 @@ Optional arg PREFIX is the sequence of keys leading up to KEYS. Control characters turn into "C-foo" sequences, meta into "M-foo", spaces are put between sequence elements, etc. */) - (keys, prefix) - Lisp_Object keys, prefix; + (Lisp_Object keys, Lisp_Object prefix) { int len = 0; int i, i_byte; @@ -2468,8 +2444,7 @@ Control characters turn into C-whatever, etc. Optional argument NO-ANGLES non-nil means don't put angle brackets around function keys and event symbols. */) - (key, no_angles) - Lisp_Object key, no_angles; + (Lisp_Object key, Lisp_Object no_angles) { if (CONSP (key) && lucid_event_type_list_p (key)) key = Fevent_convert_list (key); @@ -2535,8 +2510,7 @@ Also, this function recognizes the 2**7 bit as the Meta character, whereas `single-key-description' uses the 2**27 bit for Meta. See Info node `(elisp)Describing Characters' for examples. */) - (character) - Lisp_Object character; + (Lisp_Object character) { /* Currently MAX_MULTIBYTE_LENGTH is 4 (< 6). */ unsigned char str[6]; @@ -2765,9 +2739,7 @@ If optional 5th arg NO-REMAP is non-nil, don't search for key sequences that invoke a command which is remapped to DEFINITION, but include the remapped command in the returned list. */) - (definition, keymap, firstonly, noindirect, no_remap) - Lisp_Object definition, keymap; - Lisp_Object firstonly, noindirect, no_remap; + (Lisp_Object definition, Lisp_Object keymap, Lisp_Object firstonly, Lisp_Object noindirect, Lisp_Object no_remap) { /* The keymaps in which to search. */ Lisp_Object keymaps; @@ -2988,8 +2960,7 @@ then we display only bindings that start with that prefix. The optional argument MENUS, if non-nil, says to mention menu bindings. \(Ordinarily these are omitted from the output.) */) - (buffer, prefix, menus) - Lisp_Object buffer, prefix, menus; + (Lisp_Object buffer, Lisp_Object prefix, Lisp_Object menus) { Lisp_Object outbuf, shadow; int nomenu = NILP (menus); @@ -3100,12 +3071,12 @@ *p++ = '\f'; *p++ = '\n'; *p++ = '`'; - bcopy (SDATA (SYMBOL_NAME (modes[i])), p, - SCHARS (SYMBOL_NAME (modes[i]))); + memcpy (p, SDATA (SYMBOL_NAME (modes[i])), + SCHARS (SYMBOL_NAME (modes[i]))); p += SCHARS (SYMBOL_NAME (modes[i])); *p++ = '\''; - bcopy (" Minor Mode Bindings", p, sizeof (" Minor Mode Bindings") - 1); - p += sizeof (" Minor Mode Bindings") - 1; + memcpy (p, " Minor Mode Bindings", strlen (" Minor Mode Bindings")); + p += strlen (" Minor Mode Bindings"); *p = 0; describe_map_tree (maps[i], 1, shadow, prefix, @@ -3581,8 +3552,7 @@ doc: /* Insert a description of contents of VECTOR. This is text showing the elements of vector matched against indices. DESCRIBER is the output function used; nil means use `princ'. */) - (vector, describer) - Lisp_Object vector, describer; + (Lisp_Object vector, Lisp_Object describer) { int count = SPECPDL_INDEX (); if (NILP (describer)) @@ -3854,8 +3824,7 @@ If optional 2nd arg PREDICATE is non-nil, (funcall PREDICATE SYMBOL) is done for each symbol and a symbol is mentioned only if that returns non-nil. Return list of symbols found. */) - (regexp, predicate) - Lisp_Object regexp, predicate; + (Lisp_Object regexp, Lisp_Object predicate) { Lisp_Object tem; CHECK_STRING (regexp);
--- a/src/lisp.h Wed Jul 07 22:09:05 2010 +0000 +++ b/src/lisp.h Thu Jul 08 22:47:34 2010 +0000 @@ -647,7 +647,7 @@ (XSTRING (string)->size = (newsize)) #define STRING_COPYIN(string, index, new, count) \ - bcopy (new, SDATA (string) + index, count) + memcpy (SDATA (string) + index, new, count) /* Type checking. */ @@ -2628,7 +2628,6 @@ extern Lisp_Object sit_for (Lisp_Object, int, int); extern void init_display (void); extern void syms_of_display (void); -extern void safe_bcopy (const char *, char *, int); /* Defined in xdisp.c */ extern Lisp_Object Qinhibit_point_motion_hooks; @@ -3400,6 +3399,18 @@ extern int emacs_close (int); extern int emacs_read (int, char *, unsigned int); extern int emacs_write (int, const char *, unsigned int); +#ifndef HAVE_MEMSET +extern void *memset P_ ((void *, int, size_t)); +#endif +#ifndef HAVE_MEMCPY +extern void *memcpy P_ ((void *, void *, size_t)); +#endif +#ifndef HAVE_MEMMOVE +extern void *memmove P_ ((void *, void *, size_t)); +#endif +#ifndef HAVE_MEMCMP +extern int memcmp P_ ((void *, void *, size_t)); +#endif /* Defined in filelock.c */ EXFUN (Funlock_buffer, 0);
--- a/src/lread.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/lread.c Thu Jul 08 22:47:34 2010 +0000 @@ -779,8 +779,7 @@ specifying the maximum number of seconds to wait for input. If no input arrives in that time, return nil. SECONDS may be a floating-point value. */) - (prompt, inherit_input_method, seconds) - Lisp_Object prompt, inherit_input_method, seconds; + (Lisp_Object prompt, Lisp_Object inherit_input_method, Lisp_Object seconds) { Lisp_Object val; @@ -802,8 +801,7 @@ specifying the maximum number of seconds to wait for input. If no input arrives in that time, return nil. SECONDS may be a floating-point value. */) - (prompt, inherit_input_method, seconds) - Lisp_Object prompt, inherit_input_method, seconds; + (Lisp_Object prompt, Lisp_Object inherit_input_method, Lisp_Object seconds) { if (! NILP (prompt)) message_with_string ("%s", prompt, 0); @@ -824,8 +822,7 @@ specifying the maximum number of seconds to wait for input. If no input arrives in that time, return nil. SECONDS may be a floating-point value. */) - (prompt, inherit_input_method, seconds) - Lisp_Object prompt, inherit_input_method, seconds; + (Lisp_Object prompt, Lisp_Object inherit_input_method, Lisp_Object seconds) { Lisp_Object val; @@ -840,7 +837,7 @@ DEFUN ("get-file-char", Fget_file_char, Sget_file_char, 0, 0, 0, doc: /* Don't use this yourself. */) - () + (void) { register Lisp_Object val; BLOCK_INPUT; @@ -925,7 +922,7 @@ doc: /* Return the suffixes that `load' should try if a suffix is \ required. This uses the variables `load-suffixes' and `load-file-rep-suffixes'. */) - () + (void) { Lisp_Object lst = Qnil, suffixes = Vload_suffixes, suffix, ext; while (CONSP (suffixes)) @@ -980,8 +977,7 @@ car is the file name loaded. See `load-history'. Return t if the file exists and loads successfully. */) - (file, noerror, nomessage, nosuffix, must_suffix) - Lisp_Object file, noerror, nomessage, nosuffix, must_suffix; + (Lisp_Object file, Lisp_Object noerror, Lisp_Object nomessage, Lisp_Object nosuffix, Lisp_Object must_suffix) { register FILE *stream; register int fd = -1; @@ -1125,8 +1121,7 @@ specbind (Qold_style_backquotes, Qnil); record_unwind_protect (load_warn_old_style_backquotes, file); - if (!bcmp (SDATA (found) + SBYTES (found) - 4, - ".elc", 4) + if (!memcmp (SDATA (found) + SBYTES (found) - 4, ".elc", 4) || (fd >= 0 && (version = safe_to_load_p (fd)) > 0)) /* Load .elc files directly, but not when they are remote and have no handler! */ @@ -1332,8 +1327,7 @@ If non-nil, PREDICATE is used instead of `file-readable-p'. PREDICATE can also be an integer to pass to the access(2) function, in which case file-name-handlers are ignored. */) - (filename, path, suffixes, predicate) - Lisp_Object filename, path, suffixes, predicate; + (Lisp_Object filename, Lisp_Object path, Lisp_Object suffixes, Lisp_Object predicate) { Lisp_Object file; int fd = openp (path, filename, suffixes, &file, predicate); @@ -1786,8 +1780,7 @@ functions should work normally even if PRINTFLAG is nil. This function preserves the position of point. */) - (buffer, printflag, filename, unibyte, do_allow_print) - Lisp_Object buffer, printflag, filename, unibyte, do_allow_print; + (Lisp_Object buffer, Lisp_Object printflag, Lisp_Object filename, Lisp_Object unibyte, Lisp_Object do_allow_print) { int count = SPECPDL_INDEX (); Lisp_Object tem, buf; @@ -1830,8 +1823,7 @@ which is the input stream for reading characters. This function does not move point. */) - (start, end, printflag, read_function) - Lisp_Object start, end, printflag, read_function; + (Lisp_Object start, Lisp_Object end, Lisp_Object printflag, Lisp_Object read_function) { int count = SPECPDL_INDEX (); Lisp_Object tem, cbuf; @@ -1865,8 +1857,7 @@ a string (takes text from string, starting at the beginning) t (read text line using minibuffer and use it, or read from standard input in batch mode). */) - (stream) - Lisp_Object stream; + (Lisp_Object stream) { if (NILP (stream)) stream = Vstandard_input; @@ -1883,8 +1874,7 @@ Returns a cons: (OBJECT-READ . FINAL-STRING-INDEX). START and END optionally delimit a substring of STRING from which to read; they default to 0 and (length STRING) respectively. */) - (string, start, end) - Lisp_Object string, start, end; + (Lisp_Object string, Lisp_Object start, Lisp_Object end) { Lisp_Object ret; CHECK_STRING (string); @@ -2430,8 +2420,7 @@ invalid_syntax ("#&...", 5); val = Fmake_bool_vector (length, Qnil); - bcopy (SDATA (tmp), XBOOL_VECTOR (val)->data, - size_in_chars); + memcpy (XBOOL_VECTOR (val)->data, SDATA (tmp), size_in_chars); /* Clear the extraneous bits in the last byte. */ if (XINT (length) != size_in_chars * BOOL_VECTOR_BITS_PER_CHAR) XBOOL_VECTOR (val)->data[size_in_chars - 1] @@ -3611,8 +3600,7 @@ If there is none, one is created by this function and returned. A second optional argument specifies the obarray to use; it defaults to the value of `obarray'. */) - (string, obarray) - Lisp_Object string, obarray; + (Lisp_Object string, Lisp_Object obarray) { register Lisp_Object tem, sym, *ptr; @@ -3659,8 +3647,7 @@ symbol is searched for. A second optional argument specifies the obarray to use; it defaults to the value of `obarray'. */) - (name, obarray) - Lisp_Object name, obarray; + (Lisp_Object name, Lisp_Object obarray) { register Lisp_Object tem, string; @@ -3688,8 +3675,7 @@ NAME may be a string or a symbol. If it is a symbol, that symbol is deleted, if it belongs to OBARRAY--no other symbol is deleted. OBARRAY defaults to the value of the variable `obarray'. */) - (name, obarray) - Lisp_Object name, obarray; + (Lisp_Object name, Lisp_Object obarray) { register Lisp_Object string, tem; int hash; @@ -3786,7 +3772,7 @@ { if (SBYTES (SYMBOL_NAME (tail)) == size_byte && SCHARS (SYMBOL_NAME (tail)) == size - && !bcmp (SDATA (SYMBOL_NAME (tail)), ptr, size_byte)) + && !memcmp (SDATA (SYMBOL_NAME (tail)), ptr, size_byte)) return tail; else if (XSYMBOL (tail)->next == 0) break; @@ -3841,8 +3827,7 @@ DEFUN ("mapatoms", Fmapatoms, Smapatoms, 1, 2, 0, doc: /* Call FUNCTION on every symbol in OBARRAY. OBARRAY defaults to the value of `obarray'. */) - (function, obarray) - Lisp_Object function, obarray; + (Lisp_Object function, Lisp_Object obarray) { if (NILP (obarray)) obarray = Vobarray; obarray = check_obarray (obarray);
--- a/src/m/alpha.h Wed Jul 07 22:09:05 2010 +0000 +++ b/src/m/alpha.h Thu Jul 08 22:47:34 2010 +0000 @@ -53,14 +53,9 @@ #define DATA_START 0x140000000 #endif -#if (defined (__NetBSD__) || defined (__OpenBSD__)) -#define HAVE_TEXT_START -#endif - #else /* not __ELF__ */ /* Describe layout of the address space in an executing process. */ -#define TEXT_START 0x120000000 #define DATA_START 0x140000000 #endif /* __ELF__ */
--- a/src/m/ia64.h Wed Jul 07 22:09:05 2010 +0000 +++ b/src/m/ia64.h Thu Jul 08 22:47:34 2010 +0000 @@ -58,7 +58,5 @@ #endif /* not _MALLOC_INTERNAL */ #endif /* REL_ALLOC */ -#define HAVE_TEXT_START - /* arch-tag: 9b8e9fb2-2e49-4c22-b68f-11a488e77c66 (do not change this comment) */
--- a/src/m/ibmrs6000.h Wed Jul 07 22:09:05 2010 +0000 +++ b/src/m/ibmrs6000.h Thu Jul 08 22:47:34 2010 +0000 @@ -22,7 +22,6 @@ /* The data segment in this machine always starts at address 0x20000000. An address of data cannot be stored correctly in a Lisp object; we always lose the high bits. We must tell XPNTR to add them back. */ -#define TEXT_START 0x10000000 #define DATA_START 0x20000000 #define WORDS_BIG_ENDIAN #define DATA_SEG_BITS 0x20000000
--- a/src/m/intel386.h Wed Jul 07 22:09:05 2010 +0000 +++ b/src/m/intel386.h Thu Jul 08 22:47:34 2010 +0000 @@ -23,10 +23,6 @@ is the most significant byte. */ #undef WORDS_BIG_ENDIAN -#ifdef USG -#define TEXT_START 0 -#endif /* USG */ - #ifdef WINDOWSNT #define VIRT_ADDR_VARIES #define DATA_START get_data_start ()
--- a/src/m/iris4d.h Wed Jul 07 22:09:05 2010 +0000 +++ b/src/m/iris4d.h Thu Jul 08 22:47:34 2010 +0000 @@ -30,8 +30,6 @@ This flag only matters if you use USE_LISP_UNION_TYPE. */ #define EXPLICIT_SIGN_EXTEND -#define TEXT_START 0x400000 - /* DATA_SEG_BITS forces extra bits to be or'd in with any pointers which were stored in a Lisp_Object (as Emacs uses fewer than 32 bits for the value field of a LISP_OBJECT). */
--- a/src/m/m68k.h Wed Jul 07 22:09:05 2010 +0000 +++ b/src/m/m68k.h Thu Jul 08 22:47:34 2010 +0000 @@ -41,7 +41,6 @@ #endif #define NO_REMAP -#define TEXT_START 0 #endif /* arch-tag: 4eadd161-b4e8-4b82-82a1-e4ce7f42969d
--- a/src/m/macppc.h Wed Jul 07 22:09:05 2010 +0000 +++ b/src/m/macppc.h Thu Jul 08 22:47:34 2010 +0000 @@ -28,10 +28,6 @@ /* Convert that into an integer that is 100 for a load average of 1.0 */ #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) -#if (defined (__NetBSD__) || defined (__OpenBSD__)) && defined (__ELF__) -#define HAVE_TEXT_START -#endif - #ifdef _ARCH_PPC64 #ifndef _LP64 #define _LP64
--- a/src/m/mips.h Wed Jul 07 22:09:05 2010 +0000 +++ b/src/m/mips.h Thu Jul 08 22:47:34 2010 +0000 @@ -31,8 +31,5 @@ This flag only matters if you use USE_LISP_UNION_TYPE. */ #define EXPLICIT_SIGN_EXTEND -/* Describe layout of the address space in an executing process. */ -#define TEXT_START 0x00400000 - /* arch-tag: 8fd020ee-78a7-4d87-96ce-6129f52f7bee (do not change this comment) */
--- a/src/macros.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/macros.c Thu Jul 08 22:47:34 2010 +0000 @@ -64,8 +64,7 @@ this begins by re-executing that macro as if you typed it again. If optional second arg, NO-EXEC, is non-nil, do not re-execute last macro before appending to it. */) - (append, no_exec) - Lisp_Object append, no_exec; + (Lisp_Object append, Lisp_Object no_exec) { if (!NILP (current_kboard->defining_kbd_macro)) error ("Already defining kbd macro"); @@ -163,8 +162,7 @@ In Lisp, optional second arg LOOPFUNC may be a function that is called prior to each iteration of the macro. Iteration stops if LOOPFUNC returns nil. */) - (repeat, loopfunc) - Lisp_Object repeat, loopfunc; + (Lisp_Object repeat, Lisp_Object loopfunc) { if (NILP (current_kboard->defining_kbd_macro)) error ("Not defining kbd macro"); @@ -230,7 +228,7 @@ DEFUN ("cancel-kbd-macro-events", Fcancel_kbd_macro_events, Scancel_kbd_macro_events, 0, 0, 0, doc: /* Cancel the events added to a keyboard macro for this command. */) - () + (void) { current_kboard->kbd_macro_ptr = current_kboard->kbd_macro_end; return Qnil; @@ -239,8 +237,7 @@ DEFUN ("store-kbd-macro-event", Fstore_kbd_macro_event, Sstore_kbd_macro_event, 1, 1, 0, doc: /* Store EVENT into the keyboard macro being defined. */) - (event) - Lisp_Object event; + (Lisp_Object event) { store_kbd_macro_char (event); return Qnil; @@ -257,8 +254,7 @@ In Lisp, optional second arg LOOPFUNC may be a function that is called prior to each iteration of the macro. Iteration stops if LOOPFUNC returns nil. */) - (prefix, loopfunc) - Lisp_Object prefix, loopfunc; + (Lisp_Object prefix, Lisp_Object loopfunc) { /* Don't interfere with recognition of the previous command from before this macro started. */ @@ -303,8 +299,7 @@ Optional third arg LOOPFUNC may be a function that is called prior to each iteration of the macro. Iteration stops if LOOPFUNC returns nil. */) - (macro, count, loopfunc) - Lisp_Object macro, count, loopfunc; + (Lisp_Object macro, Lisp_Object count, Lisp_Object loopfunc) { Lisp_Object final; Lisp_Object tem;
--- a/src/marker.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/marker.c Thu Jul 08 22:47:34 2010 +0000 @@ -433,8 +433,7 @@ DEFUN ("marker-buffer", Fmarker_buffer, Smarker_buffer, 1, 1, 0, doc: /* Return the buffer that MARKER points into, or nil if none. Returns nil if MARKER points into a dead buffer. */) - (marker) - register Lisp_Object marker; + (register Lisp_Object marker) { register Lisp_Object buf; CHECK_MARKER (marker); @@ -454,8 +453,7 @@ DEFUN ("marker-position", Fmarker_position, Smarker_position, 1, 1, 0, doc: /* Return the position MARKER points at, as a character number. Returns nil if MARKER points nowhere. */) - (marker) - Lisp_Object marker; + (Lisp_Object marker) { CHECK_MARKER (marker); if (XMARKER (marker)->buffer) @@ -470,8 +468,7 @@ If POSITION is nil, makes marker point nowhere. Then it no longer slows down editing in any buffer. Returns MARKER. */) - (marker, position, buffer) - Lisp_Object marker, position, buffer; + (Lisp_Object marker, Lisp_Object position, Lisp_Object buffer) { register int charno, bytepos; register struct buffer *b; @@ -815,8 +812,7 @@ at that position in the current buffer. The optional argument TYPE specifies the insertion type of the new marker; see `marker-insertion-type'. */) - (marker, type) - register Lisp_Object marker, type; + (register Lisp_Object marker, Lisp_Object type) { register Lisp_Object new; @@ -833,8 +829,7 @@ Smarker_insertion_type, 1, 1, 0, doc: /* Return insertion type of MARKER: t if it stays after inserted text. The value nil means the marker stays before text inserted there. */) - (marker) - register Lisp_Object marker; + (register Lisp_Object marker) { CHECK_MARKER (marker); return XMARKER (marker)->insertion_type ? Qt : Qnil; @@ -845,8 +840,7 @@ doc: /* Set the insertion-type of MARKER to TYPE. If TYPE is t, it means the marker advances when you insert text at it. If TYPE is nil, it means the marker stays behind when you insert text at it. */) - (marker, type) - Lisp_Object marker, type; + (Lisp_Object marker, Lisp_Object type) { CHECK_MARKER (marker); @@ -857,8 +851,7 @@ DEFUN ("buffer-has-markers-at", Fbuffer_has_markers_at, Sbuffer_has_markers_at, 1, 1, 0, doc: /* Return t if there are markers pointing at POSITION in the current buffer. */) - (position) - Lisp_Object position; + (Lisp_Object position) { register struct Lisp_Marker *tail; register int charno;
--- a/src/mem-limits.h Wed Jul 07 22:09:05 2010 +0000 +++ b/src/mem-limits.h Thu Jul 08 22:47:34 2010 +0000 @@ -25,17 +25,6 @@ /* Some systems need this before <sys/resource.h>. */ #include <sys/types.h> -#ifdef _LIBC - -#include <sys/resource.h> -#define BSD4_2 /* Tell code below to use getrlimit. */ - -/* Old Linux startup code won't define __data_start. */ -extern int etext, __data_start; weak_extern (__data_start) -#define start_of_data() (&__data_start ?: &etext) - -#else /* not _LIBC */ - #ifdef HAVE_SYS_RESOURCE_H # include <sys/time.h> # include <sys/resource.h> @@ -54,7 +43,6 @@ #include <sys/resource.h> #endif /* BSD4_2 */ -#ifdef emacs /* The important properties of this type are that 1) it's a pointer, and 2) arithmetic on it should work as if the size of the object pointed to has a size of 1. */ @@ -77,26 +65,5 @@ #define EXCEEDS_LISP_PTR(ptr) ((EMACS_UINT) (ptr) >> VALBITS) #endif -#ifdef DATA_START -#define start_of_data() ((char *)DATA_START) -#endif - -#ifdef BSD_SYSTEM -#ifndef DATA_SEG_BITS -#ifndef DATA_START -extern char etext; -#define start_of_data() &etext -#endif -#endif -#endif - -#else /* not emacs */ -extern char etext; -#define start_of_data() &etext -#endif /* not emacs */ - -#endif /* not _LIBC */ - - /* arch-tag: fe39244e-e54f-4208-b7aa-02556f7841c5 (do not change this comment) */
--- a/src/menu.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/menu.c Thu Jul 08 22:47:34 2010 +0000 @@ -1064,8 +1064,7 @@ `x-popup-menu' does not return. But if POSITION is a mouse button event (indicating that the user invoked the menu with the mouse) then no quit occurs and `x-popup-menu' returns nil. */) - (position, menu) - Lisp_Object position, menu; + (Lisp_Object position, Lisp_Object menu) { Lisp_Object keymap, tem; int xpos = 0, ypos = 0;
--- a/src/minibuf.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/minibuf.c Thu Jul 08 22:47:34 2010 +0000 @@ -204,8 +204,7 @@ doc: /* Specify which minibuffer window to use for the minibuffer. This affects where the minibuffer is displayed if you put text in it without invoking the usual minibuffer commands. */) - (window) - Lisp_Object window; + (Lisp_Object window) { CHECK_WINDOW (window); if (! MINI_WINDOW_P (XWINDOW (window))) @@ -340,8 +339,7 @@ doc: /* Return t if BUFFER is a minibuffer. No argument or nil as argument means use current buffer as BUFFER. BUFFER can be a buffer or a buffer name. */) - (buffer) - Lisp_Object buffer; + (Lisp_Object buffer) { Lisp_Object tem; @@ -360,7 +358,7 @@ Sminibuffer_prompt_end, 0, 0, 0, doc: /* Return the buffer position of the end of the minibuffer prompt. Return (point-min) if current buffer is not a minibuffer. */) - () + (void) { /* This function is written to be most efficient when there's a prompt. */ Lisp_Object beg, end, tem; @@ -382,7 +380,7 @@ Sminibuffer_contents, 0, 0, 0, doc: /* Return the user input in a minibuffer as a string. If the current buffer is not a minibuffer, return its entire contents. */) - () + (void) { int prompt_end = XINT (Fminibuffer_prompt_end ()); return make_buffer_string (prompt_end, ZV, 1); @@ -392,7 +390,7 @@ Sminibuffer_contents_no_properties, 0, 0, 0, doc: /* Return the user input in a minibuffer as a string, without text-properties. If the current buffer is not a minibuffer, return its entire contents. */) - () + (void) { int prompt_end = XINT (Fminibuffer_prompt_end ()); return make_buffer_string (prompt_end, ZV, 0); @@ -403,7 +401,7 @@ doc: /* Return the user input in a minibuffer before point as a string. That is what completion commands operate on. If the current buffer is not a minibuffer, return its entire contents. */) - () + (void) { int prompt_end = XINT (Fminibuffer_prompt_end ()); if (PT < prompt_end) @@ -996,9 +994,7 @@ one puts point at the beginning of the string. *Note* that this behavior differs from the way such arguments are used in `completing-read' and some related functions, which use zero-indexing for POSITION. */) - (prompt, initial_contents, keymap, read, hist, default_value, inherit_input_method) - Lisp_Object prompt, initial_contents, keymap, read, hist, default_value; - Lisp_Object inherit_input_method; + (Lisp_Object prompt, Lisp_Object initial_contents, Lisp_Object keymap, Lisp_Object read, Lisp_Object hist, Lisp_Object default_value, Lisp_Object inherit_input_method) { Lisp_Object histvar, histpos, val; struct gcpro gcpro1; @@ -1040,8 +1036,7 @@ is a string to insert in the minibuffer before reading. \(INITIAL-CONTENTS can also be a cons of a string and an integer. Such arguments are used as in `read-from-minibuffer'.) */) - (prompt, initial_contents) - Lisp_Object prompt, initial_contents; + (Lisp_Object prompt, Lisp_Object initial_contents) { CHECK_STRING (prompt); return read_minibuf (Vminibuffer_local_map, initial_contents, @@ -1055,8 +1050,7 @@ is a string to insert in the minibuffer before reading. \(INITIAL-CONTENTS can also be a cons of a string and an integer. Such arguments are used as in `read-from-minibuffer'.) */) - (prompt, initial_contents) - Lisp_Object prompt, initial_contents; + (Lisp_Object prompt, Lisp_Object initial_contents) { return Feval (read_minibuf (Vread_expression_map, initial_contents, prompt, Qnil, 1, Qread_expression_history, @@ -1080,9 +1074,7 @@ empty string. Fifth arg INHERIT-INPUT-METHOD, if non-nil, means the minibuffer inherits the current input method and the setting of `enable-multibyte-characters'. */) - (prompt, initial_input, history, default_value, inherit_input_method) - Lisp_Object prompt, initial_input, history, default_value; - Lisp_Object inherit_input_method; + (Lisp_Object prompt, Lisp_Object initial_input, Lisp_Object history, Lisp_Object default_value, Lisp_Object inherit_input_method) { Lisp_Object val; val = Fread_from_minibuffer (prompt, initial_input, Qnil, @@ -1103,8 +1095,7 @@ not useful in this function.) Third arg INHERIT-INPUT-METHOD, if non-nil, means the minibuffer inherits the current input method and the setting of`enable-multibyte-characters'. */) - (prompt, initial, inherit_input_method) - Lisp_Object prompt, initial, inherit_input_method; + (Lisp_Object prompt, Lisp_Object initial, Lisp_Object inherit_input_method) { CHECK_STRING (prompt); return read_minibuf (Vminibuffer_local_ns_map, initial, prompt, Qnil, @@ -1116,8 +1107,7 @@ doc: /* Read the name of a command and return as a symbol. Prompt with PROMPT. By default, return DEFAULT-VALUE or its first element if it is a list. */) - (prompt, default_value) - Lisp_Object prompt, default_value; + (Lisp_Object prompt, Lisp_Object default_value) { Lisp_Object name, default_string; @@ -1139,8 +1129,7 @@ DEFUN ("read-function", Fread_function, Sread_function, 1, 1, 0, doc: /* One arg PROMPT, a string. Read the name of a function and return as a symbol. Prompt with PROMPT. */) - (prompt) - Lisp_Object prompt; + (Lisp_Object prompt) { return Fintern (Fcompleting_read (prompt, Vobarray, Qfboundp, Qt, Qnil, Qnil, Qnil, Qnil), Qnil); @@ -1152,8 +1141,7 @@ Prompt with PROMPT. By default, return DEFAULT-VALUE or its first element if it is a list. A user variable is one for which `user-variable-p' returns non-nil. */) - (prompt, default_value) - Lisp_Object prompt, default_value; + (Lisp_Object prompt, Lisp_Object default_value) { Lisp_Object name, default_string; @@ -1185,8 +1173,7 @@ case while reading the buffer name. If `read-buffer-function' is non-nil, this works by calling it as a function, instead of the usual behavior. */) - (prompt, def, require_match) - Lisp_Object prompt, def, require_match; + (Lisp_Object prompt, Lisp_Object def, Lisp_Object require_match) { Lisp_Object args[4], result; unsigned char *s; @@ -1286,8 +1273,7 @@ predicate is called with two arguments: the key and the value. Additionally to this predicate, `completion-regexp-list' is used to further constrain the set of candidates. */) - (string, collection, predicate) - Lisp_Object string, collection, predicate; + (Lisp_Object string, Lisp_Object collection, Lisp_Object predicate) { Lisp_Object bestmatch, tail, elt, eltstring; /* Size in bytes of BESTMATCH. */ @@ -1558,8 +1544,7 @@ An obsolete optional fourth argument HIDE-SPACES is still accepted for backward compatibility. If non-nil, strings in COLLECTION that start with a space are ignored unless STRING itself starts with a space. */) - (string, collection, predicate, hide_spaces) - Lisp_Object string, collection, predicate, hide_spaces; + (Lisp_Object string, Lisp_Object collection, Lisp_Object predicate, Lisp_Object hide_spaces) { Lisp_Object tail, elt, eltstring; Lisp_Object allmatches; @@ -1768,9 +1753,7 @@ Completion ignores case if the ambient value of `completion-ignore-case' is non-nil. */) - (prompt, collection, predicate, require_match, initial_input, hist, def, inherit_input_method) - Lisp_Object prompt, collection, predicate, require_match, initial_input; - Lisp_Object hist, def, inherit_input_method; + (Lisp_Object prompt, Lisp_Object collection, Lisp_Object predicate, Lisp_Object require_match, Lisp_Object initial_input, Lisp_Object hist, Lisp_Object def, Lisp_Object inherit_input_method) { Lisp_Object val, histvar, histpos, position; Lisp_Object init; @@ -1845,8 +1828,7 @@ Takes the same arguments as `all-completions' and `try-completion'. If COLLECTION is a function, it is called with three arguments: the values STRING, PREDICATE and `lambda'. */) - (string, collection, predicate) - Lisp_Object string, collection, predicate; + (Lisp_Object string, Lisp_Object collection, Lisp_Object predicate) { Lisp_Object regexps, tail, tem = Qnil; int i = 0; @@ -1964,8 +1946,7 @@ The arguments STRING and PREDICATE are as in `try-completion', `all-completions', and `test-completion'. */) - (string, predicate, flag) - Lisp_Object string, predicate, flag; + (Lisp_Object string, Lisp_Object predicate, Lisp_Object flag) { if (NILP (flag)) return Ftry_completion (string, Vbuffer_alist, predicate); @@ -2009,9 +1990,7 @@ Unlike `assoc', KEY can also match an entry in LIST consisting of a single string, rather than a cons cell whose car is a string. */) - (key, list, case_fold) - register Lisp_Object key; - Lisp_Object list, case_fold; + (register Lisp_Object key, Lisp_Object list, Lisp_Object case_fold) { register Lisp_Object tail; @@ -2040,7 +2019,7 @@ DEFUN ("minibuffer-depth", Fminibuffer_depth, Sminibuffer_depth, 0, 0, 0, doc: /* Return current depth of activations of minibuffer, a nonnegative integer. */) - () + (void) { return make_number (minibuf_level); } @@ -2048,7 +2027,7 @@ DEFUN ("minibuffer-prompt", Fminibuffer_prompt, Sminibuffer_prompt, 0, 0, 0, doc: /* Return the prompt string of the currently-active minibuffer. If no minibuffer is active, return nil. */) - () + (void) { return Fcopy_sequence (minibuf_prompt); }
--- a/src/msdos.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/msdos.c Thu Jul 08 22:47:34 2010 +0000 @@ -35,7 +35,7 @@ #include <sys/time.h> #include <dos.h> #include <errno.h> -#include <string.h> /* for bzero and string functions */ +#include <string.h> /* for memset and string functions */ #include <sys/stat.h> /* for _fixpath */ #include <unistd.h> /* for chdir, dup, dup2, etc. */ #include <dir.h> /* for getdisk */ @@ -195,8 +195,7 @@ This is useful with mice that report the number of buttons inconsistently, e.g., if the number of buttons is reported as 3, but Emacs only sees 2 of them. This happens with wheeled mice on Windows 9X, for example. */) - (nbuttons) - Lisp_Object nbuttons; + (Lisp_Object nbuttons) { int n; @@ -2045,8 +2044,7 @@ DEFUN ("msdos-remember-default-colors", Fmsdos_remember_default_colors, Smsdos_remember_default_colors, 1, 1, 0, doc: /* Remember the screen colors of the current frame. */) - (frame) - Lisp_Object frame; + (Lisp_Object frame) { struct frame *f; @@ -2920,7 +2918,7 @@ doc: /* Return vector of last 100 keyboard input values seen in dos_rawgetc. Each input key receives two values in this vector: first the ASCII code, and then the scan code. */) - () + (void) { Lisp_Object val, *keys = XVECTOR (recent_doskeys)->contents; @@ -2929,12 +2927,10 @@ else { val = Fvector (NUM_RECENT_DOSKEYS, keys); - bcopy (keys + recent_doskeys_index, - XVECTOR (val)->contents, - (NUM_RECENT_DOSKEYS - recent_doskeys_index) * sizeof (Lisp_Object)); - bcopy (keys, - XVECTOR (val)->contents + NUM_RECENT_DOSKEYS - recent_doskeys_index, - recent_doskeys_index * sizeof (Lisp_Object)); + memcpy (XVECTOR (val)->contents, keys + recent_doskeys_index, + (NUM_RECENT_DOSKEYS - recent_doskeys_index) * sizeof (Lisp_Object)); + memcpy (XVECTOR (val)->contents + NUM_RECENT_DOSKEYS - recent_doskeys_index, + keys, recent_doskeys_index * sizeof (Lisp_Object)); return val; } } @@ -3956,7 +3952,7 @@ DEFUN ("msdos-long-file-names", Fmsdos_long_file_names, Smsdos_long_file_names, 0, 0, 0, doc: /* Return non-nil if long file names are supported on MS-DOS. */) - () + (void) { return (_USE_LFN ? Qt : Qnil); } @@ -3990,8 +3986,7 @@ When long filenames are supported, doesn't change FILENAME. If FILENAME is not a string, returns nil. The argument object is never altered--the value is a copy. */) - (filename) - Lisp_Object filename; + (Lisp_Object filename) { Lisp_Object tem;
--- a/src/nsfns.m Wed Jul 07 22:09:05 2010 +0000 +++ b/src/nsfns.m Thu Jul 08 22:47:34 2010 +0000 @@ -1063,8 +1063,7 @@ and do not specify a specific minibuffer window to use, then `default-minibuffer-frame' must be a frame whose minibuffer can be shared by the new frame. */) - (parms) - Lisp_Object parms; + (Lisp_Object parms) { static int desc_ctr = 1; struct frame *f; @@ -1159,7 +1158,7 @@ f->output_method = output_ns; f->output_data.ns = (struct ns_output *)xmalloc (sizeof *(f->output_data.ns)); - bzero (f->output_data.ns, sizeof (*(f->output_data.ns))); + memset (f->output_data.ns, 0, sizeof (*(f->output_data.ns))); FRAME_FONTSET (f) = -1; @@ -1373,8 +1372,7 @@ DEFUN ("x-focus-frame", Fx_focus_frame, Sx_focus_frame, 1, 1, 0, doc: /* Set the input focus to FRAME. FRAME nil means use the selected frame. */) - (frame) - Lisp_Object frame; + (Lisp_Object frame) { struct frame *f = check_ns_frame (frame); struct ns_display_info *dpyinfo = FRAME_NS_DISPLAY_INFO (f); @@ -1395,8 +1393,7 @@ DEFUN ("ns-popup-font-panel", Fns_popup_font_panel, Sns_popup_font_panel, 0, 1, "", doc: /* Pop up the font panel. */) - (frame) - Lisp_Object frame; + (Lisp_Object frame) { id fm; struct frame *f; @@ -1421,8 +1418,7 @@ DEFUN ("ns-popup-color-panel", Fns_popup_color_panel, Sns_popup_color_panel, 0, 1, "", doc: /* Pop up the color panel. */) - (frame) - Lisp_Object frame; + (Lisp_Object frame) { struct frame *f; @@ -1445,8 +1441,7 @@ Optional arg DIR, if non-nil, supplies a default directory. Optional arg ISLOAD, if non-nil, means read a file name for saving. Optional arg INIT, if non-nil, provides a default file name to use. */) - (prompt, dir, isLoad, init) - Lisp_Object prompt, dir, isLoad, init; + (Lisp_Object prompt, Lisp_Object dir, Lisp_Object isLoad, Lisp_Object init) { static id fileDelegate = nil; int ret; @@ -1510,8 +1505,7 @@ DEFUN ("ns-get-resource", Fns_get_resource, Sns_get_resource, 2, 2, 0, doc: /* Return the value of the property NAME of OWNER from the defaults database. If OWNER is nil, Emacs is assumed. */) - (owner, name) - Lisp_Object owner, name; + (Lisp_Object owner, Lisp_Object name) { const char *value; @@ -1535,8 +1529,7 @@ doc: /* Set property NAME of OWNER to VALUE, from the defaults database. If OWNER is nil, Emacs is assumed. If VALUE is nil, the default is removed. */) - (owner, name, value) - Lisp_Object owner, name, value; + (Lisp_Object owner, Lisp_Object name, Lisp_Object value) { check_ns (); if (NILP (owner)) @@ -1564,8 +1557,7 @@ Sx_server_max_request_size, 0, 1, 0, doc: /* This function is a no-op. It is only present for completeness. */) - (display) - Lisp_Object display; + (Lisp_Object display) { check_ns (); /* This function has no real equivalent under NeXTstep. Return nil to @@ -1578,8 +1570,7 @@ doc: /* Return the vendor ID string of Nextstep display server DISPLAY. DISPLAY should be either a frame or a display name (a string). If omitted or nil, the selected frame's display is used. */) - (display) - Lisp_Object display; + (Lisp_Object display) { #ifdef NS_IMPL_GNUSTEP return build_string ("GNU"); @@ -1598,8 +1589,7 @@ The optional argument DISPLAY specifies which display to ask about. DISPLAY should be either a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) - Lisp_Object display; + (Lisp_Object display) { /*NOTE: it is unclear what would best correspond with "protocol"; we return 10.3, meaning Panther, since this is roughly the @@ -1617,8 +1607,7 @@ doc: /* Return the number of screens on Nextstep display server DISPLAY. DISPLAY should be a frame, the display name as a string, or a terminal ID. If omitted or nil, the selected frame's display is used. */) - (display) - Lisp_Object display; + (Lisp_Object display) { int num; @@ -1634,8 +1623,7 @@ doc: /* Return the height of Nextstep display server DISPLAY, in millimeters. DISPLAY should be a frame, the display name as a string, or a terminal ID. If omitted or nil, the selected frame's display is used. */) - (display) - Lisp_Object display; + (Lisp_Object display) { check_ns (); return make_number ((int) @@ -1648,8 +1636,7 @@ doc: /* Return the width of Nextstep display server DISPLAY, in millimeters. DISPLAY should be a frame, the display name as a string, or a terminal ID. If omitted or nil, the selected frame's display is used. */) - (display) - Lisp_Object display; + (Lisp_Object display) { check_ns (); return make_number ((int) @@ -1663,8 +1650,7 @@ The value may be `buffered', `retained', or `non-retained'. DISPLAY should be a frame, the display name as a string, or a terminal ID. If omitted or nil, the selected frame's display is used. */) - (display) - Lisp_Object display; + (Lisp_Object display) { check_ns (); switch ([ns_get_window (display) backingType]) @@ -1689,8 +1675,7 @@ `static-color', `pseudo-color', `true-color', or `direct-color'. DISPLAY should be a frame, the display name as a string, or a terminal ID. If omitted or nil, the selected frame's display is used. */) - (display) - Lisp_Object display; + (Lisp_Object display) { NSWindowDepth depth; check_ns (); @@ -1718,8 +1703,7 @@ The optional argument DISPLAY specifies which display to ask about. DISPLAY should be a frame, the display name as a string, or a terminal ID. If omitted or nil, the selected frame's display is used. */) - (display) - Lisp_Object display; + (Lisp_Object display) { check_ns (); switch ([ns_get_window (display) backingType]) @@ -1743,8 +1727,7 @@ doc: /* Open a connection to a Nextstep display server. DISPLAY is the name of the display to connect to. Optional arguments XRM-STRING and MUST-SUCCEED are currently ignored. */) - (display, resource_string, must_succeed) - Lisp_Object display, resource_string, must_succeed; + (Lisp_Object display, Lisp_Object resource_string, Lisp_Object must_succeed) { struct ns_display_info *dpyinfo; @@ -1782,8 +1765,7 @@ 1, 1, 0, doc: /* Close the connection to the current Nextstep display server. The argument DISPLAY is currently ignored. */) - (display) - Lisp_Object display; + (Lisp_Object display) { check_ns (); /*ns_delete_terminal (dpyinfo->terminal); */ @@ -1794,7 +1776,7 @@ DEFUN ("x-display-list", Fx_display_list, Sx_display_list, 0, 0, 0, doc: /* Return the list of display names that Emacs has connections to. */) - () + (void) { Lisp_Object tail, result; @@ -1809,7 +1791,7 @@ DEFUN ("ns-hide-others", Fns_hide_others, Sns_hide_others, 0, 0, 0, doc: /* Hides all applications other than Emacs. */) - () + (void) { check_ns (); [NSApp hideOtherApplications: NSApp]; @@ -1822,8 +1804,7 @@ Otherwise if Emacs is hidden, it is unhidden. If ON is equal to `activate', Emacs is unhidden and becomes the active application. */) - (on) - Lisp_Object on; + (Lisp_Object on) { check_ns (); if (EQ (on, intern ("activate"))) @@ -1842,7 +1823,7 @@ DEFUN ("ns-emacs-info-panel", Fns_emacs_info_panel, Sns_emacs_info_panel, 0, 0, 0, doc: /* Shows the 'Info' or 'About' panel for Emacs. */) - () + (void) { check_ns (); [NSApp orderFrontStandardAboutPanel: nil]; @@ -1855,8 +1836,7 @@ NAME should be a string containing either the font name or an XLFD font descriptor. If string contains `fontset' and not `fontset-startup', it is left alone. */) - (name) - Lisp_Object name; + (Lisp_Object name) { char *nm; CHECK_STRING (name); @@ -1874,8 +1854,7 @@ DEFUN ("ns-list-colors", Fns_list_colors, Sns_list_colors, 0, 1, 0, doc: /* Return a list of all available colors. The optional argument FRAME is currently ignored. */) - (frame) - Lisp_Object frame; + (Lisp_Object frame) { Lisp_Object list = Qnil; NSEnumerator *colorlists; @@ -1914,7 +1893,7 @@ DEFUN ("ns-list-services", Fns_list_services, Sns_list_services, 0, 0, 0, doc: /* List available Nextstep services by querying NSApp. */) - () + (void) { Lisp_Object ret = Qnil; NSMenu *svcs; @@ -1968,8 +1947,7 @@ SEND should be either a string or nil. The return value is the result of the service, as string, or nil if there was no result. */) - (service, send) - Lisp_Object service, send; + (Lisp_Object service, Lisp_Object send) { id pb; NSString *svcName; @@ -1997,8 +1975,7 @@ DEFUN ("ns-convert-utf8-nfd-to-nfc", Fns_convert_utf8_nfd_to_nfc, Sns_convert_utf8_nfd_to_nfc, 1, 1, 0, doc: /* Return an NFC string that matches the UTF-8 NFD string STR. */) - (str) - Lisp_Object str; + (Lisp_Object str) { /* TODO: If GNUstep ever implements precomposedStringWithCanonicalMapping, remove this. */ @@ -2085,8 +2062,7 @@ If compilation and execution are successful, the resulting script value is returned as a string, a number or, in the case of other constructs, t. In case the execution fails, an error is signaled. */) - (script) - Lisp_Object script; + (Lisp_Object script) { Lisp_Object result; long status; @@ -2231,8 +2207,7 @@ DEFUN ("xw-color-defined-p", Fxw_color_defined_p, Sxw_color_defined_p, 1, 2, 0, doc: /* Return t if the current Nextstep display supports the color COLOR. The optional argument FRAME is currently ignored. */) - (color, frame) - Lisp_Object color, frame; + (Lisp_Object color, Lisp_Object frame) { NSColor * col; check_ns (); @@ -2242,8 +2217,7 @@ DEFUN ("xw-color-values", Fxw_color_values, Sxw_color_values, 1, 2, 0, doc: /* Internal function called by `color-values', which see. */) - (color, frame) - Lisp_Object color, frame; + (Lisp_Object color, Lisp_Object frame) { NSColor * col; CGFloat red, green, blue, alpha; @@ -2267,8 +2241,7 @@ The optional argument DISPLAY specifies which display to ask about. DISPLAY should be either a frame, a display name (a string), or terminal ID. If omitted or nil, that stands for the selected frame's display. */) - (display) - Lisp_Object display; + (Lisp_Object display) { NSWindowDepth depth; NSString *colorSpace; @@ -2289,8 +2262,7 @@ The optional argument DISPLAY specifies which display to ask about. DISPLAY should be either a frame, a display name (a string), or terminal ID. If omitted or nil, that stands for the selected frame's display. */) - (display) - Lisp_Object display; + (Lisp_Object display) { NSWindowDepth depth; check_ns (); @@ -2306,8 +2278,7 @@ The optional argument DISPLAY specifies which display to ask about. DISPLAY should be either a frame, a display name (a string), or terminal ID. If omitted or nil, that stands for the selected frame's display. */) - (display) - Lisp_Object display; + (Lisp_Object display) { check_ns (); return make_number ((int) [ns_get_screen (display) frame].size.width); @@ -2320,8 +2291,7 @@ The optional argument DISPLAY specifies which display to ask about. DISPLAY should be either a frame, a display name (a string), or terminal ID. If omitted or nil, that stands for the selected frame's display. */) - (display) - Lisp_Object display; + (Lisp_Object display) { check_ns (); return make_number ((int) [ns_get_screen (display) frame].size.height); @@ -2338,8 +2308,7 @@ The screen queried corresponds to DISPLAY, which should be either a frame, a display name (a string), or terminal ID. If omitted or nil, that stands for the selected frame's display. */) - (display) - Lisp_Object display; + (Lisp_Object display) { int top; NSScreen *screen; @@ -2368,8 +2337,7 @@ The optional argument DISPLAY specifies which display to ask about. DISPLAY should be either a frame, a display name (a string), or terminal ID. If omitted or nil, that stands for the selected frame's display. */) - (display) - Lisp_Object display; + (Lisp_Object display) { check_ns (); return make_number @@ -2383,8 +2351,7 @@ The optional argument DISPLAY specifies which display to ask about. DISPLAY should be either a frame, a display name (a string), or terminal ID. If omitted or nil, that stands for the selected frame's display. */) - (display) - Lisp_Object display; + (Lisp_Object display) { struct ns_display_info *dpyinfo; check_ns (); @@ -2482,8 +2449,7 @@ A tooltip's maximum size is specified by `x-max-tooltip-size'. Text larger than the specified size is clipped. */) - (string, frame, parms, timeout, dx, dy) - Lisp_Object string, frame, parms, timeout, dx, dy; + (Lisp_Object string, Lisp_Object frame, Lisp_Object parms, Lisp_Object timeout, Lisp_Object dx, Lisp_Object dy) { int root_x, root_y; struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; @@ -2539,7 +2505,7 @@ DEFUN ("x-hide-tip", Fx_hide_tip, Sx_hide_tip, 0, 0, 0, doc: /* Hide the current tooltip window, if there is any. Value is t if tooltip was open, nil otherwise. */) - () + (void) { if (ns_tooltip == nil || ![ns_tooltip isActive]) return Qnil;
--- a/src/nsfont.m Wed Jul 07 22:09:05 2010 +0000 +++ b/src/nsfont.m Thu Jul 08 22:47:34 2010 +0000 @@ -776,8 +776,8 @@ xmalloc (0x100 * sizeof (struct font_metrics *)); if (!font_info->glyphs || !font_info->metrics) return Qnil; - bzero (font_info->glyphs, 0x100 * sizeof (unsigned short *)); - bzero (font_info->metrics, 0x100 * sizeof (struct font_metrics *)); + memset (font_info->glyphs, 0, 0x100 * sizeof (unsigned short *)); + memset (font_info->metrics, 0, 0x100 * sizeof (struct font_metrics *)); BLOCK_INPUT; @@ -816,8 +816,8 @@ [font_info->nsfont retain]; /* set up ns_font (defined in nsgui.h) */ - font_info->name = (char *)xmalloc (strlen (fontName) + 1); - bcopy (fontName, font_info->name, strlen (fontName) + 1); + font_info->name = (char *)xmalloc (strlen (fontName)+1); + strcpy (font_info->name, fontName); font_info->bold = [fontMgr traitsOfFont: nsfont] & NSBoldFontMask; font_info->ital = synthItal || ([fontMgr traitsOfFont: nsfont] & NSItalicFontMask); @@ -972,7 +972,7 @@ int totalWidth = 0; int i; - bzero (metrics, sizeof (struct font_metrics)); + memset (metrics, 0, sizeof (struct font_metrics)); for (i =0; i<nglyphs; i++) { @@ -1395,7 +1395,7 @@ sfont = [font_info->nsfont screenFont]; font_info->metrics[block] = xmalloc (0x100 * sizeof (struct font_metrics)); - bzero (font_info->metrics[block], 0x100 * sizeof (struct font_metrics)); + memset (font_info->metrics[block], 0, 0x100 * sizeof (struct font_metrics)); if (!(font_info->metrics[block])) abort ();
--- a/src/nsimage.m Wed Jul 07 22:09:05 2010 +0000 +++ b/src/nsimage.m Thu Jul 08 22:47:34 2010 +0000 @@ -315,9 +315,9 @@ [self addRepresentation: bmRep]; - bzero (planes[0], w*h); - bzero (planes[1], w*h); - bzero (planes[2], w*h); + memset (planes[0], 0, w*h); + memset (planes[1], 0, w*h); + memset (planes[2], 0, w*h); [self setXBMColor: [NSColor blackColor]]; return self; } @@ -379,7 +379,7 @@ [bmRep getBitmapDataPlanes: pixmapData]; for (i =0; i<4; i++) - bzero (pixmapData[i], width*height); + memset (pixmapData[i], 0, width*height); [self addRepresentation: bmRep]; return self; }
--- a/src/nsmenu.m Wed Jul 07 22:09:05 2010 +0000 +++ b/src/nsmenu.m Thu Jul 08 22:47:34 2010 +0000 @@ -219,8 +219,8 @@ /* Save the frame's previous menu bar contents data */ if (previous_menu_items_used) - bcopy (XVECTOR (f->menu_bar_vector)->contents, previous_items, - previous_menu_items_used * sizeof (Lisp_Object)); + memcpy (previous_items, XVECTOR (f->menu_bar_vector)->contents, + previous_menu_items_used * sizeof (Lisp_Object)); /* parse stage 1: extract from lisp */ save_menu_items (); @@ -1752,7 +1752,7 @@ DEFUN ("ns-reset-menu", Fns_reset_menu, Sns_reset_menu, 0, 0, 0, doc: /* Cause the NS menu to be re-calculated. */) - () + (void) { set_frame_menubar (SELECTED_FRAME (), 1, 0); return Qnil; @@ -1782,15 +1782,14 @@ If the user gets rid of the dialog box without making a valid choice, for instance using the window manager, then this produces a quit and `x-popup-dialog' does not return. */) - (position, contents, header) - Lisp_Object position, contents, header; + (Lisp_Object position, Lisp_Object contents, Lisp_Object header) { return ns_popup_dialog (position, contents, header); } DEFUN ("menu-or-popup-active-p", Fmenu_or_popup_active_p, Smenu_or_popup_active_p, 0, 0, 0, doc: /* Return t if a menu or popup dialog is active. */) - () + (void) { return popup_activated () ? Qt : Qnil; }
--- a/src/nsselect.m Wed Jul 07 22:09:05 2010 +0000 +++ b/src/nsselect.m Thu Jul 08 22:47:34 2010 +0000 @@ -378,8 +378,7 @@ SELECTION-NAME is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'. VALUE is typically a string, or a cons of two markers, but may be anything that the functions on `selection-converter-alist' know about. */) - (selection_name, selection_value) - Lisp_Object selection_name, selection_value; + (Lisp_Object selection_name, Lisp_Object selection_value) { id pb; Lisp_Object old_value, new_value; @@ -413,8 +412,7 @@ DEFUN ("x-disown-selection-internal", Fx_disown_selection_internal, Sx_disown_selection_internal, 1, 2, 0, doc: /* If we own the selection SELECTION, disown it. */) - (selection_name, time) - Lisp_Object selection_name, time; + (Lisp_Object selection_name, Lisp_Object time) { id pb; check_ns (); @@ -434,8 +432,7 @@ \(Those are literal upper-case symbol names.) For convenience, the symbol nil is the same as `PRIMARY', and t is the same as `SECONDARY'.) */) - (selection) - Lisp_Object selection; + (Lisp_Object selection) { id pb; NSArray *types; @@ -458,8 +455,7 @@ \(Those are literal upper-case symbol names.) For convenience, the symbol nil is the same as `PRIMARY', and t is the same as `SECONDARY'.) */) - (selection) - Lisp_Object selection; + (Lisp_Object selection) { check_ns (); CHECK_SYMBOL (selection); @@ -475,8 +471,7 @@ SELECTION is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'. \(Those are literal upper-case symbol names.) TYPE is the type of data desired, typically `STRING'. */) - (selection_name, target_type) - Lisp_Object selection_name, target_type; + (Lisp_Object selection_name, Lisp_Object target_type) { Lisp_Object val; @@ -501,8 +496,7 @@ DEFUN ("ns-get-cut-buffer-internal", Fns_get_cut_buffer_internal, Sns_get_cut_buffer_internal, 1, 1, 0, doc: /* Returns the value of the named cut buffer. */) - (buffer) - Lisp_Object buffer; + (Lisp_Object buffer) { id pb; check_ns (); @@ -516,8 +510,7 @@ doc: /* Rotate the values of the cut buffers by N steps. Positive N means move values forward, negative means backward. CURRENTLY NOT IMPLEMENTED UNDER NEXTSTEP. */ ) - (n) - Lisp_Object n; + (Lisp_Object n) { /* XXX This function is unimplemented under NeXTstep XXX */ Fsignal (Qquit, Fcons (build_string ( @@ -529,8 +522,7 @@ DEFUN ("ns-store-cut-buffer-internal", Fns_store_cut_buffer_internal, Sns_store_cut_buffer_internal, 2, 2, 0, doc: /* Sets the value of the named cut buffer (typically CUT_BUFFER0). */) - (buffer, string) - Lisp_Object buffer, string; + (Lisp_Object buffer, Lisp_Object string) { id pb; check_ns ();
--- a/src/nsterm.m Wed Jul 07 22:09:05 2010 +0000 +++ b/src/nsterm.m Thu Jul 08 22:47:34 2010 +0000 @@ -2163,11 +2163,11 @@ { EmacsImage **newBimgs = xmalloc (max_used_fringe_bitmap * sizeof (EmacsImage *)); - bzero (newBimgs, max_used_fringe_bitmap * sizeof (EmacsImage *)); + memset (newBimgs, 0, max_used_fringe_bitmap * sizeof (EmacsImage *)); if (nBimgs) { - bcopy (bimgs, newBimgs, nBimgs * sizeof (EmacsImage *)); + memcpy (newBimgs, bimgs, nBimgs * sizeof (EmacsImage *)); xfree (bimgs); } @@ -3707,7 +3707,7 @@ name: nil object: nil]; */ dpyinfo = (struct ns_display_info *)xmalloc (sizeof (struct ns_display_info)); - bzero (dpyinfo, sizeof (struct ns_display_info)); + memset (dpyinfo, 0, sizeof (struct ns_display_info)); ns_initialize_display_info (dpyinfo); terminal = ns_create_terminal (dpyinfo);
--- a/src/prefix-args.c Wed Jul 07 22:09:05 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,82 +0,0 @@ -/* prefix-args.c - echo each argument, prefixed by a string. - Copyright (C) 1992, 2001, 2002, 2003, 2004, 2005, 2006, 2007, - 2008, 2009, 2010 Free Software Foundation, Inc. - -This file is part of GNU Emacs. - -GNU Emacs is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -GNU Emacs is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ - -/* Jim Blandy <jimb@occs.cs.oberlin.edu> - September 1992 - - When using GCC 2 as the linker in the build process, options - intended for the linker need to be prefixed with the "-Xlinker" - option. If an option takes an argument, we need to use -Xlinker - twice - once for the option and once for its argument. For - example, to run the linker with the options "-Bstatic" "-e" - "_start", you'd need to pass the following options to GCC: - - -Xlinker -Bstatic -Xlinker -e -Xlinker _start. - - The Emacs makefile used to use a Bourne Shell `for' loop to prefix - each linker option with "-Xlinker", but 1) the for loop was hairier - than one might hope because it had to work when there were no - arguments to pass to the linker - the shell barfs on a loop like - this: - - for arg in ; do echo -Xlinker "$arg"; done - - and 2) the whole compilation command containing this loop seems to - exit with a non-zero status and halt the build under Ultrix. - - If I can't write a completely portable program to do this in C, - I'm quitting and taking up gardening. */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#if STDC_HEADERS -# include <stdlib.h> /* for proper declaration of `exit' */ -#endif - -#include <stdio.h> -#include <stdlib.h> - -int -main (int argc, char **argv) -{ - char *progname; - char *prefix; - - progname = argv[0]; - argc--, argv++; - - if (argc < 1) - { - fprintf (stderr, "Usage: %s PREFIX ARGS...\n\ -Echo each ARG preceded by PREFIX and a space.\n", progname); - exit (2); - } - - prefix = argv[0]; - argc--, argv++; - - for (; argc > 0; argc--, argv++) - printf ("%s %s%c", prefix, argv[0], (argc > 1) ? ' ' : '\n'); - - exit (0); -} - -/* arch-tag: 08136d70-e5c0-49c7-bcd8-b4850233977a - (do not change this comment) */
--- a/src/print.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/print.c Thu Jul 08 22:47:34 2010 +0000 @@ -289,7 +289,7 @@ static Lisp_Object print_unwind (Lisp_Object saved_text) { - bcopy (SDATA (saved_text), print_buffer, SCHARS (saved_text)); + memcpy (print_buffer, SDATA (saved_text), SCHARS (saved_text)); return Qnil; } @@ -316,7 +316,7 @@ if (print_buffer_pos_byte + len >= print_buffer_size) print_buffer = (char *) xrealloc (print_buffer, print_buffer_size *= 2); - bcopy (str, print_buffer + print_buffer_pos_byte, len); + memcpy (print_buffer + print_buffer_pos_byte, str, len); print_buffer_pos += 1; print_buffer_pos_byte += len; } @@ -364,7 +364,7 @@ print_buffer = (char *) xrealloc (print_buffer, print_buffer_size); } - bcopy (ptr, print_buffer + print_buffer_pos_byte, size_byte); + memcpy (print_buffer + print_buffer_pos_byte, ptr, size_byte); print_buffer_pos += size; print_buffer_pos_byte += size_byte; } @@ -461,7 +461,7 @@ if (chars < bytes) { newstr = make_uninit_multibyte_string (chars, bytes); - bcopy (SDATA (string), SDATA (newstr), chars); + memcpy (SDATA (newstr), SDATA (string), chars); str_to_multibyte (SDATA (newstr), bytes, chars); string = newstr; } @@ -480,7 +480,7 @@ USE_SAFE_ALLOCA; SAFE_ALLOCA (buffer, char *, nbytes); - bcopy (SDATA (string), buffer, nbytes); + memcpy (buffer, SDATA (string), nbytes); strout (buffer, chars, SBYTES (string), printcharfun, STRING_MULTIBYTE (string)); @@ -522,8 +522,7 @@ DEFUN ("write-char", Fwrite_char, Swrite_char, 1, 2, 0, doc: /* Output character CHARACTER to stream PRINTCHARFUN. PRINTCHARFUN defaults to the value of `standard-output' (which see). */) - (character, printcharfun) - Lisp_Object character, printcharfun; + (Lisp_Object character, Lisp_Object printcharfun) { PRINTDECLARE; @@ -653,8 +652,7 @@ if it uses `temp-buffer-show-function'. usage: (with-output-to-temp-buffer BUFNAME BODY...) */) - (args) - Lisp_Object args; + (Lisp_Object args) { struct gcpro gcpro1; Lisp_Object name; @@ -686,8 +684,7 @@ DEFUN ("terpri", Fterpri, Sterpri, 0, 1, 0, doc: /* Output a newline to stream PRINTCHARFUN. If PRINTCHARFUN is omitted or nil, the value of `standard-output' is used. */) - (printcharfun) - Lisp_Object printcharfun; + (Lisp_Object printcharfun) { PRINTDECLARE; @@ -722,8 +719,7 @@ If PRINTCHARFUN is omitted, the value of `standard-output' (which see) is used instead. */) - (object, printcharfun) - Lisp_Object object, printcharfun; + (Lisp_Object object, Lisp_Object printcharfun) { PRINTDECLARE; @@ -749,8 +745,7 @@ a list, a buffer, a window, a frame, etc. A printed representation of an object is text which describes that object. */) - (object, noescape) - Lisp_Object object, noescape; + (Lisp_Object object, Lisp_Object noescape) { Lisp_Object printcharfun; /* struct gcpro gcpro1, gcpro2; */ @@ -818,8 +813,7 @@ If PRINTCHARFUN is omitted, the value of `standard-output' (which see) is used instead. */) - (object, printcharfun) - Lisp_Object object, printcharfun; + (Lisp_Object object, Lisp_Object printcharfun) { PRINTDECLARE; @@ -854,8 +848,7 @@ If PRINTCHARFUN is omitted, the value of `standard-output' (which see) is used instead. */) - (object, printcharfun) - Lisp_Object object, printcharfun; + (Lisp_Object object, Lisp_Object printcharfun) { PRINTDECLARE; struct gcpro gcpro1; @@ -880,8 +873,7 @@ doc: /* Write CHARACTER to stderr. You can call print while debugging emacs, and pass it this function to make it write to the debugging output. */) - (character) - Lisp_Object character; + (Lisp_Object character) { CHECK_NUMBER (character); putc (XINT (character), stderr); @@ -923,8 +915,7 @@ If FILE is nil, reset target to the initial stderr stream. Optional arg APPEND non-nil (interactively, with prefix arg) means append to existing target file. */) - (file, append) - Lisp_Object file, append; + (Lisp_Object file, Lisp_Object append) { if (initial_stderr_stream != NULL) { @@ -982,8 +973,7 @@ doc: /* Convert an error value (ERROR-SYMBOL . DATA) to an error message. See Info anchor `(elisp)Definition of signal' for some details on how this error message is constructed. */) - (obj) - Lisp_Object obj; + (Lisp_Object obj) { struct buffer *old = current_buffer; Lisp_Object value; @@ -1032,7 +1022,7 @@ { Lisp_Object cname = SYMBOL_NAME (caller); char *name = alloca (SBYTES (cname)); - bcopy (SDATA (cname), name, SBYTES (cname)); + memcpy (name, SDATA (cname), SBYTES (cname)); message_dolog (name, SBYTES (cname), 0, 0); message_dolog (": ", 2, 0, 0); }
--- a/src/process.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/process.c Thu Jul 08 22:47:34 2010 +0000 @@ -680,16 +680,14 @@ DEFUN ("processp", Fprocessp, Sprocessp, 1, 1, 0, doc: /* Return t if OBJECT is a process. */) - (object) - Lisp_Object object; + (Lisp_Object object) { return PROCESSP (object) ? Qt : Qnil; } DEFUN ("get-process", Fget_process, Sget_process, 1, 1, 0, doc: /* Return the process named NAME, or nil if there is none. */) - (name) - register Lisp_Object name; + (register Lisp_Object name) { if (PROCESSP (name)) return name; @@ -700,8 +698,7 @@ DEFUN ("get-buffer-process", Fget_buffer_process, Sget_buffer_process, 1, 1, 0, doc: /* Return the (or a) process associated with BUFFER. BUFFER may be a buffer or the name of one. */) - (buffer) - register Lisp_Object buffer; + (register Lisp_Object buffer) { register Lisp_Object buf, tail, proc; @@ -770,8 +767,7 @@ doc: /* Delete PROCESS: kill it and forget about it immediately. PROCESS may be a process, a buffer, the name of a process or buffer, or nil, indicating the current buffer's process. */) - (process) - register Lisp_Object process; + (register Lisp_Object process) { register struct Lisp_Process *p; @@ -838,8 +834,7 @@ nil -- if arg is a process name and no such process exists. PROCESS may be a process, a buffer, the name of a process, or nil, indicating the current buffer's process. */) - (process) - register Lisp_Object process; + (register Lisp_Object process) { register struct Lisp_Process *p; register Lisp_Object status; @@ -874,8 +869,7 @@ 1, 1, 0, doc: /* Return the exit status of PROCESS or the signal number that killed it. If PROCESS has not yet exited or died, return 0. */) - (process) - register Lisp_Object process; + (register Lisp_Object process) { CHECK_PROCESS (process); if (XPROCESS (process)->raw_status_new) @@ -889,8 +883,7 @@ doc: /* Return the process id of PROCESS. This is the pid of the external process which PROCESS uses or talks to. For a network connection, this value is nil. */) - (process) - register Lisp_Object process; + (register Lisp_Object process) { /* Assignment to EMACS_INT stops GCC whining about limited range of data type. */ @@ -905,8 +898,7 @@ doc: /* Return the name of PROCESS, as a string. This is the name of the program invoked in PROCESS, possibly modified to make it unique among process names. */) - (process) - register Lisp_Object process; + (register Lisp_Object process) { CHECK_PROCESS (process); return XPROCESS (process)->name; @@ -918,8 +910,7 @@ and the rest of the strings being the arguments given to it. For a network or serial process, this is nil (process is running) or t \(process is stopped). */) - (process) - register Lisp_Object process; + (register Lisp_Object process) { CHECK_PROCESS (process); return XPROCESS (process)->command; @@ -929,8 +920,7 @@ doc: /* Return the name of the terminal PROCESS uses, or nil if none. This is the terminal that the process itself reads and writes on, not the name of the pty that Emacs uses to talk with that terminal. */) - (process) - register Lisp_Object process; + (register Lisp_Object process) { CHECK_PROCESS (process); return XPROCESS (process)->tty_name; @@ -939,8 +929,7 @@ DEFUN ("set-process-buffer", Fset_process_buffer, Sset_process_buffer, 2, 2, 0, doc: /* Set buffer associated with PROCESS to BUFFER (a buffer, or nil). */) - (process, buffer) - register Lisp_Object process, buffer; + (register Lisp_Object process, Lisp_Object buffer) { struct Lisp_Process *p; @@ -959,8 +948,7 @@ 1, 1, 0, doc: /* Return the buffer PROCESS is associated with. Output from PROCESS is inserted in this buffer unless PROCESS has a filter. */) - (process) - register Lisp_Object process; + (register Lisp_Object process) { CHECK_PROCESS (process); return XPROCESS (process)->buffer; @@ -969,8 +957,7 @@ DEFUN ("process-mark", Fprocess_mark, Sprocess_mark, 1, 1, 0, doc: /* Return the marker for the end of the last output from PROCESS. */) - (process) - register Lisp_Object process; + (register Lisp_Object process) { CHECK_PROCESS (process); return XPROCESS (process)->mark; @@ -992,8 +979,7 @@ - if `default-enable-multibyte-characters' is nil, it is a unibyte string (the result of converting the decoded input multibyte string to unibyte with `string-make-unibyte'). */) - (process, filter) - register Lisp_Object process, filter; + (register Lisp_Object process, Lisp_Object filter) { struct Lisp_Process *p; @@ -1035,8 +1021,7 @@ 1, 1, 0, doc: /* Returns the filter function of PROCESS; nil if none. See `set-process-filter' for more info on filter functions. */) - (process) - register Lisp_Object process; + (register Lisp_Object process) { CHECK_PROCESS (process); return XPROCESS (process)->filter; @@ -1047,8 +1032,7 @@ doc: /* Give PROCESS the sentinel SENTINEL; nil for none. The sentinel is called as a function when the process changes state. It gets two arguments: the process, and a string describing the change. */) - (process, sentinel) - register Lisp_Object process, sentinel; + (register Lisp_Object process, Lisp_Object sentinel) { struct Lisp_Process *p; @@ -1065,8 +1049,7 @@ 1, 1, 0, doc: /* Return the sentinel of PROCESS; nil if none. See `set-process-sentinel' for more info on sentinels. */) - (process) - register Lisp_Object process; + (register Lisp_Object process) { CHECK_PROCESS (process); return XPROCESS (process)->sentinel; @@ -1075,8 +1058,7 @@ DEFUN ("set-process-window-size", Fset_process_window_size, Sset_process_window_size, 3, 3, 0, doc: /* Tell PROCESS that it has logical window size HEIGHT and WIDTH. */) - (process, height, width) - register Lisp_Object process, height, width; + (register Lisp_Object process, Lisp_Object height, Lisp_Object width) { CHECK_PROCESS (process); CHECK_NATNUM (height); @@ -1107,8 +1089,7 @@ Binding the variable `inherit-process-coding-system' to non-nil before starting the process is an alternative way of setting the inherit flag for the process which will run. */) - (process, flag) - register Lisp_Object process, flag; + (register Lisp_Object process, Lisp_Object flag) { CHECK_PROCESS (process); XPROCESS (process)->inherit_coding_system_flag = !NILP (flag); @@ -1122,8 +1103,7 @@ If this flag is t, `buffer-file-coding-system' of the buffer associated with PROCESS will inherit the coding system used to decode the process output. */) - (process) - register Lisp_Object process; + (register Lisp_Object process) { CHECK_PROCESS (process); return XPROCESS (process)->inherit_coding_system_flag ? Qt : Qnil; @@ -1135,8 +1115,7 @@ doc: /* Specify if query is needed for PROCESS when Emacs is exited. If the second argument FLAG is non-nil, Emacs will query the user before exiting or killing a buffer if PROCESS is running. */) - (process, flag) - register Lisp_Object process, flag; + (register Lisp_Object process, Lisp_Object flag) { CHECK_PROCESS (process); XPROCESS (process)->kill_without_query = NILP (flag); @@ -1147,8 +1126,7 @@ Fprocess_query_on_exit_flag, Sprocess_query_on_exit_flag, 1, 1, 0, doc: /* Return the current value of query-on-exit flag for PROCESS. */) - (process) - register Lisp_Object process; + (register Lisp_Object process) { CHECK_PROCESS (process); return (XPROCESS (process)->kill_without_query ? Qnil : Qt); @@ -1168,8 +1146,7 @@ connection is returned, else the specific value for the keyword KEY is returned. See `make-network-process' or `make-serial-process' for a list of keywords. */) - (process, key) - register Lisp_Object process, key; + (register Lisp_Object process, Lisp_Object key) { Lisp_Object contact; @@ -1197,8 +1174,7 @@ DEFUN ("process-plist", Fprocess_plist, Sprocess_plist, 1, 1, 0, doc: /* Return the plist of PROCESS. */) - (process) - register Lisp_Object process; + (register Lisp_Object process) { CHECK_PROCESS (process); return XPROCESS (process)->plist; @@ -1207,8 +1183,7 @@ DEFUN ("set-process-plist", Fset_process_plist, Sset_process_plist, 2, 2, 0, doc: /* Replace the plist of PROCESS with PLIST. Returns PLIST. */) - (process, plist) - register Lisp_Object process, plist; + (register Lisp_Object process, Lisp_Object plist) { CHECK_PROCESS (process); CHECK_LIST (plist); @@ -1223,8 +1198,7 @@ doc: /* Return the connection type of PROCESS. The value is nil for a pipe, t or `pty' for a pty, or `stream' for a socket connection. */) - (process) - Lisp_Object process; + (Lisp_Object process) { return XPROCESS (process)->type; } @@ -1235,8 +1209,7 @@ The value is either the symbol `real', `network', or `serial'. PROCESS may be a process, a buffer, the name of a process or buffer, or nil, indicating the current buffer's process. */) - (process) - Lisp_Object process; + (Lisp_Object process) { Lisp_Object proc; proc = get_process (process); @@ -1252,8 +1225,7 @@ If optional second argument OMIT-PORT is non-nil, don't include a port number in the string, even when present in ADDRESS. Returns nil if format of ADDRESS is invalid. */) - (address, omit_port) - Lisp_Object address, omit_port; + (Lisp_Object address, Lisp_Object omit_port) { if (NILP (address)) return Qnil; @@ -1555,8 +1527,7 @@ the query-on-exit flag set will be listed. Any process listed as exited or signaled is actually eliminated after the listing is made. */) - (query_only) - Lisp_Object query_only; + (Lisp_Object query_only) { internal_with_output_to_temp_buffer ("*Process List*", list_processes_1, query_only); @@ -1565,7 +1536,7 @@ DEFUN ("process-list", Fprocess_list, Sprocess_list, 0, 0, 0, doc: /* Return a list of all processes. */) - () + (void) { return Fmapcar (Qcdr, Vprocess_alist); } @@ -1593,9 +1564,7 @@ syntax. usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */) - (nargs, args) - int nargs; - register Lisp_Object *args; + (int nargs, register Lisp_Object *args) { Lisp_Object buffer, name, program, proc, current_dir, tem; register unsigned char **new_argv; @@ -2440,7 +2409,7 @@ register unsigned char *cp = NULL; register int i; - bzero (sa, len); + memset (sa, 0, len); if (VECTORP (address)) { @@ -2504,8 +2473,7 @@ DEFUN ("process-datagram-address", Fprocess_datagram_address, Sprocess_datagram_address, 1, 1, 0, doc: /* Get the current datagram address associated with PROCESS. */) - (process) - Lisp_Object process; + (Lisp_Object process) { int channel; @@ -2523,8 +2491,7 @@ 2, 2, 0, doc: /* Set the datagram address for PROCESS to ADDRESS. Returns nil upon error setting address, ADDRESS otherwise. */) - (process, address) - Lisp_Object process, address; + (Lisp_Object process, Lisp_Object address) { int channel; int family, len; @@ -2635,12 +2602,12 @@ /* This is broken, at least in the Linux 2.4 kernel. To unbind, the arg must be a zero integer, not the empty string. This should work on all systems. KFS. 2003-09-23. */ - bzero (devname, sizeof devname); + memset (devname, 0, sizeof devname); if (STRINGP (val)) { char *arg = (char *) SDATA (val); int len = min (strlen (arg), IFNAMSIZ); - bcopy (arg, devname, len); + memcpy (devname, arg, len); } else if (!NILP (val)) error ("Bad option value for %s", name); @@ -2685,9 +2652,7 @@ See `make-network-process' for a list of options and values. If optional fourth arg NO-ERROR is non-nil, don't signal an error if OPTION is not a supported option, return nil instead; otherwise return t. */) - (process, option, value, no_error) - Lisp_Object process, option, value; - Lisp_Object no_error; + (Lisp_Object process, Lisp_Object option, Lisp_Object value, Lisp_Object no_error) { int s; struct Lisp_Process *p; @@ -2774,9 +2739,7 @@ \(serial-process-configure :port "\\\\.\\COM13" :bytesize 7) usage: (serial-process-configure &rest ARGS) */) - (nargs, args) - int nargs; - Lisp_Object *args; + (int nargs, Lisp_Object *args) { struct Lisp_Process *p; Lisp_Object contact = Qnil; @@ -2893,9 +2856,7 @@ \(make-serial-process :port "/dev/tty.BlueConsole-SPP-1" :speed nil) usage: (make-serial-process &rest ARGS) */) - (nargs, args) - int nargs; - Lisp_Object *args; + (int nargs, Lisp_Object *args) { int fd = -1; Lisp_Object proc, contact, port; @@ -3174,9 +3135,7 @@ information, is available via the `process-contact' function. usage: (make-network-process &rest ARGS) */) - (nargs, args) - int nargs; - Lisp_Object *args; + (int nargs, Lisp_Object *args) { Lisp_Object proc; Lisp_Object contact; @@ -3349,7 +3308,7 @@ host = Qnil; } CHECK_STRING (service); - bzero (&address_un, sizeof address_un); + memset (&address_un, 0, sizeof address_un); address_un.sun_family = AF_LOCAL; strncpy (address_un.sun_path, SDATA (service), sizeof address_un.sun_path); ai.ai_addr = (struct sockaddr *) &address_un; @@ -3433,7 +3392,7 @@ port = svc_info->s_port; } - bzero (&address_in, sizeof address_in); + memset (&address_in, 0, sizeof address_in); address_in.sin_family = family; address_in.sin_addr.s_addr = INADDR_ANY; address_in.sin_port = port; @@ -3457,8 +3416,8 @@ if (host_info_ptr) { - bcopy (host_info_ptr->h_addr, (char *) &address_in.sin_addr, - host_info_ptr->h_length); + memcpy (&address_in.sin_addr, host_info_ptr->h_addr, + host_info_ptr->h_length); family = host_info_ptr->h_addrtype; address_in.sin_family = family; } @@ -3470,8 +3429,8 @@ if (numeric_addr == -1) error ("Unknown host \"%s\"", SDATA (host)); - bcopy ((char *)&numeric_addr, (char *) &address_in.sin_addr, - sizeof (address_in.sin_addr)); + memcpy (&address_in.sin_addr, &numeric_addr, + sizeof (address_in.sin_addr)); } } @@ -3655,7 +3614,7 @@ if (is_server) { Lisp_Object remote; - bzero (datagram_address[s].sa, lres->ai_addrlen); + memset (datagram_address[s].sa, 0, lres->ai_addrlen); if (remote = Fplist_get (contact, QCremote), !NILP (remote)) { int rfamily, rlen; @@ -3666,7 +3625,7 @@ } } else - bcopy (lres->ai_addr, datagram_address[s].sa, lres->ai_addrlen); + memcpy (datagram_address[s].sa, lres->ai_addr, lres->ai_addrlen); } #endif contact = Fplist_put (contact, QCaddress, @@ -3890,7 +3849,7 @@ Each element is a cons, the car of which is a string containing the interface name, and the cdr is the network address in internal format; see the description of ADDRESS in `make-network-process'. */) - () + (void) { struct ifconf ifconf; struct ifreq *ifreqs = NULL; @@ -3933,7 +3892,7 @@ char namebuf[sizeof (ifq->ifr_name) + 1]; if (ifq->ifr_addr.sa_family != AF_INET) continue; - bcopy (ifq->ifr_name, namebuf, sizeof (ifq->ifr_name)); + memcpy (namebuf, ifq->ifr_name, sizeof (ifq->ifr_name)); namebuf[sizeof (ifq->ifr_name)] = 0; res = Fcons (Fcons (build_string (namebuf), conv_sockaddr_to_lisp (&ifq->ifr_addr, @@ -4025,8 +3984,7 @@ where ADDR is the layer 3 address, BCAST is the layer 3 broadcast address, NETMASK is the layer 3 network mask, HWADDR is the layer 2 addres, and FLAGS is the current flags of the interface. */) - (ifname) - Lisp_Object ifname; + (Lisp_Object ifname) { struct ifreq rq; Lisp_Object res = Qnil; @@ -4036,7 +3994,7 @@ CHECK_STRING (ifname); - bzero (rq.ifr_name, sizeof rq.ifr_name); + memset (rq.ifr_name, 0, sizeof rq.ifr_name); strncpy (rq.ifr_name, SDATA (ifname), sizeof (rq.ifr_name)); s = socket (AF_INET, SOCK_STREAM, 0); @@ -4234,8 +4192,7 @@ from PROCESS, suspending reading output from other processes. If JUST-THIS-ONE is an integer, don't run any timers either. Return non-nil if we received any output before the timeout expired. */) - (process, seconds, millisec, just_this_one) - register Lisp_Object process, seconds, millisec, just_this_one; + (register Lisp_Object process, Lisp_Object seconds, Lisp_Object millisec, Lisp_Object just_this_one) { int secs, usecs = 0; @@ -5277,7 +5234,7 @@ chars = (char *) alloca (carryover + readmax); if (carryover) /* See the comment above. */ - bcopy (SDATA (p->decoding_buf), chars, carryover); + memcpy (chars, SDATA (p->decoding_buf), carryover); #ifdef DATAGRAM_SOCKETS /* We have a working select, so proc_buffered_char is always -1. */ @@ -5421,8 +5378,8 @@ { if (SCHARS (p->decoding_buf) < coding->carryover_bytes) p->decoding_buf = make_uninit_string (coding->carryover_bytes); - bcopy (coding->carryover, SDATA (p->decoding_buf), - coding->carryover_bytes); + memcpy (SDATA (p->decoding_buf), coding->carryover, + coding->carryover_bytes); p->decoding_carryover = coding->carryover_bytes; } if (SBYTES (text) > 0) @@ -5513,8 +5470,8 @@ { if (SCHARS (p->decoding_buf) < coding->carryover_bytes) p->decoding_buf = make_uninit_string (coding->carryover_bytes); - bcopy (coding->carryover, SDATA (p->decoding_buf), - coding->carryover_bytes); + memcpy (SDATA (p->decoding_buf), coding->carryover, + coding->carryover_bytes); p->decoding_carryover = coding->carryover_bytes; } /* Adjust the multibyteness of TEXT to that of the buffer. */ @@ -5576,7 +5533,7 @@ 0, 0, 0, doc: /* Returns non-nil if Emacs is waiting for input from the user. This is intended for use by asynchronous process output filters and sentinels. */) - () + (void) { return (waiting_for_user_input_p ? Qt : Qnil); } @@ -5851,8 +5808,7 @@ If the region is more than 500 characters long, it is sent in several bunches. This may happen even for shorter regions. Output from processes can arrive in between bunches. */) - (process, start, end) - Lisp_Object process, start, end; + (Lisp_Object process, Lisp_Object start, Lisp_Object end) { Lisp_Object proc; int start1, end1; @@ -5879,8 +5835,7 @@ If STRING is more than 500 characters long, it is sent in several bunches. This may happen even for shorter strings. Output from processes can arrive in between bunches. */) - (process, string) - Lisp_Object process, string; + (Lisp_Object process, Lisp_Object string) { Lisp_Object proc; CHECK_STRING (string); @@ -5921,8 +5876,7 @@ doc: /* Return t if PROCESS has given the terminal to a child. If the operating system does not make it possible to find out, return t unconditionally. */) - (process) - Lisp_Object process; + (Lisp_Object process) { /* Initialize in case ioctl doesn't exist or gives an error, in a way that will cause returning t. */ @@ -6183,8 +6137,7 @@ If CURRENT-GROUP is `lambda', and if the shell owns the terminal, don't send the signal. */) - (process, current_group) - Lisp_Object process, current_group; + (Lisp_Object process, Lisp_Object current_group) { process_send_signal (process, SIGINT, current_group, 0); return process; @@ -6193,8 +6146,7 @@ DEFUN ("kill-process", Fkill_process, Skill_process, 0, 2, 0, doc: /* Kill process PROCESS. May be process or name of one. See function `interrupt-process' for more details on usage. */) - (process, current_group) - Lisp_Object process, current_group; + (Lisp_Object process, Lisp_Object current_group) { process_send_signal (process, SIGKILL, current_group, 0); return process; @@ -6203,8 +6155,7 @@ DEFUN ("quit-process", Fquit_process, Squit_process, 0, 2, 0, doc: /* Send QUIT signal to process PROCESS. May be process or name of one. See function `interrupt-process' for more details on usage. */) - (process, current_group) - Lisp_Object process, current_group; + (Lisp_Object process, Lisp_Object current_group) { process_send_signal (process, SIGQUIT, current_group, 0); return process; @@ -6215,8 +6166,7 @@ See function `interrupt-process' for more details on usage. If PROCESS is a network or serial process, inhibit handling of incoming traffic. */) - (process, current_group) - Lisp_Object process, current_group; + (Lisp_Object process, Lisp_Object current_group) { #ifdef HAVE_SOCKETS if (PROCESSP (process) && (NETCONN_P (process) || SERIALCONN_P (process))) @@ -6247,8 +6197,7 @@ See function `interrupt-process' for more details on usage. If PROCESS is a network or serial process, resume handling of incoming traffic. */) - (process, current_group) - Lisp_Object process, current_group; + (Lisp_Object process, Lisp_Object current_group) { #ifdef HAVE_SOCKETS if (PROCESSP (process) && (NETCONN_P (process) || SERIALCONN_P (process))) @@ -6289,8 +6238,7 @@ process to signal; in this case, the process need not be a child of this Emacs. SIGCODE may be an integer, or a symbol whose name is a signal name. */) - (process, sigcode) - Lisp_Object process, sigcode; + (Lisp_Object process, Lisp_Object sigcode) { pid_t pid; @@ -6457,8 +6405,7 @@ text to PROCESS after you call this function. If PROCESS is a serial process, wait until all output written to the process has been transmitted to the serial port. */) - (process) - Lisp_Object process; + (Lisp_Object process) { Lisp_Object proc; struct coding_system *coding; @@ -6517,11 +6464,11 @@ if (!proc_encode_coding_system[new_outfd]) proc_encode_coding_system[new_outfd] = (struct coding_system *) xmalloc (sizeof (struct coding_system)); - bcopy (proc_encode_coding_system[old_outfd], - proc_encode_coding_system[new_outfd], - sizeof (struct coding_system)); - bzero (proc_encode_coding_system[old_outfd], - sizeof (struct coding_system)); + memcpy (proc_encode_coding_system[new_outfd], + proc_encode_coding_system[old_outfd], + sizeof (struct coding_system)); + memset (proc_encode_coding_system[old_outfd], 0, + sizeof (struct coding_system)); XPROCESS (proc)->outfd = new_outfd; } @@ -6947,8 +6894,7 @@ doc: /* Set coding systems of PROCESS to DECODING and ENCODING. DECODING will be used to decode subprocess output and ENCODING to encode subprocess input. */) - (process, decoding, encoding) - register Lisp_Object process, decoding, encoding; + (register Lisp_Object process, Lisp_Object decoding, Lisp_Object encoding) { register struct Lisp_Process *p; @@ -6971,8 +6917,7 @@ DEFUN ("process-coding-system", Fprocess_coding_system, Sprocess_coding_system, 1, 1, 0, doc: /* Return a cons of coding systems for decoding and encoding of PROCESS. */) - (process) - register Lisp_Object process; + (register Lisp_Object process) { CHECK_PROCESS (process); return Fcons (XPROCESS (process)->decode_coding_system, @@ -6986,8 +6931,7 @@ If FLAG is nil, the filter is given unibyte strings. In this case, all character code conversion except for end-of-line conversion is suppressed. */) - (process, flag) - Lisp_Object process, flag; + (Lisp_Object process, Lisp_Object flag) { register struct Lisp_Process *p; @@ -7003,8 +6947,7 @@ DEFUN ("process-filter-multibyte-p", Fprocess_filter_multibyte_p, Sprocess_filter_multibyte_p, 1, 1, 0, doc: /* Return t if a multibyte string is given to PROCESS's filter.*/) - (process) - Lisp_Object process; + (Lisp_Object process) { register struct Lisp_Process *p; struct coding_system *coding; @@ -7126,7 +7069,7 @@ If this functionality is unsupported, return nil. See `process-attributes' for getting attributes of a process given its ID. */) - () + (void) { return list_system_processes (); } @@ -7182,9 +7125,7 @@ pmem -- percents of total physical memory used by process's resident set (floating-point number) args -- command line which invoked the process (string). */) - (pid) - - Lisp_Object pid; + ( Lisp_Object pid) { return system_process_attributes (pid); } @@ -7234,10 +7175,10 @@ chan_process[i] = Qnil; proc_buffered_char[i] = -1; } - bzero (proc_decode_coding_system, sizeof proc_decode_coding_system); - bzero (proc_encode_coding_system, sizeof proc_encode_coding_system); + memset (proc_decode_coding_system, 0, sizeof proc_decode_coding_system); + memset (proc_encode_coding_system, 0, sizeof proc_encode_coding_system); #ifdef DATAGRAM_SOCKETS - bzero (datagram_address, sizeof datagram_address); + memset (datagram_address, 0, sizeof datagram_address); #endif #ifdef HAVE_SOCKETS @@ -7600,6 +7541,9 @@ Lisp_Object Qcutime, Qpri, Qnice, Qthcount, Qstart, Qvsize, Qrss, Qargs; Lisp_Object Quser, Qgroup, Qetime, Qpcpu, Qpmem, Qtime, Qctime; +/* Non-zero if keyboard input is on hold, zero otherwise. */ +static int kbd_is_on_hold; + /* As described above, except assuming that there are no subprocesses: Wait for timeout to elapse and/or keyboard input to be available. @@ -7830,8 +7774,7 @@ make-docfile does not pay attention to #if, for good reason! */ DEFUN ("get-buffer-process", Fget_buffer_process, Sget_buffer_process, 1, 1, 0, 0) - (name) - register Lisp_Object name; + (register Lisp_Object name) { return Qnil; } @@ -7842,8 +7785,7 @@ Fprocess_inherit_coding_system_flag, Sprocess_inherit_coding_system_flag, 1, 1, 0, 0) - (process) - register Lisp_Object process; + (register Lisp_Object process) { /* Ignore the argument and return the value of inherit-process-coding-system. */ @@ -7860,13 +7802,38 @@ { } + +/* Stop reading input from keyboard sources. */ + +void +hold_keyboard_input (void) +{ + kbd_is_on_hold = 1; +} + +/* Resume reading input from keyboard sources. */ + +void +unhold_keyboard_input (void) +{ + kbd_is_on_hold = 0; +} + +/* Return non-zero if keyboard input is on hold, zero otherwise. */ + +int +kbd_on_hold_p (void) +{ + return kbd_is_on_hold; +} + DEFUN ("list-system-processes", Flist_system_processes, Slist_system_processes, 0, 0, 0, doc: /* Return a list of numerical process IDs of all running processes. If this functionality is unsupported, return nil. See `process-attributes' for getting attributes of a process given its ID. */) - () + (void) { return list_system_processes (); } @@ -7922,9 +7889,7 @@ pmem -- percents of total physical memory used by process's resident set (floating-point number) args -- command line which invoked the process (string). */) - (pid) - - Lisp_Object pid; + ( Lisp_Object pid) { return system_process_attributes (pid); }
--- a/src/ralloc.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/ralloc.c Thu Jul 08 22:47:34 2010 +0000 @@ -37,11 +37,6 @@ typedef POINTER_TYPE *POINTER; typedef size_t SIZE; -/* Declared in dispnew.c, this version doesn't screw up if regions - overlap. */ - -extern void safe_bcopy (const char *, char *, int); - #ifdef DOUG_LEA_MALLOC #define M_TOP_PAD -2 extern int mallopt (int, int); @@ -61,9 +56,6 @@ #include <unistd.h> #include <malloc.h> -#define safe_bcopy(x, y, z) memmove (y, x, z) -#define bzero(x, len) memset (x, 0, len) - #endif /* not emacs */ @@ -676,7 +668,7 @@ } else { - safe_bcopy (b->data, b->new_data, b->size); + memmove (b->new_data, b->data, b->size); *b->variable = b->data = b->new_data; } } @@ -687,8 +679,8 @@ } else { - safe_bcopy (bloc->data, bloc->new_data, old_size); - bzero ((char *) bloc->new_data + old_size, size - old_size); + memmove (bloc->new_data, bloc->data, old_size); + memset (bloc->new_data + old_size, 0, size - old_size); *bloc->variable = bloc->data = bloc->new_data; } } @@ -703,7 +695,7 @@ } else { - safe_bcopy (b->data, b->new_data, b->size); + memmove (b->new_data, b->data, b->size); *b->variable = b->data = b->new_data; } } @@ -856,7 +848,7 @@ header. */ for (b = last_bloc; b != NIL_BLOC; b = b->prev) { - safe_bcopy (b->data, b->new_data, b->size); + memmove (b->new_data, b->data, b->size); *b->variable = b->data = b->new_data; } @@ -883,7 +875,7 @@ last_heap = first_heap; } - bzero (address, size); + memset (address, 0, size); } else /* size < 0 */ { @@ -902,7 +894,7 @@ for (b = first_bloc; b != NIL_BLOC; b = b->next) { - safe_bcopy (b->data, b->new_data, b->size); + memmove (b->new_data, b->data, b->size); *b->variable = b->data = b->new_data; } } @@ -1082,7 +1074,7 @@ abort (); /* This frees all unused blocs. It is not too inefficient, as the resize - and bcopy is done only once. Afterwards, all unreferenced blocs are + and memcpy is done only once. Afterwards, all unreferenced blocs are already shrunk to zero size. */ if (!r_alloc_freeze_level) { @@ -1292,8 +1284,8 @@ even though it is after the sbrk value. */ /* Doubly true, with the additional call that explicitly adds the rest of that page to the address space. */ - bzero (first_heap->start, - (char *) first_heap->end - (char *) first_heap->start); + memset (first_heap->start, 0, + (char *) first_heap->end - (char *) first_heap->start); virtual_break_value = break_value = first_heap->bloc_start = first_heap->end; #endif
--- a/src/regex.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/regex.c Thu Jul 08 22:47:34 2010 +0000 @@ -248,37 +248,16 @@ # endif # define realloc xrealloc -/* When used in Emacs's lib-src, we need to get bzero and bcopy somehow. - If nothing else has been done, use the method below. */ -# ifdef INHIBIT_STRING_HEADER -# if !(defined HAVE_BZERO && defined HAVE_BCOPY) -# if !defined bzero && !defined bcopy -# undef INHIBIT_STRING_HEADER -# endif +/* This is the normal way of making sure we have memcpy, memcmp and memset. */ +# if defined HAVE_STRING_H || defined STDC_HEADERS || defined _LIBC +# include <string.h> +# else +# include <strings.h> +# ifndef memcmp +# define memcmp(s1, s2, n) bcmp (s1, s2, n) # endif -# endif - -/* This is the normal way of making sure we have memcpy, memcmp and bzero. - This is used in most programs--a few other programs avoid this - by defining INHIBIT_STRING_HEADER. */ -# ifndef INHIBIT_STRING_HEADER -# if defined HAVE_STRING_H || defined STDC_HEADERS || defined _LIBC -# include <string.h> -# ifndef bzero -# ifndef _LIBC -# define bzero(s, n) (memset (s, '\0', n), (s)) -# else -# define bzero(s, n) __bzero (s, n) -# endif -# endif -# else -# include <strings.h> -# ifndef memcmp -# define memcmp(s1, s2, n) bcmp (s1, s2, n) -# endif -# ifndef memcpy -# define memcpy(d, s, n) (bcopy (s, d, n), (d)) -# endif +# ifndef memcpy +# define memcpy(d, s, n) (bcopy (s, d, n), (d)) # endif # endif @@ -464,7 +443,7 @@ if (done) return; - bzero (re_syntax_table, sizeof re_syntax_table); + memset (re_syntax_table, 0, sizeof re_syntax_table); for (c = 0; c < CHAR_SET_SIZE; ++c) if (ISALNUM (c)) @@ -2948,7 +2927,7 @@ BUF_PUSH ((1 << BYTEWIDTH) / BYTEWIDTH); /* Clear the whole map. */ - bzero (b, (1 << BYTEWIDTH) / BYTEWIDTH); + memset (b, 0, (1 << BYTEWIDTH) / BYTEWIDTH); /* charset_not matches newline according to a syntax bit. */ if ((re_opcode_t) b[-2] == charset_not @@ -4303,7 +4282,7 @@ assert (fastmap && bufp->buffer); - bzero (fastmap, 1 << BYTEWIDTH); /* Assume nothing's valid. */ + memset (fastmap, 0, 1 << BYTEWIDTH); /* Assume nothing's valid. */ bufp->fastmap_accurate = 1; /* It will be when we're done. */ analysis = analyse_first (bufp->buffer, bufp->buffer + bufp->used,
--- a/src/s/darwin.h Wed Jul 07 22:09:05 2010 +0000 +++ b/src/s/darwin.h Thu Jul 08 22:47:34 2010 +0000 @@ -117,9 +117,6 @@ /* Define HAVE_SOCKETS if system supports 4.2-compatible sockets. */ #define HAVE_SOCKETS -/* start_of_text isn't actually used, so make it compile without error. */ -#define TEXT_START (0) - /* Definitions for how to compile & link. */ #ifdef HAVE_NS #define SYSTEM_PURESIZE_EXTRA 200000
--- a/src/s/hpux10-20.h Wed Jul 07 22:09:05 2010 +0000 +++ b/src/s/hpux10-20.h Thu Jul 08 22:47:34 2010 +0000 @@ -131,7 +131,6 @@ #define DATA_SEG_BITS 0x40000000 #define DATA_START 0x40000000 -#define TEXT_START 0x00000000 /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE double
--- a/src/s/ms-w32.h Wed Jul 07 22:09:05 2010 +0000 +++ b/src/s/ms-w32.h Thu Jul 08 22:47:34 2010 +0000 @@ -63,15 +63,6 @@ for received packets, so datagrams are broken too. */ #define BROKEN_DATAGRAM_SOCKETS 1 -#define bzero(b, l) memset(b, 0, l) -#define bcopy(s, d, l) memmove(d, s, l) -#define bcmp(a, b, l) memcmp(a, b, l) - -/* bcopy (aka memmove aka memcpy at least on x86) under MSVC is quite safe. */ -#define GAP_USE_BCOPY 1 -#define BCOPY_UPWARD_SAFE 1 -#define BCOPY_DOWNWARD_SAFE 1 - /* If your system uses COFF (Common Object File Format) then define the preprocessor symbol "COFF". */ #define COFF 1 @@ -153,8 +144,10 @@ #define HAVE_RANDOM 1 #undef HAVE_SYSINFO #undef HAVE_LRAND48 -#define HAVE_BCOPY 1 -#define HAVE_BCMP 1 +#define HAVE_MEMCMP 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMSET 1 #define HAVE_LOGB 1 #define HAVE_FREXP 1 #define HAVE_FMOD 1
--- a/src/s/msdos.h Wed Jul 07 22:09:05 2010 +0000 +++ b/src/s/msdos.h Thu Jul 08 22:47:34 2010 +0000 @@ -75,7 +75,6 @@ #define _longjmp longjmp #define DATA_START (&etext + 1) -#define TEXT_START &start #define _NAIVE_DOS_REGS @@ -104,10 +103,6 @@ #define IS_DIRECTORY_SEP(_c_) ((_c_) == '/' || (_c_) == '\\') #define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_) || IS_DEVICE_SEP (_c_)) -/* bcopy under djgpp is quite safe. */ -#define GAP_USE_BCOPY -#define BCOPY_UPWARD_SAFE 1 -#define BCOPY_DOWNWARD_SAFE 1 /* Mode line description of a buffer's type. */ #define MODE_LINE_BINARY_TEXT(buf) (NILP(buf->buffer_file_type) ? "T" : "B")
--- a/src/scroll.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/scroll.c Thu Jul 08 22:47:34 2010 +0000 @@ -258,7 +258,7 @@ int *copy_from = (int *) alloca (window_size * sizeof (int)); /* Zero means line is empty. */ - bzero (retained_p, window_size * sizeof (char)); + memset (retained_p, 0, window_size * sizeof (char)); for (k = 0; k < window_size; ++k) copy_from[k] = -1; @@ -677,7 +677,7 @@ old matrix. Lines not retained are empty. */ char *retained_p = (char *) alloca (window_size * sizeof (char)); - bzero (retained_p, window_size * sizeof (char)); + memset (retained_p, 0, window_size * sizeof (char)); /* Perform some sanity checks when GLYPH_DEBUG is on. */ CHECK_MATRIX (current_matrix); @@ -855,7 +855,7 @@ avg_length /= end - start; threshold = avg_length / 4; - bzero (lines, sizeof lines); + memset (lines, 0, sizeof lines); /* Put new lines' hash codes in hash table. Ignore lines shorter than the threshold. Thus, if the lines that are in common are
--- a/src/search.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/search.c Thu Jul 08 22:47:34 2010 +0000 @@ -362,8 +362,7 @@ This function modifies the match data that `match-beginning', `match-end' and `match-data' access; save and restore the match data if you want to preserve them. */) - (regexp) - Lisp_Object regexp; + (Lisp_Object regexp) { return looking_at_1 (regexp, 0); } @@ -374,8 +373,7 @@ This function modifies the match data that `match-beginning', `match-end' and `match-data' access; save and restore the match data if you want to preserve them. */) - (regexp) - Lisp_Object regexp; + (Lisp_Object regexp) { return looking_at_1 (regexp, 1); } @@ -461,8 +459,7 @@ You can use the function `match-string' to extract the substrings matched by the parenthesis constructions in REGEXP. */) - (regexp, string, start) - Lisp_Object regexp, string, start; + (Lisp_Object regexp, Lisp_Object string, Lisp_Object start) { return string_match_1 (regexp, string, start, 0); } @@ -475,8 +472,7 @@ For index of first char beyond the match, do (match-end 0). `match-end' and `match-beginning' also give indices of substrings matched by parenthesis constructs in the pattern. */) - (regexp, string, start) - Lisp_Object regexp, string, start; + (Lisp_Object regexp, Lisp_Object string, Lisp_Object start) { return string_match_1 (regexp, string, start, 1); } @@ -1404,7 +1400,7 @@ } /* Store this character into the translated pattern. */ - bcopy (str, pat, charlen); + memcpy (pat, str, charlen); pat += charlen; base_pat += in_charlen; len_byte -= in_charlen; @@ -2178,8 +2174,7 @@ if (SYNTAX (c) == Sword) { - bcopy (SDATA (string) + i_byte_orig, o, - i_byte - i_byte_orig); + memcpy (o, SDATA (string) + i_byte_orig, i_byte - i_byte_orig); o += i_byte - i_byte_orig; } else if (i > 0 && SYNTAX (prev_c) == Sword && --word_count) @@ -2217,8 +2212,7 @@ `case-fold-search', which see. See also the functions `match-beginning', `match-end' and `replace-match'. */) - (string, bound, noerror, count) - Lisp_Object string, bound, noerror, count; + (Lisp_Object string, Lisp_Object bound, Lisp_Object noerror, Lisp_Object count) { return search_command (string, bound, noerror, count, -1, 0, 0); } @@ -2237,8 +2231,7 @@ `case-fold-search', which see. See also the functions `match-beginning', `match-end' and `replace-match'. */) - (string, bound, noerror, count) - Lisp_Object string, bound, noerror, count; + (Lisp_Object string, Lisp_Object bound, Lisp_Object noerror, Lisp_Object count) { return search_command (string, bound, noerror, count, 1, 0, 0); } @@ -2252,8 +2245,7 @@ Optional third argument, if t, means if fail just return nil (no error). If not nil and not t, move to limit of search and return nil. Optional fourth argument is repeat count--search for successive occurrences. */) - (string, bound, noerror, count) - Lisp_Object string, bound, noerror, count; + (Lisp_Object string, Lisp_Object bound, Lisp_Object noerror, Lisp_Object count) { return search_command (wordify (string, 0), bound, noerror, count, -1, 1, 0); } @@ -2267,8 +2259,7 @@ Optional third argument, if t, means if fail just return nil (no error). If not nil and not t, move to limit of search and return nil. Optional fourth argument is repeat count--search for successive occurrences. */) - (string, bound, noerror, count) - Lisp_Object string, bound, noerror, count; + (Lisp_Object string, Lisp_Object bound, Lisp_Object noerror, Lisp_Object count) { return search_command (wordify (string, 0), bound, noerror, count, 1, 1, 0); } @@ -2286,8 +2277,7 @@ Optional third argument, if t, means if fail just return nil (no error). If not nil and not t, move to limit of search and return nil. Optional fourth argument is repeat count--search for successive occurrences. */) - (string, bound, noerror, count) - Lisp_Object string, bound, noerror, count; + (Lisp_Object string, Lisp_Object bound, Lisp_Object noerror, Lisp_Object count) { return search_command (wordify (string, 1), bound, noerror, count, -1, 1, 0); } @@ -2305,8 +2295,7 @@ Optional third argument, if t, means if fail just return nil (no error). If not nil and not t, move to limit of search and return nil. Optional fourth argument is repeat count--search for successive occurrences. */) - (string, bound, noerror, count) - Lisp_Object string, bound, noerror, count; + (Lisp_Object string, Lisp_Object bound, Lisp_Object noerror, Lisp_Object count) { return search_command (wordify (string, 1), bound, noerror, count, 1, 1, 0); } @@ -2324,8 +2313,7 @@ Optional fourth argument is repeat count--search for successive occurrences. See also the functions `match-beginning', `match-end', `match-string', and `replace-match'. */) - (regexp, bound, noerror, count) - Lisp_Object regexp, bound, noerror, count; + (Lisp_Object regexp, Lisp_Object bound, Lisp_Object noerror, Lisp_Object count) { return search_command (regexp, bound, noerror, count, -1, 1, 0); } @@ -2341,8 +2329,7 @@ Optional fourth argument is repeat count--search for successive occurrences. See also the functions `match-beginning', `match-end', `match-string', and `replace-match'. */) - (regexp, bound, noerror, count) - Lisp_Object regexp, bound, noerror, count; + (Lisp_Object regexp, Lisp_Object bound, Lisp_Object noerror, Lisp_Object count) { return search_command (regexp, bound, noerror, count, 1, 1, 0); } @@ -2361,8 +2348,7 @@ Optional fourth argument is repeat count--search for successive occurrences. See also the functions `match-beginning', `match-end', `match-string', and `replace-match'. */) - (regexp, bound, noerror, count) - Lisp_Object regexp, bound, noerror, count; + (Lisp_Object regexp, Lisp_Object bound, Lisp_Object noerror, Lisp_Object count) { return search_command (regexp, bound, noerror, count, -1, 1, 1); } @@ -2379,8 +2365,7 @@ Optional fourth argument is repeat count--search for successive occurrences. See also the functions `match-beginning', `match-end', `match-string', and `replace-match'. */) - (regexp, bound, noerror, count) - Lisp_Object regexp, bound, noerror, count; + (Lisp_Object regexp, Lisp_Object bound, Lisp_Object noerror, Lisp_Object count) { return search_command (regexp, bound, noerror, count, 1, 1, 1); } @@ -2421,8 +2406,7 @@ NEWTEXT in place of subexp N. This is useful only after a regular expression search or match, since only regular expressions have distinguished subexpressions. */) - (newtext, fixedcase, literal, string, subexp) - Lisp_Object newtext, fixedcase, literal, string, subexp; + (Lisp_Object newtext, Lisp_Object fixedcase, Lisp_Object literal, Lisp_Object string, Lisp_Object subexp) { enum { nochange, all_caps, cap_initial } case_action; register int pos, pos_byte; @@ -2774,7 +2758,7 @@ /* Now add to the end of SUBSTED. */ if (add_stuff) { - bcopy (add_stuff, substed + substed_len, add_len); + memcpy (substed + substed_len, add_stuff, add_len); substed_len += add_len; } } @@ -2862,8 +2846,7 @@ Value is nil if SUBEXPth pair didn't match, or there were less than SUBEXP pairs. Zero means the entire text matched by the whole regexp or whole string. */) - (subexp) - Lisp_Object subexp; + (Lisp_Object subexp) { return match_limit (subexp, 1); } @@ -2875,8 +2858,7 @@ Value is nil if SUBEXPth pair didn't match, or there were less than SUBEXP pairs. Zero means the entire text matched by the whole regexp or whole string. */) - (subexp) - Lisp_Object subexp; + (Lisp_Object subexp) { return match_limit (subexp, 0); } @@ -2901,8 +2883,7 @@ REUSE list will be modified to point to nowhere. Return value is undefined if the last search failed. */) - (integers, reuse, reseat) - Lisp_Object integers, reuse, reseat; + (Lisp_Object integers, Lisp_Object reuse, Lisp_Object reseat) { Lisp_Object tail, prev; Lisp_Object *data; @@ -3002,8 +2983,7 @@ LIST should have been created by calling `match-data' previously. If optional arg RESEAT is non-nil, make markers on LIST point nowhere. */) - (list, reseat) - register Lisp_Object list, reseat; + (register Lisp_Object list, Lisp_Object reseat) { register int i; register Lisp_Object marker; @@ -3177,8 +3157,7 @@ DEFUN ("regexp-quote", Fregexp_quote, Sregexp_quote, 1, 1, 0, doc: /* Return a regexp string which matches exactly STRING and nothing else. */) - (string) - Lisp_Object string; + (Lisp_Object string) { register unsigned char *in, *out, *end; register unsigned char *temp;
--- a/src/sound.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/sound.c Thu Jul 08 22:47:34 2010 +0000 @@ -550,7 +550,7 @@ struct wav_header *header = (struct wav_header *) s->header; if (s->header_size < sizeof *header - || bcmp (s->header, "RIFF", 4) != 0) + || memcmp (s->header, "RIFF", 4) != 0) return 0; /* WAV files are in little-endian order. Convert the header @@ -658,7 +658,7 @@ struct au_header *header = (struct au_header *) s->header; if (s->header_size < sizeof *header - || bcmp (s->header, ".snd", 4) != 0) + || memcmp (s->header, ".snd", 4) != 0) return 0; header->magic_number = be2hl (header->magic_number); @@ -1353,8 +1353,7 @@ doc: /* Play sound SOUND. Internal use only, use `play-sound' instead. */) - (sound) - Lisp_Object sound; + (Lisp_Object sound) { Lisp_Object attrs[SOUND_ATTR_SENTINEL]; int count = SPECPDL_INDEX (); @@ -1380,9 +1379,9 @@ file = Qnil; GCPRO2 (sound, file); current_sound_device = (struct sound_device *) xmalloc (sizeof (struct sound_device)); - bzero (current_sound_device, sizeof (struct sound_device)); + memset (current_sound_device, 0, sizeof (struct sound_device)); current_sound = (struct sound *) xmalloc (sizeof (struct sound)); - bzero (current_sound, sizeof (struct sound)); + memset (current_sound, 0, sizeof (struct sound)); record_unwind_protect (sound_cleanup, Qnil); current_sound->header = (char *) alloca (MAX_SOUND_HEADER_BYTES); @@ -1405,7 +1404,8 @@ { current_sound->data = attrs[SOUND_DATA]; current_sound->header_size = min (MAX_SOUND_HEADER_BYTES, SBYTES (current_sound->data)); - bcopy (SDATA (current_sound->data), current_sound->header, current_sound->header_size); + memcpy (current_sound->header, SDATA (current_sound->data), + current_sound->header_size); } /* Find out the type of sound. Give up if we can't tell. */
--- a/src/syntax.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/syntax.c Thu Jul 08 22:47:34 2010 +0000 @@ -721,8 +721,7 @@ DEFUN ("syntax-table-p", Fsyntax_table_p, Ssyntax_table_p, 1, 1, 0, doc: /* Return t if OBJECT is a syntax table. Currently, any char-table counts as a syntax table. */) - (object) - Lisp_Object object; + (Lisp_Object object) { if (CHAR_TABLE_P (object) && EQ (XCHAR_TABLE (object)->purpose, Qsyntax_table)) @@ -740,7 +739,7 @@ DEFUN ("syntax-table", Fsyntax_table, Ssyntax_table, 0, 0, 0, doc: /* Return the current syntax table. This is the one specified by the current buffer. */) - () + (void) { return current_buffer->syntax_table; } @@ -749,7 +748,7 @@ Sstandard_syntax_table, 0, 0, 0, doc: /* Return the standard syntax table. This is the one used for new buffers. */) - () + (void) { return Vstandard_syntax_table; } @@ -757,8 +756,7 @@ DEFUN ("copy-syntax-table", Fcopy_syntax_table, Scopy_syntax_table, 0, 1, 0, doc: /* Construct a new syntax table and return it. It is a copy of the TABLE, which defaults to the standard syntax table. */) - (table) - Lisp_Object table; + (Lisp_Object table) { Lisp_Object copy; @@ -784,8 +782,7 @@ DEFUN ("set-syntax-table", Fset_syntax_table, Sset_syntax_table, 1, 1, 0, doc: /* Select a new syntax table for the current buffer. One argument, a syntax table. */) - (table) - Lisp_Object table; + (Lisp_Object table) { int idx; check_syntax_table (table); @@ -844,8 +841,7 @@ character `w' (119) is returned. The characters that correspond to various syntax codes are listed in the documentation of `modify-syntax-entry'. */) - (character) - Lisp_Object character; + (Lisp_Object character) { int char_int; CHECK_CHARACTER (character); @@ -856,8 +852,7 @@ DEFUN ("matching-paren", Fmatching_paren, Smatching_paren, 1, 1, 0, doc: /* Return the matching parenthesis of CHARACTER, or nil if none. */) - (character) - Lisp_Object character; + (Lisp_Object character) { int char_int, code; CHECK_NUMBER (character); @@ -875,8 +870,7 @@ `modify-syntax-entry'. Value is the equivalent cons cell \(CODE . MATCHING-CHAR) that can be used as value of a `syntax-table' text property. */) - (string) - Lisp_Object string; + (Lisp_Object string) { register const unsigned char *p; register enum syntaxcode code; @@ -987,8 +981,7 @@ such characters are treated as whitespace when they occur between expressions. usage: (modify-syntax-entry CHAR NEWENTRY &optional SYNTAX-TABLE) */) - (c, newentry, syntax_table) - Lisp_Object c, newentry, syntax_table; + (Lisp_Object c, Lisp_Object newentry, Lisp_Object syntax_table) { if (CONSP (c)) { @@ -1021,8 +1014,7 @@ DEFUN ("internal-describe-syntax-value", Finternal_describe_syntax_value, Sinternal_describe_syntax_value, 1, 1, 0, doc: /* Insert a description of the internal syntax description SYNTAX at point. */) - (syntax) - Lisp_Object syntax; + (Lisp_Object syntax) { register enum syntaxcode code; char desc, start1, start2, end1, end2, prefix, comstyle, comnested; @@ -1307,8 +1299,7 @@ If an edge of the buffer or a field boundary is reached, point is left there and the function returns nil. Field boundaries are not noticed if `inhibit-field-text-motion' is non-nil. */) - (arg) - Lisp_Object arg; + (Lisp_Object arg) { Lisp_Object tmp; int orig_val, val; @@ -1343,8 +1334,7 @@ Char classes, e.g. `[:alpha:]', are supported. Returns the distance traveled, either zero or positive. */) - (string, lim) - Lisp_Object string, lim; + (Lisp_Object string, Lisp_Object lim) { return skip_chars (1, string, lim, 1); } @@ -1353,8 +1343,7 @@ doc: /* Move point backward, stopping after a char not in STRING, or at pos LIM. See `skip-chars-forward' for details. Returns the distance traveled, either zero or negative. */) - (string, lim) - Lisp_Object string, lim; + (Lisp_Object string, Lisp_Object lim) { return skip_chars (0, string, lim, 1); } @@ -1365,8 +1354,7 @@ Stop before a char whose syntax is not in SYNTAX, or at position LIM. If SYNTAX starts with ^, skip characters whose syntax is NOT in SYNTAX. This function returns the distance traveled, either zero or positive. */) - (syntax, lim) - Lisp_Object syntax, lim; + (Lisp_Object syntax, Lisp_Object lim) { return skip_syntaxes (1, syntax, lim); } @@ -1377,8 +1365,7 @@ Stop on reaching a char whose syntax is not in SYNTAX, or at position LIM. If SYNTAX starts with ^, skip characters whose syntax is NOT in SYNTAX. This function returns the distance traveled, either zero or negative. */) - (syntax, lim) - Lisp_Object syntax, lim; + (Lisp_Object syntax, Lisp_Object lim) { return skip_syntaxes (0, syntax, lim); } @@ -1422,7 +1409,7 @@ && (XINT (lim) - PT != CHAR_TO_BYTE (XINT (lim)) - PT_BYTE)); string_multibyte = SBYTES (string) > SCHARS (string); - bzero (fastmap, sizeof fastmap); + memset (fastmap, 0, sizeof fastmap); str = SDATA (string); size_byte = SBYTES (string); @@ -1471,7 +1458,7 @@ || *class_end != ':' || class_end[1] != ']') goto not_a_class_name; - bcopy (class_beg, class_name, class_end - class_beg); + memcpy (class_name, class_beg, class_end - class_beg); class_name[class_end - class_beg] = 0; cc = re_wctype (class_name); @@ -1532,8 +1519,8 @@ unsigned char fastmap2[0400]; int range_start_byte, range_start_char; - bcopy (fastmap2 + 0200, fastmap + 0200, 0200); - bzero (fastmap + 0200, 0200); + memcpy (fastmap + 0200, fastmap2 + 0200, 0200); + memset (fastmap + 0200, 0, 0200); /* We are sure that this loop stops. */ for (i = 0200; ! fastmap2[i]; i++); c = BYTE8_TO_CHAR (i); @@ -1593,7 +1580,7 @@ || *class_end != ':' || class_end[1] != ']') goto not_a_class_name_multibyte; - bcopy (class_beg, class_name, class_end - class_beg); + memcpy (class_name, class_beg, class_end - class_beg); class_name[class_end - class_beg] = 0; cc = re_wctype (class_name); @@ -1678,7 +1665,7 @@ if (! multibyte && n_char_ranges > 0) { - bzero (fastmap + 0200, 0200); + memset (fastmap + 0200, 0, 0200); for (i = 0; i < n_char_ranges; i += 2) { int c1 = char_ranges[i]; @@ -1907,7 +1894,7 @@ multibyte = (!NILP (current_buffer->enable_multibyte_characters) && (XINT (lim) - PT != CHAR_TO_BYTE (XINT (lim)) - PT_BYTE)); - bzero (fastmap, sizeof fastmap); + memset (fastmap, 0, sizeof fastmap); if (SBYTES (string) > SCHARS (string)) /* As this is very rare case (syntax spec is ASCII only), don't @@ -2193,8 +2180,7 @@ Set point to where scanning stops. If COUNT comments are found as expected, with nothing except whitespace between them, return t; otherwise return nil. */) - (count) - Lisp_Object count; + (Lisp_Object count) { register EMACS_INT from; EMACS_INT from_byte; @@ -2797,8 +2783,7 @@ If the beginning or end of (the accessible part of) the buffer is reached and the depth is wrong, an error is signaled. If the depth is right but the count is not used up, nil is returned. */) - (from, count, depth) - Lisp_Object from, count, depth; + (Lisp_Object from, Lisp_Object count, Lisp_Object depth) { CHECK_NUMBER (from); CHECK_NUMBER (count); @@ -2818,8 +2803,7 @@ in the middle of a parenthetical grouping, an error is signaled. If the beginning or end is reached between groupings but before count is used up, nil is returned. */) - (from, count) - Lisp_Object from, count; + (Lisp_Object from, Lisp_Object count) { CHECK_NUMBER (from); CHECK_NUMBER (count); @@ -2831,7 +2815,7 @@ 0, 0, 0, doc: /* Move point backward over any number of chars with prefix syntax. This includes chars with "quote" or "prefix" syntax (' or p). */) - () + (void) { int beg = BEGV; int opoint = PT; @@ -3255,8 +3239,7 @@ Sixth arg COMMENTSTOP non-nil means stop at the start of a comment. If it is symbol `syntax-table', stop after the start of a comment or a string, or after end of a comment or a string. */) - (from, to, targetdepth, stopbefore, oldstate, commentstop) - Lisp_Object from, to, targetdepth, stopbefore, oldstate, commentstop; + (Lisp_Object from, Lisp_Object to, Lisp_Object targetdepth, Lisp_Object stopbefore, Lisp_Object oldstate, Lisp_Object commentstop) { struct lisp_parse_state state; int target;
--- a/src/sysdep.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/sysdep.c Thu Jul 08 22:47:34 2010 +0000 @@ -18,10 +18,7 @@ You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ -#ifdef HAVE_CONFIG_H #include <config.h> -#endif - #include <ctype.h> #include <signal.h> #include <stdio.h> @@ -79,9 +76,6 @@ #include "dosfns.h" #include "msdos.h" #include <sys/param.h> - -extern int etext; -extern unsigned start __asm__ ("start"); #endif #include <sys/file.h> @@ -623,7 +617,7 @@ dir = expand_and_dir_to_file (Funhandled_file_name_directory (dir), Qnil); str = (unsigned char *) alloca (SCHARS (dir) + 2); len = SCHARS (dir); - bcopy (SDATA (dir), str, len); + memcpy (str, SDATA (dir), len); if (str[len - 1] != '/') str[len++] = '/'; str[len] = 0; xyzzy: @@ -855,7 +849,7 @@ /* Retrieve the primary parameters - baud rate, character size, etcetera. */ #ifdef HAVE_TCATTR /* We have those nifty POSIX tcmumbleattr functions. */ - bzero (&settings->main, sizeof (settings->main)); + memset (&settings->main, 0, sizeof (settings->main)); if (tcgetattr (fd, &settings->main) < 0) return -1; @@ -922,7 +916,7 @@ { struct termios new; - bzero (&new, sizeof (new)); + memset (&new, 0, sizeof (new)); /* Get the current settings, and see if they're what we asked for. */ tcgetattr (fd, &new); /* We cannot use memcmp on the whole structure here because under @@ -1511,83 +1505,6 @@ } #endif /* HAVE_PTYS */ -#if !defined(CANNOT_DUMP) || !defined(SYSTEM_MALLOC) -/* Some systems that cannot dump also cannot implement these. */ - -/* - * Return the address of the start of the text segment prior to - * doing an unexec. After unexec the return value is undefined. - * See crt0.c for further explanation and _start. - * - */ - -#if !(defined (__NetBSD__) && defined (__ELF__)) -#ifndef HAVE_TEXT_START -char * -start_of_text (void) -{ -#ifdef TEXT_START - return ((char *) TEXT_START); -#else - extern int _start (); - return ((char *) _start); -#endif /* TEXT_START */ -} -#endif /* not HAVE_TEXT_START */ -#endif - -/* - * Return the address of the start of the data segment prior to - * doing an unexec. After unexec the return value is undefined. - * See crt0.c for further information and definition of data_start. - * - * Apparently, on BSD systems this is etext at startup. On - * USG systems (swapping) this is highly mmu dependent and - * is also dependent on whether or not the program is running - * with shared text. Generally there is a (possibly large) - * gap between end of text and start of data with shared text. - * - * On Uniplus+ systems with shared text, data starts at a - * fixed address. Each port (from a given oem) is generally - * different, and the specific value of the start of data can - * be obtained via the UniPlus+ specific "uvar" system call, - * however the method outlined in crt0.c seems to be more portable. - * - * Probably what will have to happen when a USG unexec is available, - * at least on UniPlus, is temacs will have to be made unshared so - * that text and data are contiguous. Then once loadup is complete, - * unexec will produce a shared executable where the data can be - * at the normal shared text boundary and the startofdata variable - * will be patched by unexec to the correct value. - * - */ - -#ifndef start_of_data -char * -start_of_data (void) -{ -#ifdef DATA_START - return ((char *) DATA_START); -#else -#ifdef ORDINARY_LINK - /* - * This is a hack. Since we're not linking crt0.c or pre_crt0.c, - * data_start isn't defined. We take the address of environ, which - * is known to live at or near the start of the system crt0.c, and - * we don't sweat the handful of bytes that might lose. - */ - extern char **environ; - - return ((char *) &environ); -#else - extern int data_start; - return ((char *) &data_start); -#endif /* ORDINARY_LINK */ -#endif /* DATA_START */ -} -#endif /* start_of_data */ -#endif /* NEED_STARTS (not CANNOT_DUMP or not SYSTEM_MALLOC) */ - /* init_system_name sets up the string for the Lisp function system-name to return. */ @@ -1912,7 +1829,6 @@ /* XXX This needs to be updated for multi-tty support. Is there anybody who needs to emulate select these days? */ int nread, i; - extern int quit_char; if (read_socket_hook) { @@ -2715,6 +2631,59 @@ #endif /* !HAVE_RMDIR */ +#ifndef HAVE_MEMSET +void * +memset (void *b, int n, size_t length) +{ + unsigned char *p = b; + while (length-- > 0) + *p++ = n; + return b; +} +#endif /* !HAVE_MEMSET */ + +#ifndef HAVE_MEMCPY +void * +memcpy (void *b1, void *b2, size_t length) +{ + unsigned char *p1 = b1, *p2 = b2; + while (length-- > 0) + *p1++ = *p2++; + return b1; +} +#endif /* !HAVE_MEMCPY */ + +#ifndef HAVE_MEMMOVE +void * +memmove (void *b1, void *b2, size_t length) +{ + unsigned char *p1 = b1, *p2 = b2; + if (p1 < p2 || p1 >= p2 + length) + while (length-- > 0) + *p1++ = *p2++; + else + { + p1 += length; + p2 += length; + while (length-- > 0) + *--p1 = *--p2; + } + return b1; +} +#endif /* !HAVE_MEMCPY */ + +#ifndef HAVE_MEMCMP +int +memcmp (void *b1, void *b2, size_t length) +{ + unsigned char *p1 = b1, *p2 = b2; + while (length-- > 0) + if (*p1++ != *p2++) + return p1[-1] < p2[-1] ? -1 : 1; + return 0; +} +#endif /* !HAVE_MEMCMP */ + #ifndef HAVE_STRSIGNAL char * strsignal (int code)
--- a/src/term.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/term.c Thu Jul 08 22:47:34 2010 +0000 @@ -720,7 +720,7 @@ encode_terminal_src_size); buf = encode_terminal_src + nbytes; } - bcopy (SDATA (string), buf, SBYTES (string)); + memcpy (buf, SDATA (string), SBYTES (string)); buf += SBYTES (string); nchars += SCHARS (string); } @@ -1225,8 +1225,8 @@ = (int *) xmalloc (sizeof (int) + 2 * max_frame_cols * sizeof (int)); - bzero (char_ins_del_vector, (sizeof (int) - + 2 * max_frame_cols * sizeof (int))); + memset (char_ins_del_vector, 0, + (sizeof (int) + 2 * max_frame_cols * sizeof (int))); if (f && (!tty->TS_ins_line && !tty->TS_del_line)) @@ -1893,7 +1893,7 @@ temp_it.what = IT_CHARACTER; temp_it.len = 1; temp_it.object = make_number (0); - bzero (&temp_it.current, sizeof temp_it.current); + memset (&temp_it.current, 0, sizeof temp_it.current); if (what == IT_CONTINUATION) { @@ -2133,8 +2133,7 @@ TERMINAL can be a terminal object, a frame, or nil (meaning the selected frame's terminal). This function always returns nil if TERMINAL does not refer to a text-only terminal. */) - (terminal) - Lisp_Object terminal; + (Lisp_Object terminal) { struct terminal *t = get_tty_terminal (terminal, 0); if (!t) @@ -2151,8 +2150,7 @@ TERMINAL can be a terminal object, a frame, or nil (meaning the selected frame's terminal). This function always returns 0 if TERMINAL does not refer to a text-only terminal. */) - (terminal) - Lisp_Object terminal; + (Lisp_Object terminal) { struct terminal *t = get_tty_terminal (terminal, 0); if (!t) @@ -2336,8 +2334,7 @@ TERMINAL can be a terminal object, a frame, or nil (meaning the selected frame's terminal). */) - (terminal) - Lisp_Object terminal; + (Lisp_Object terminal) { struct terminal *t = get_terminal (terminal, 1); @@ -2356,8 +2353,7 @@ TERMINAL can be a terminal object, a frame, or nil (meaning the selected frame's terminal). This function always returns nil if TERMINAL is not on a tty device. */) - (terminal) - Lisp_Object terminal; + (Lisp_Object terminal) { struct terminal *t = get_terminal (terminal, 1); @@ -2377,8 +2373,7 @@ TERMINAL can be a terminal object, a frame or nil (meaning the selected frame's terminal). This function always returns nil if TERMINAL does not refer to a text-only terminal. */) - (terminal) - Lisp_Object terminal; + (Lisp_Object terminal) { struct terminal *t = get_terminal (terminal, 1); @@ -2408,8 +2403,7 @@ suspended. A suspended tty may be resumed by calling `resume-tty' on it. */) - (tty) - Lisp_Object tty; + (Lisp_Object tty) { struct terminal *t = get_tty_terminal (tty, 1); FILE *f; @@ -2475,8 +2469,7 @@ TTY may be a terminal object, a frame, or nil (meaning the selected frame's terminal). */) - (tty) - Lisp_Object tty; + (Lisp_Object tty) { struct terminal *t = get_tty_terminal (tty, 1); int fd; @@ -3148,7 +3141,7 @@ 0, 0, 0, doc: /* Open a connection to Gpm. Gpm-mouse can only be activated for one tty at a time. */) - () + (void) { struct frame *f = SELECTED_FRAME (); struct tty_display_info *tty @@ -3196,7 +3189,7 @@ DEFUN ("gpm-mouse-stop", Fgpm_mouse_stop, Sgpm_mouse_stop, 0, 0, 0, doc: /* Close a connection to Gpm. */) - () + (void) { struct frame *f = SELECTED_FRAME (); struct tty_display_info *tty @@ -3229,7 +3222,7 @@ abort (); t = xmalloc (sizeof (struct tty_output)); - bzero (t, sizeof (struct tty_output)); + memset (t, 0, sizeof (struct tty_output)); t->display_info = FRAME_TERMINAL (f)->display_info.tty; @@ -3436,7 +3429,7 @@ #else tty = (struct tty_display_info *) xmalloc (sizeof (struct tty_display_info)); #endif - bzero (tty, sizeof (struct tty_display_info)); + memset (tty, 0, sizeof (struct tty_display_info)); tty->next = tty_list; tty_list = tty; @@ -4028,7 +4021,7 @@ xfree (tty->termcap_strings_buffer); xfree (tty->termcap_term_buffer); - bzero (tty, sizeof (struct tty_display_info)); + memset (tty, 0, sizeof (struct tty_display_info)); xfree (tty); }
--- a/src/termcap.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/termcap.c Thu Jul 08 22:47:34 2010 +0000 @@ -18,12 +18,7 @@ Boston, MA 02110-1301, USA. */ /* Emacs config.h may rename various library functions such as malloc. */ -#ifdef HAVE_CONFIG_H #include <config.h> -#endif - -#ifdef emacs - #include <setjmp.h> #include <lisp.h> /* xmalloc is here */ /* Get the O_* definitions for open et al. */ @@ -35,31 +30,6 @@ #include <unistd.h> #endif -#else /* not emacs */ - -#ifdef STDC_HEADERS -#include <stdlib.h> -#include <string.h> -#else -char *getenv (); -char *malloc (); -char *realloc (); -#endif - -/* Do this after the include, in case string.h prototypes bcopy. */ -#if (defined(HAVE_STRING_H) || defined(STDC_HEADERS)) && !defined(bcopy) -#define bcopy(s, d, n) memcpy ((d), (s), (n)) -#endif - -#ifdef HAVE_UNISTD_H -#include <unistd.h> -#endif -#ifdef HAVE_FCNTL_H -#include <fcntl.h> -#endif - -#endif /* not emacs */ - #ifndef NULL #define NULL (char *) 0 #endif @@ -89,37 +59,6 @@ #define TERMCAP_FILE "/etc/termcap" #endif -#ifndef emacs -static void -memory_out () -{ - write (2, "virtual memory exhausted\n", 25); - exit (1); -} - -static char * -xmalloc (size) - unsigned size; -{ - register char *tem = malloc (size); - - if (!tem) - memory_out (); - return tem; -} - -static char * -xrealloc (ptr, size) - char *ptr; - unsigned size; -{ - register char *tem = realloc (ptr, size); - - if (!tem) - memory_out (); - return tem; -} -#endif /* not emacs */ /* Looking up capabilities in the entry already found. */ @@ -315,7 +254,7 @@ cut[last_p_param].len = r - cut[last_p_param].beg; for (i = 0, wp = ret; i <= last_p_param; wp += cut[i++].len) - bcopy (cut[i].beg, wp, cut[i].len); + memcpy (wp, cut[i].beg, cut[i].len); r = wp; } } @@ -739,7 +678,7 @@ else { append_end -= bufp->ptr - buf; - bcopy (bufp->ptr, buf, bufp->full -= bufp->ptr - buf); + memcpy (buf, bufp->ptr, bufp->full -= bufp->ptr - buf); bufp->ptr = buf; } if (!(nread = read (fd, buf + bufp->full, bufp->size - bufp->full)))
--- a/src/termhooks.h Wed Jul 07 22:09:05 2010 +0000 +++ b/src/termhooks.h Thu Jul 08 22:47:34 2010 +0000 @@ -255,7 +255,7 @@ Lisp_Object arg; }; -#define EVENT_INIT(event) bzero (&(event), sizeof (struct input_event)) +#define EVENT_INIT(event) memset (&(event), 0, sizeof (struct input_event)) /* Bits in the modifiers member of the input_event structure. Note that reorder_modifiers assumes that the bits are in canonical
--- a/src/terminal.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/terminal.c Thu Jul 08 22:47:34 2010 +0000 @@ -300,8 +300,7 @@ Normally, you may not delete a display if all other displays are suspended, but if the second argument FORCE is non-nil, you may do so. */) - (terminal, force) - Lisp_Object terminal, force; + (Lisp_Object terminal, Lisp_Object force) { struct terminal *t = get_terminal (terminal, 0); @@ -342,8 +341,7 @@ If FRAME is nil, the selected frame is used. The terminal device is represented by its integer identifier. */) - (frame) - Lisp_Object frame; + (Lisp_Object frame) { struct terminal *t; @@ -370,8 +368,7 @@ If object is a live display terminal, the return value indicates what sort of output terminal it uses. See the documentation of `framep' for possible return values. */) - (object) - Lisp_Object object; + (Lisp_Object object) { struct terminal *t; @@ -402,7 +399,7 @@ DEFUN ("terminal-list", Fterminal_list, Sterminal_list, 0, 0, 0, doc: /* Return a list of all terminal devices. */) - () + (void) { Lisp_Object terminal, terminals = Qnil; struct terminal *t; @@ -422,8 +419,7 @@ TERMINAL may be a terminal object, a frame, or nil (meaning the selected frame's terminal). */) - (terminal) - Lisp_Object terminal; + (Lisp_Object terminal) { struct terminal *t = TERMINALP (terminal) ? XTERMINAL (terminal) : get_terminal (terminal, 1); @@ -471,8 +467,7 @@ TERMINAL can be a terminal object, a frame, or nil (meaning the selected frame's terminal). */) - (terminal) - Lisp_Object terminal; + (Lisp_Object terminal) { struct terminal *t = TERMINALP (terminal) ? XTERMINAL (terminal) : get_terminal (terminal, 1); @@ -483,9 +478,7 @@ doc: /* Return TERMINAL's value for parameter PARAMETER. TERMINAL can be a terminal object, a frame, or nil (meaning the selected frame's terminal). */) - (terminal, parameter) - Lisp_Object terminal; - Lisp_Object parameter; + (Lisp_Object terminal, Lisp_Object parameter) { Lisp_Object value; struct terminal *t @@ -502,10 +495,7 @@ TERMINAL can be a terminal object, a frame or nil (meaning the selected frame's terminal). */) - (terminal, parameter, value) - Lisp_Object terminal; - Lisp_Object parameter; - Lisp_Object value; + (Lisp_Object terminal, Lisp_Object parameter, Lisp_Object value) { struct terminal *t = TERMINALP (terminal) ? XTERMINAL (terminal) : get_terminal (terminal, 1);
--- a/src/textprop.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/textprop.c Thu Jul 08 22:47:34 2010 +0000 @@ -558,8 +558,7 @@ the current buffer), POSITION is a buffer position (integer or marker). If OBJECT is a string, POSITION is a 0-based index into it. If POSITION is at the end of OBJECT, the value is nil. */) - (position, object) - Lisp_Object position, object; + (Lisp_Object position, Lisp_Object object) { register INTERVAL i; @@ -583,9 +582,7 @@ doc: /* Return the value of POSITION's property PROP, in OBJECT. OBJECT is optional and defaults to the current buffer. If POSITION is at the end of OBJECT, the value is nil. */) - (position, prop, object) - Lisp_Object position, object; - Lisp_Object prop; + (Lisp_Object position, Lisp_Object prop, Lisp_Object object) { return textget (Ftext_properties_at (position, object), prop); } @@ -665,9 +662,7 @@ text properties. If OBJECT is a window, then that window's buffer is used, but window-specific overlays are considered only if they are associated with OBJECT. */) - (position, prop, object) - Lisp_Object position, object; - register Lisp_Object prop; + (Lisp_Object position, Lisp_Object prop, Lisp_Object object) { return get_char_property_and_overlay (position, prop, object, 0); } @@ -686,9 +681,7 @@ a window, then that window's buffer is used, but window-specific overlays are considered only if they are associated with OBJECT. If POSITION is at the end of OBJECT, both car and cdr are nil. */) - (position, prop, object) - Lisp_Object position, object; - register Lisp_Object prop; + (Lisp_Object position, Lisp_Object prop, Lisp_Object object) { Lisp_Object overlay; Lisp_Object val @@ -708,8 +701,7 @@ If the optional second argument LIMIT is non-nil, don't search past position LIMIT; return LIMIT if nothing is found before LIMIT. LIMIT is a no-op if it is greater than (point-max). */) - (position, limit) - Lisp_Object position, limit; + (Lisp_Object position, Lisp_Object limit) { Lisp_Object temp; @@ -734,8 +726,7 @@ If the optional second argument LIMIT is non-nil, don't search past position LIMIT; return LIMIT if nothing is found before LIMIT. LIMIT is a no-op if it is less than (point-min). */) - (position, limit) - Lisp_Object position, limit; + (Lisp_Object position, Lisp_Object limit) { Lisp_Object temp; @@ -767,8 +758,7 @@ last valid position in OBJECT. If the optional fourth argument LIMIT is non-nil, don't search past position LIMIT; return LIMIT if nothing is found before LIMIT. */) - (position, prop, object, limit) - Lisp_Object prop, position, object, limit; + (Lisp_Object position, Lisp_Object prop, Lisp_Object object, Lisp_Object limit) { if (STRINGP (object)) { @@ -852,8 +842,7 @@ first valid position in OBJECT. If the optional fourth argument LIMIT is non-nil, don't search back past position LIMIT; return LIMIT if nothing is found before LIMIT. */) - (position, prop, object, limit) - Lisp_Object prop, position, object, limit; + (Lisp_Object position, Lisp_Object prop, Lisp_Object object, Lisp_Object limit) { if (STRINGP (object)) { @@ -941,8 +930,7 @@ If the optional third argument LIMIT is non-nil, don't search past position LIMIT; return LIMIT if nothing is found before LIMIT. */) - (position, object, limit) - Lisp_Object position, object, limit; + (Lisp_Object position, Lisp_Object object, Lisp_Object limit) { register INTERVAL i, next; @@ -1038,8 +1026,7 @@ If the optional fourth argument LIMIT is non-nil, don't search past position LIMIT; return LIMIT if nothing is found before LIMIT. */) - (position, prop, object, limit) - Lisp_Object position, prop, object, limit; + (Lisp_Object position, Lisp_Object prop, Lisp_Object object, Lisp_Object limit) { register INTERVAL i, next; register Lisp_Object here_val; @@ -1086,8 +1073,7 @@ If the optional third argument LIMIT is non-nil, don't search back past position LIMIT; return LIMIT if nothing is found until LIMIT. */) - (position, object, limit) - Lisp_Object position, object, limit; + (Lisp_Object position, Lisp_Object object, Lisp_Object limit) { register INTERVAL i, previous; @@ -1135,8 +1121,7 @@ If the optional fourth argument LIMIT is non-nil, don't search back past position LIMIT; return LIMIT if nothing is found until LIMIT. */) - (position, prop, object, limit) - Lisp_Object position, prop, object, limit; + (Lisp_Object position, Lisp_Object prop, Lisp_Object object, Lisp_Object limit) { register INTERVAL i, previous; register Lisp_Object here_val; @@ -1185,8 +1170,7 @@ START and END are buffer positions (integers or markers). If OBJECT is a string, START and END are 0-based indices into it. Return t if any property value actually changed, nil otherwise. */) - (start, end, properties, object) - Lisp_Object start, end, properties, object; + (Lisp_Object start, Lisp_Object end, Lisp_Object properties, Lisp_Object object) { register INTERVAL i, unchanged; register int s, len, modified = 0; @@ -1293,8 +1277,7 @@ If the optional fifth argument OBJECT is a buffer (or nil, which means the current buffer), START and END are buffer positions (integers or markers). If OBJECT is a string, START and END are 0-based indices into it. */) - (start, end, property, value, object) - Lisp_Object start, end, property, value, object; + (Lisp_Object start, Lisp_Object end, Lisp_Object property, Lisp_Object value, Lisp_Object object) { Fadd_text_properties (start, end, Fcons (property, Fcons (value, Qnil)), @@ -1311,8 +1294,7 @@ markers). If OBJECT is a string, START and END are 0-based indices into it. If PROPERTIES is nil, the effect is to remove all properties from the designated part of OBJECT. */) - (start, end, properties, object) - Lisp_Object start, end, properties, object; + (Lisp_Object start, Lisp_Object end, Lisp_Object properties, Lisp_Object object) { return set_text_properties (start, end, properties, object, Qt); } @@ -1481,8 +1463,7 @@ Return t if any property was actually removed, nil otherwise. Use `set-text-properties' if you want to remove all text properties. */) - (start, end, properties, object) - Lisp_Object start, end, properties, object; + (Lisp_Object start, Lisp_Object end, Lisp_Object properties, Lisp_Object object) { register INTERVAL i, unchanged; register int s, len, modified = 0; @@ -1567,8 +1548,7 @@ the current buffer), START and END are buffer positions (integers or markers). If OBJECT is a string, START and END are 0-based indices into it. Return t if any property was actually removed, nil otherwise. */) - (start, end, list_of_properties, object) - Lisp_Object start, end, list_of_properties, object; + (Lisp_Object start, Lisp_Object end, Lisp_Object list_of_properties, Lisp_Object object) { register INTERVAL i, unchanged; register int s, len, modified = 0; @@ -1675,8 +1655,7 @@ If the optional fifth argument OBJECT is a buffer (or nil, which means the current buffer), START and END are buffer positions (integers or markers). If OBJECT is a string, START and END are 0-based indices into it. */) - (start, end, property, value, object) - Lisp_Object start, end, property, value, object; + (Lisp_Object start, Lisp_Object end, Lisp_Object property, Lisp_Object value, Lisp_Object object) { register INTERVAL i; register int e, pos; @@ -1712,8 +1691,7 @@ If the optional fifth argument OBJECT is a buffer (or nil, which means the current buffer), START and END are buffer positions (integers or markers). If OBJECT is a string, START and END are 0-based indices into it. */) - (start, end, property, value, object) - Lisp_Object start, end, property, value, object; + (Lisp_Object start, Lisp_Object end, Lisp_Object property, Lisp_Object value, Lisp_Object object) { register INTERVAL i; register int s, e;
--- a/src/tparam.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/tparam.c Thu Jul 08 22:47:34 2010 +0000 @@ -18,66 +18,14 @@ Boston, MA 02110-1301, USA. */ /* Emacs config.h may rename various library functions such as malloc. */ -#ifdef HAVE_CONFIG_H #include <config.h> -#endif - -#ifdef emacs #include <setjmp.h> #include "lisp.h" /* for xmalloc */ -#else - -#ifdef STDC_HEADERS -#include <stdlib.h> -#include <string.h> -#else -char *malloc (); -char *realloc (); -#endif - -/* Do this after the include, in case string.h prototypes bcopy. */ -#if (defined(HAVE_STRING_H) || defined(STDC_HEADERS)) && !defined(bcopy) -#define bcopy(s, d, n) memcpy ((d), (s), (n)) -#endif - -#endif /* not emacs */ #ifndef NULL #define NULL (char *) 0 #endif -#ifndef emacs -static void -memory_out () -{ - write (2, "virtual memory exhausted\n", 25); - exit (1); -} - -static char * -xmalloc (size) - unsigned size; -{ - register char *tem = malloc (size); - - if (!tem) - memory_out (); - return tem; -} - -static char * -xrealloc (ptr, size) - char *ptr; - unsigned size; -{ - register char *tem = realloc (ptr, size); - - if (!tem) - memory_out (); - return tem; -} -#endif /* not emacs */ - /* Assuming STRING is the value of a termcap string entry containing `%' constructs to expand parameters, merge in parameter values and store result in block OUTSTRING points to. @@ -151,7 +99,7 @@ { outlen = len + 40; new = (char *) xmalloc (outlen); - bcopy (outstring, new, offset); + memcpy (new, outstring, offset); } else {
--- a/src/undo.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/undo.c Thu Jul 08 22:47:34 2010 +0000 @@ -288,7 +288,7 @@ doc: /* Mark a boundary between units of undo. An undo command will stop at this point, but another undo command will undo to the previous boundary. */) - () + (void) { Lisp_Object tem; if (EQ (current_buffer->undo_list, Qt)) @@ -455,8 +455,7 @@ DEFUN ("primitive-undo", Fprimitive_undo, Sprimitive_undo, 2, 2, 0, doc: /* Undo N records from the front of the list LIST. Return what remains of the list. */) - (n, list) - Lisp_Object n, list; + (Lisp_Object n, Lisp_Object list) { struct gcpro gcpro1, gcpro2; Lisp_Object next;
--- a/src/unexaix.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/unexaix.c Thu Jul 08 22:47:34 2010 +0000 @@ -71,7 +71,7 @@ #include <unistd.h> #include <fcntl.h> -extern char *start_of_text (void); /* Start of text */ +char *start_of_text (void); /* Start of text */ extern char *start_of_data (void); /* Start of initialized data */ extern int _data; @@ -669,5 +669,18 @@ return 0; } +/* + * Return the address of the start of the text segment prior to + * doing an unexec. After unexec the return value is undefined. + * See crt0.c for further explanation and _start. + * + */ + +char * +start_of_text (void) +{ + return ((char *) 0x10000000); +} + /* arch-tag: 0783857a-7c2d-456f-a426-58b722d69fd0 (do not change this comment) */
--- a/src/unexalpha.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/unexalpha.c Thu Jul 08 22:47:34 2010 +0000 @@ -28,9 +28,7 @@ #include <sys/mman.h> #include <stdio.h> #include <errno.h> -#ifdef HAVE_STRING_H #include <string.h> -#endif #if !defined (__NetBSD__) && !defined (__OpenBSD__) #include <filehdr.h> #include <aouthdr.h> @@ -79,8 +77,10 @@ #define _RDATA ".rdata" #define _SDATA ".sdata" #define _SBSS ".sbss" +#define TEXT_START 0x120000000 #endif /* __NetBSD__ || __OpenBSD__ */ + static void fatal_unexec (char *, char *); static void mark_x (char *); @@ -260,7 +260,7 @@ Brk = brk; - bcopy (data_section, &old_data_scnhdr, sizeof (old_data_scnhdr)); + memcpy (&old_data_scnhdr, data_section, sizeof (old_data_scnhdr)); nhdr.aout.dsize = brk - DATA_START; nhdr.aout.bsize = 0; @@ -328,7 +328,7 @@ #ifdef _GOT if (got_section != NULL) { - bcopy (got_section, buffer, sizeof (struct scnhdr)); + memcpy (buffer, got_section, sizeof (struct scnhdr)); got_section->s_vaddr = vaddr; got_section->s_paddr = vaddr; @@ -376,7 +376,7 @@ * Construct new symbol table header */ - bcopy (oldptr + nhdr.fhdr.f_symptr, buffer, cbHDRR); + memcpy (buffer, oldptr + nhdr.fhdr.f_symptr, cbHDRR); #define symhdr ((pHDRR)buffer) newsyms = nhdr.aout.tsize + nhdr.aout.dsize;
--- a/src/unexec.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/unexec.c Thu Jul 08 22:47:34 2010 +0000 @@ -472,7 +472,7 @@ int pagesize = getpagesize (); char zeros[1 << 13]; - bzero (zeros, sizeof (zeros)); + memset (zeros, 0, sizeof (zeros)); for (i = 0; ptr < end;) { @@ -687,6 +687,21 @@ return 0; } +extern unsigned start __asm__ ("start"); + +/* + * Return the address of the start of the text segment prior to + * doing an unexec. After unexec the return value is undefined. + * See crt0.c for further explanation and _start. + * + */ + +char * +start_of_text (void) +{ + return ((char *) &start); +} + /* **************************************************************** * unexec *
--- a/src/unexmacosx.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/unexmacosx.c Thu Jul 08 22:47:34 2010 +0000 @@ -218,7 +218,7 @@ char buf[UNEXEC_COPY_BUFSZ]; ssize_t bytes; - bzero (buf, UNEXEC_COPY_BUFSZ); + memset (buf, 0, UNEXEC_COPY_BUFSZ); if (lseek (outfd, dest, SEEK_SET) != dest) return 0;
--- a/src/vm-limit.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/vm-limit.c Thu Jul 08 22:47:34 2010 +0000 @@ -244,6 +244,46 @@ (*warn_function) ("Warning: memory in use exceeds lisp pointer size"); } +#if !defined(CANNOT_DUMP) || !defined(SYSTEM_MALLOC) +/* Some systems that cannot dump also cannot implement these. */ + +/* + * Return the address of the start of the data segment prior to + * doing an unexec. After unexec the return value is undefined. + * See crt0.c for further information and definition of data_start. + * + * Apparently, on BSD systems this is etext at startup. On + * USG systems (swapping) this is highly mmu dependent and + * is also dependent on whether or not the program is running + * with shared text. Generally there is a (possibly large) + * gap between end of text and start of data with shared text. + * + */ + +POINTER +start_of_data (void) +{ +#ifdef BSD_SYSTEM + extern char etext; + return (POINTER)(&etext); +#elif defined DATA_START + return ((POINTER) DATA_START); +#elif defined ORDINARY_LINK + /* + * This is a hack. Since we're not linking crt0.c or pre_crt0.c, + * data_start isn't defined. We take the address of environ, which + * is known to live at or near the start of the system crt0.c, and + * we don't sweat the handful of bytes that might lose. + */ + extern char **environ; + return ((POINTER) &environ); +#else + extern int data_start; + return ((POINTER) &data_start); +#endif +} +#endif /* (not CANNOT_DUMP or not SYSTEM_MALLOC) */ + /* Enable memory usage warnings. START says where the end of pure storage is. WARNFUN specifies the function to call to issue a warning. */
--- a/src/w16select.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/w16select.c Thu Jul 08 22:47:34 2010 +0000 @@ -453,8 +453,7 @@ DEFUN ("w16-set-clipboard-data", Fw16_set_clipboard_data, Sw16_set_clipboard_data, 1, 2, 0, doc: /* This sets the clipboard data to the given text. */) - (string, frame) - Lisp_Object string, frame; + (Lisp_Object string, Lisp_Object frame) { unsigned ok = 1, put_status = 0; int nbytes, charset_info, no_crlf_conversion; @@ -563,8 +562,7 @@ DEFUN ("w16-get-clipboard-data", Fw16_get_clipboard_data, Sw16_get_clipboard_data, 0, 1, 0, doc: /* This gets the clipboard data in text format. */) - (frame) - Lisp_Object frame; + (Lisp_Object frame) { unsigned data_size, truelen; unsigned char *htext = NULL; @@ -658,8 +656,7 @@ \(Those are literal upper-case symbol names, since that's what X expects.) For convenience, the symbol nil is the same as `PRIMARY', and t is the same as `SECONDARY'. */) - (selection) - Lisp_Object selection; + (Lisp_Object selection) { CHECK_SYMBOL (selection);
--- a/src/w32console.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/w32console.c Thu Jul 08 22:47:34 2010 +0000 @@ -393,8 +393,7 @@ to use the corresponding system sound for the bell. The 'silent sound prevents Emacs from making any sound at all. SOUND is nil to use the normal beep. */) - (sound) - Lisp_Object sound; + (Lisp_Object sound) { CHECK_SYMBOL (sound); @@ -748,9 +747,7 @@ DEFUN ("set-screen-color", Fset_screen_color, Sset_screen_color, 2, 2, 0, doc: /* Set screen colors. */) - (foreground, background) - Lisp_Object foreground; - Lisp_Object background; + (Lisp_Object foreground, Lisp_Object background) { char_attr_normal = XFASTINT (foreground) + (XFASTINT (background) << 4); @@ -760,8 +757,7 @@ DEFUN ("set-cursor-size", Fset_cursor_size, Sset_cursor_size, 1, 1, 0, doc: /* Set cursor size. */) - (size) - Lisp_Object size; + (Lisp_Object size) { CONSOLE_CURSOR_INFO cci; cci.dwSize = XFASTINT (size);
--- a/src/w32fns.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/w32fns.c Thu Jul 08 22:47:34 2010 +0000 @@ -475,8 +475,7 @@ This adds or updates a named color to `w32-color-map', making it available for use. The original entry's RGB ref is returned, or nil if the entry is new. */) - (red, green, blue, name) - Lisp_Object red, green, blue, name; + (Lisp_Object red, Lisp_Object green, Lisp_Object blue, Lisp_Object name) { Lisp_Object rgb; Lisp_Object oldrgb = Qnil; @@ -762,7 +761,7 @@ DEFUN ("w32-default-color-map", Fw32_default_color_map, Sw32_default_color_map, 0, 0, 0, doc: /* Return the default color map. */) - () + (void) { int i; colormap_t *pc = w32_color_map; @@ -2746,7 +2745,7 @@ { PAINTSTRUCT paintStruct; RECT update_rect; - bzero (&update_rect, sizeof (update_rect)); + memset (&update_rect, 0, sizeof (update_rect)); f = x_window_to_frame (dpyinfo, hwnd); if (f == 0) @@ -4191,8 +4190,7 @@ be shared by the new frame. This function is an internal primitive--use `make-frame' instead. */) - (parameters) - Lisp_Object parameters; + (Lisp_Object parameters) { struct frame *f; Lisp_Object frame, tem; @@ -4275,7 +4273,7 @@ f->output_method = output_w32; f->output_data.w32 = (struct w32_output *) xmalloc (sizeof (struct w32_output)); - bzero (f->output_data.w32, sizeof (struct w32_output)); + memset (f->output_data.w32, 0, sizeof (struct w32_output)); FRAME_FONTSET (f) = -1; f->icon_name @@ -4520,8 +4518,7 @@ DEFUN ("x-focus-frame", Fx_focus_frame, Sx_focus_frame, 1, 1, 0, doc: /* Give FRAME input focus, raising to foreground if necessary. */) - (frame) - Lisp_Object frame; + (Lisp_Object frame) { x_focus_on_frame (check_x_frame (frame)); return Qnil; @@ -4530,8 +4527,7 @@ DEFUN ("xw-color-defined-p", Fxw_color_defined_p, Sxw_color_defined_p, 1, 2, 0, doc: /* Internal function called by `color-defined-p', which see. */) - (color, frame) - Lisp_Object color, frame; + (Lisp_Object color, Lisp_Object frame) { XColor foo; FRAME_PTR f = check_x_frame (frame); @@ -4546,8 +4542,7 @@ DEFUN ("xw-color-values", Fxw_color_values, Sxw_color_values, 1, 2, 0, doc: /* Internal function called by `color-values', which see. */) - (color, frame) - Lisp_Object color, frame; + (Lisp_Object color, Lisp_Object frame) { XColor foo; FRAME_PTR f = check_x_frame (frame); @@ -4567,8 +4562,7 @@ DEFUN ("xw-display-color-p", Fxw_display_color_p, Sxw_display_color_p, 0, 1, 0, doc: /* Internal function called by `display-color-p', which see. */) - (display) - Lisp_Object display; + (Lisp_Object display) { struct w32_display_info *dpyinfo = check_x_display_info (display); @@ -4585,8 +4579,7 @@ The optional argument DISPLAY specifies which display to ask about. DISPLAY should be either a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) - Lisp_Object display; + (Lisp_Object display) { struct w32_display_info *dpyinfo = check_x_display_info (display); @@ -4602,8 +4595,7 @@ The optional argument DISPLAY specifies which display to ask about. DISPLAY should be either a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) - Lisp_Object display; + (Lisp_Object display) { struct w32_display_info *dpyinfo = check_x_display_info (display); @@ -4616,8 +4608,7 @@ The optional argument DISPLAY specifies which display to ask about. DISPLAY should be either a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) - Lisp_Object display; + (Lisp_Object display) { struct w32_display_info *dpyinfo = check_x_display_info (display); @@ -4630,8 +4621,7 @@ The optional argument DISPLAY specifies which display to ask about. DISPLAY should be either a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) - Lisp_Object display; + (Lisp_Object display) { struct w32_display_info *dpyinfo = check_x_display_info (display); @@ -4644,8 +4634,7 @@ The optional argument DISPLAY specifies which display to ask about. DISPLAY should be either a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) - Lisp_Object display; + (Lisp_Object display) { struct w32_display_info *dpyinfo = check_x_display_info (display); HDC hdc; @@ -4674,8 +4663,7 @@ The optional argument DISPLAY specifies which display to ask about. DISPLAY should be either a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) - Lisp_Object display; + (Lisp_Object display) { struct w32_display_info *dpyinfo = check_x_display_info (display); @@ -4687,8 +4675,7 @@ The optional argument DISPLAY specifies which display to ask about. DISPLAY should be either a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) - Lisp_Object display; + (Lisp_Object display) { return build_string ("Microsoft Corp."); } @@ -4702,8 +4689,7 @@ The optional argument DISPLAY specifies which display to ask about. DISPLAY should be either a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) - Lisp_Object display; + (Lisp_Object display) { return Fcons (make_number (w32_major_version), Fcons (make_number (w32_minor_version), @@ -4715,8 +4701,7 @@ The optional argument DISPLAY specifies which display to ask about. DISPLAY should be either a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) - Lisp_Object display; + (Lisp_Object display) { return make_number (1); } @@ -4727,8 +4712,7 @@ The optional argument DISPLAY specifies which display to ask about. DISPLAY should be either a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) - Lisp_Object display; + (Lisp_Object display) { struct w32_display_info *dpyinfo = check_x_display_info (display); HDC hdc; @@ -4748,8 +4732,7 @@ The optional argument DISPLAY specifies which display to ask about. DISPLAY should be either a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) - Lisp_Object display; + (Lisp_Object display) { struct w32_display_info *dpyinfo = check_x_display_info (display); @@ -4772,8 +4755,7 @@ The optional argument DISPLAY specifies which display to ask about. DISPLAY should be either a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) - Lisp_Object display; + (Lisp_Object display) { return intern ("not-useful"); } @@ -4787,8 +4769,7 @@ The optional argument DISPLAY specifies which display to ask about. DISPLAY should be either a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) - Lisp_Object display; + (Lisp_Object display) { struct w32_display_info *dpyinfo = check_x_display_info (display); Lisp_Object result = Qnil; @@ -4811,8 +4792,7 @@ The optional argument DISPLAY specifies which display to ask about. DISPLAY should be either a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) - Lisp_Object display; + (Lisp_Object display) { return Qnil; } @@ -4891,8 +4871,7 @@ Optional second arg XRM-STRING is a string of resources in xrdb format. If the optional third arg MUST-SUCCEED is non-nil, terminate Emacs if we can't open the connection. */) - (display, xrm_string, must_succeed) - Lisp_Object display, xrm_string, must_succeed; + (Lisp_Object display, Lisp_Object xrm_string, Lisp_Object must_succeed) { unsigned char *xrm_option; struct w32_display_info *dpyinfo; @@ -4980,8 +4959,7 @@ doc: /* Close the connection to DISPLAY's server. For DISPLAY, specify either a frame or a display name (a string). If DISPLAY is nil, that stands for the selected frame's display. */) - (display) - Lisp_Object display; + (Lisp_Object display) { struct w32_display_info *dpyinfo = check_x_display_info (display); int i; @@ -5000,7 +4978,7 @@ DEFUN ("x-display-list", Fx_display_list, Sx_display_list, 0, 0, 0, doc: /* Return the list of display names that Emacs has connections to. */) - () + (void) { Lisp_Object tail, result; @@ -5013,8 +4991,7 @@ DEFUN ("x-synchronize", Fx_synchronize, Sx_synchronize, 1, 2, 0, doc: /* This is a noop on W32 systems. */) - (on, display) - Lisp_Object display, on; + (Lisp_Object on, Lisp_Object display) { return Qnil; } @@ -5043,8 +5020,7 @@ FRAME. Default is to change on the edit X window. Value is VALUE. */) - (prop, value, frame, type, format, outer_p) - Lisp_Object prop, value, frame, type, format, outer_p; + (Lisp_Object prop, Lisp_Object value, Lisp_Object frame, Lisp_Object type, Lisp_Object format, Lisp_Object outer_p) { #if 0 /* TODO : port window properties to W32 */ struct frame *f = check_x_frame (frame); @@ -5073,8 +5049,7 @@ Sx_delete_window_property, 1, 2, 0, doc: /* Remove window property PROP from X window of FRAME. FRAME nil or omitted means use the selected frame. Value is PROP. */) - (prop, frame) - Lisp_Object prop, frame; + (Lisp_Object prop, Lisp_Object frame) { #if 0 /* TODO : port window properties to W32 */ @@ -5101,8 +5076,7 @@ If FRAME is nil or omitted, use the selected frame. Value is nil if FRAME hasn't a property with name PROP or if PROP has no string value. */) - (prop, frame) - Lisp_Object prop, frame; + (Lisp_Object prop, Lisp_Object frame) { #if 0 /* TODO : port window properties to W32 */ @@ -5388,7 +5362,7 @@ f->output_method = output_w32; f->output_data.w32 = (struct w32_output *) xmalloc (sizeof (struct w32_output)); - bzero (f->output_data.w32, sizeof (struct w32_output)); + memset (f->output_data.w32, 0, sizeof (struct w32_output)); FRAME_FONTSET (f) = -1; f->icon_name = Qnil; @@ -5670,8 +5644,7 @@ A tooltip's maximum size is specified by `x-max-tooltip-size'. Text larger than the specified size is clipped. */) - (string, frame, parms, timeout, dx, dy) - Lisp_Object string, frame, parms, timeout, dx, dy; + (Lisp_Object string, Lisp_Object frame, Lisp_Object parms, Lisp_Object timeout, Lisp_Object dx, Lisp_Object dy) { struct frame *f; struct window *w; @@ -5900,7 +5873,7 @@ DEFUN ("x-hide-tip", Fx_hide_tip, Sx_hide_tip, 0, 0, 0, doc: /* Hide the current tooltip window, if there is any. Value is t if tooltip was open, nil otherwise. */) - () + (void) { int count; Lisp_Object deleted, frame, timer; @@ -5996,8 +5969,7 @@ Select DEFAULT-FILENAME in the dialog's file selection box, if specified. Ensure that file exists if MUSTMATCH is non-nil. If ONLY-DIR-P is non-nil, the user can only select directories. */) - (prompt, dir, default_filename, mustmatch, only_dir_p) - Lisp_Object prompt, dir, default_filename, mustmatch, only_dir_p; + (Lisp_Object prompt, Lisp_Object dir, Lisp_Object default_filename, Lisp_Object mustmatch, Lisp_Object only_dir_p) { struct frame *f = SELECTED_FRAME (); Lisp_Object file = Qnil; @@ -6046,7 +6018,7 @@ specbind (Qinhibit_redisplay, Qt); BLOCK_INPUT; - bzero (&new_file_details, sizeof (new_file_details)); + memset (&new_file_details, 0, sizeof (new_file_details)); /* Apparently NT4 crashes if you give it an unexpected size. I'm not sure about Windows 9x, so play it safe. */ if (w32_major_version > 4 && w32_major_version < 95) @@ -6125,8 +6097,7 @@ DEFUN ("system-move-file-to-trash", Fsystem_move_file_to_trash, Ssystem_move_file_to_trash, 1, 1, 0, doc: /* Move file or directory named FILENAME to the recycle bin. */) - (filename) - Lisp_Object filename; + (Lisp_Object filename) { Lisp_Object handler; Lisp_Object encoded_file; @@ -6157,10 +6128,10 @@ /* On Windows, write permission is required to delete/move files. */ _chmod (path, 0666); - bzero (tmp_path, sizeof (tmp_path)); + memset (tmp_path, 0, sizeof (tmp_path)); strcpy (tmp_path, path); - bzero (&file_op, sizeof (file_op)); + memset (&file_op, 0, sizeof (file_op)); file_op.hwnd = HWND_DESKTOP; file_op.wFunc = FO_DELETE; file_op.pFrom = tmp_path; @@ -6188,8 +6159,7 @@ screen saver if defined. If optional parameter FRAME is not specified, use selected frame. */) - (command, frame) - Lisp_Object command, frame; + (Lisp_Object command, Lisp_Object frame) { FRAME_PTR f = check_x_frame (frame); @@ -6242,8 +6212,7 @@ 1 - start normally 3 - start maximized 6 - start minimized */) - (operation, document, parameters, show_flag) - Lisp_Object operation, document, parameters, show_flag; + (Lisp_Object operation, Lisp_Object document, Lisp_Object parameters, Lisp_Object show_flag) { Lisp_Object current_dir; char *errstr; @@ -6380,8 +6349,7 @@ is always interpreted as the Windows modifier keys. The return value is the hotkey-id if registered, otherwise nil. */) - (key) - Lisp_Object key; + (Lisp_Object key) { key = w32_parse_hot_key (key); @@ -6413,8 +6381,7 @@ DEFUN ("w32-unregister-hot-key", Fw32_unregister_hot_key, Sw32_unregister_hot_key, 1, 1, 0, doc: /* Unregister KEY as a hot-key combination. */) - (key) - Lisp_Object key; + (Lisp_Object key) { Lisp_Object item; @@ -6446,7 +6413,7 @@ DEFUN ("w32-registered-hot-keys", Fw32_registered_hot_keys, Sw32_registered_hot_keys, 0, 0, 0, doc: /* Return list of registered hot-key IDs. */) - () + (void) { return Fdelq (Qnil, Fcopy_sequence (w32_grabbed_keys)); } @@ -6455,8 +6422,7 @@ Sw32_reconstruct_hot_key, 1, 1, 0, doc: /* Convert hot-key ID to a lisp key combination. usage: (w32-reconstruct-hot-key ID) */) - (hotkeyid) - Lisp_Object hotkeyid; + (Lisp_Object hotkeyid) { int vk_code, w32_modifiers; Lisp_Object key; @@ -6490,8 +6456,7 @@ KEY can be `capslock', `kp-numlock', or `scroll'. If the optional parameter NEW-STATE is a number, then the state of KEY is set to off if the low bit of NEW-STATE is zero, otherwise on. */) - (key, new_state) - Lisp_Object key, new_state; + (Lisp_Object key, Lisp_Object new_state) { int vk_code; @@ -6527,8 +6492,7 @@ doc: /* Return non-nil if a window exists with the specified CLASS and NAME. This is a direct interface to the Windows API FindWindow function. */) - (class, name) - Lisp_Object class, name; + (Lisp_Object class, Lisp_Object name) { HWND hnd; @@ -6557,7 +6521,7 @@ %m Remaining time (to charge or discharge) in minutes %h Remaining time (to charge or discharge) in hours %t Remaining time (to charge or discharge) in the form `h:min' */) - () + (void) { Lisp_Object status = Qnil; @@ -6661,8 +6625,7 @@ storage of the file system, FREE is the free storage, and AVAIL is the storage available to a non-superuser. All 3 numbers are in bytes. If the underlying system call fails, value is nil. */) - (filename) - Lisp_Object filename; + (Lisp_Object filename) { Lisp_Object encoded, value; @@ -6754,7 +6717,7 @@ DEFUN ("default-printer-name", Fdefault_printer_name, Sdefault_printer_name, 0, 0, 0, doc: /* Return the name of Windows default printer device. */) - () + (void) { static char pname_buf[256]; int err;
--- a/src/w32font.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/w32font.c Thu Jul 08 22:47:34 2010 +0000 @@ -225,7 +225,7 @@ HDC dc; FRAME_PTR f = XFRAME (frame); - bzero (&font_match_pattern, sizeof (font_match_pattern)); + memset (&font_match_pattern, 0, sizeof (font_match_pattern)); font_match_pattern.lfCharSet = DEFAULT_CHARSET; dc = get_frame_dc (f); @@ -373,7 +373,7 @@ if (metrics) { - bzero (metrics, sizeof (struct font_metrics)); + memset (metrics, 0, sizeof (struct font_metrics)); metrics->ascent = font->ascent; metrics->descent = font->descent; @@ -394,9 +394,9 @@ = xrealloc (w32_font->cached_metrics, (block + 1) * sizeof (struct w32_metric_cache *)); - bzero (w32_font->cached_metrics + w32_font->n_cache_blocks, - ((block + 1 - w32_font->n_cache_blocks) - * sizeof (struct w32_metric_cache *))); + memset (w32_font->cached_metrics + w32_font->n_cache_blocks, 0, + ((block + 1 - w32_font->n_cache_blocks) + * sizeof (struct w32_metric_cache *))); w32_font->n_cache_blocks = block + 1; } @@ -404,8 +404,8 @@ { w32_font->cached_metrics[block] = xmalloc (CACHE_BLOCKSIZE * sizeof (struct w32_metric_cache)); - bzero (w32_font->cached_metrics[block], - CACHE_BLOCKSIZE * sizeof (struct w32_metric_cache)); + memset (w32_font->cached_metrics[block], 0, + CACHE_BLOCKSIZE * sizeof (struct w32_metric_cache)); } char_metric = w32_font->cached_metrics[block] + pos_in_block; @@ -706,7 +706,7 @@ match_data.list = Qnil; match_data.frame = frame; - bzero (&match_data.pattern, sizeof (LOGFONT)); + memset (&match_data.pattern, 0, sizeof (LOGFONT)); fill_in_logfont (f, &match_data.pattern, font_spec); /* If the charset is unrecognized, then we won't find a font, so don't @@ -759,7 +759,7 @@ match_data.frame = frame; match_data.list = Qnil; - bzero (&match_data.pattern, sizeof (LOGFONT)); + memset (&match_data.pattern, 0, sizeof (LOGFONT)); fill_in_logfont (f, &match_data.pattern, font_spec); match_data.opentype_only = opentype_only; @@ -795,7 +795,7 @@ if (!font) return 0; - bzero (&logfont, sizeof (logfont)); + memset (&logfont, 0, sizeof (logfont)); fill_in_logfont (f, &logfont, font_entity); /* Prefer truetype fonts, to avoid known problems with type1 fonts, and @@ -824,8 +824,8 @@ { metrics = (OUTLINETEXTMETRICW *) alloca (len); if (GetOutlineTextMetricsW (dc, len, metrics)) - bcopy (&metrics->otmTextMetrics, &w32_font->metrics, - sizeof (TEXTMETRICW)); + memcpy (&w32_font->metrics, &metrics->otmTextMetrics, + sizeof (TEXTMETRICW)); else metrics = NULL; } @@ -2306,7 +2306,7 @@ if (w32_font->glyph_idx) options |= GGO_GLYPH_INDEX; - bzero (&transform, sizeof (transform)); + memset (&transform, 0, sizeof (transform)); transform.eM11.value = 1; transform.eM22.value = 1; @@ -2329,8 +2329,7 @@ If FRAME is omitted or nil, it defaults to the selected frame. If EXCLUDE-PROPORTIONAL is non-nil, exclude proportional fonts in the font selection dialog. */) - (frame, exclude_proportional) - Lisp_Object frame, exclude_proportional; + (Lisp_Object frame, Lisp_Object exclude_proportional) { FRAME_PTR f = check_x_frame (frame); CHOOSEFONT cf; @@ -2340,8 +2339,8 @@ HANDLE oldobj; char buf[100]; - bzero (&cf, sizeof (cf)); - bzero (&lf, sizeof (lf)); + memset (&cf, 0, sizeof (cf)); + memset (&lf, 0, sizeof (lf)); cf.lStructSize = sizeof (cf); cf.hwndOwner = FRAME_W32_WINDOW (f);
--- a/src/w32menu.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/w32menu.c Thu Jul 08 22:47:34 2010 +0000 @@ -156,8 +156,7 @@ If HEADER is non-nil, the frame title for the box is "Information", otherwise it is "Question". */) - (position, contents, header) - Lisp_Object position, contents, header; + (Lisp_Object position, Lisp_Object contents, Lisp_Object header) { FRAME_PTR f = NULL; Lisp_Object window; @@ -450,8 +449,8 @@ /* Save the frame's previous menu bar contents data. */ if (previous_menu_items_used) - bcopy (XVECTOR (f->menu_bar_vector)->contents, previous_items, - previous_menu_items_used * sizeof (Lisp_Object)); + memcpy (previous_items, XVECTOR (f->menu_bar_vector)->contents, + previous_menu_items_used * sizeof (Lisp_Object)); /* Fill in menu_items with the current menu bar contents. This can evaluate Lisp code. */ @@ -1522,7 +1521,7 @@ if (set_menu_item_info) { MENUITEMINFO info; - bzero (&info, sizeof (info)); + memset (&info, 0, sizeof (info)); info.cbSize = sizeof (info); info.fMask = MIIM_DATA; @@ -1605,7 +1604,7 @@ { MENUITEMINFO info; - bzero (&info, sizeof (info)); + memset (&info, 0, sizeof (info)); info.cbSize = sizeof (info); info.fMask = MIIM_DATA; get_menu_item_info (menu, item, FALSE, &info); @@ -1642,7 +1641,7 @@ for (i = 0; i < num; i++) { MENUITEMINFO info; - bzero (&info, sizeof (info)); + memset (&info, 0, sizeof (info)); info.cbSize = sizeof (info); info.fMask = MIIM_DATA | MIIM_TYPE | MIIM_SUBMENU; @@ -1688,7 +1687,7 @@ DEFUN ("menu-or-popup-active-p", Fmenu_or_popup_active_p, Smenu_or_popup_active_p, 0, 0, 0, doc: /* Return t if a menu or popup dialog is active on selected frame. */) - () + (void) { #ifdef HAVE_MENUS FRAME_PTR f;
--- a/src/w32proc.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/w32proc.c Thu Jul 08 22:47:34 2010 +0000 @@ -1723,8 +1723,7 @@ the winsock local hostname is returned (since this may be different from the value of `system-name' and should supplant it), otherwise t is returned to indicate winsock support is present. */) - (load_now) - Lisp_Object load_now; + (Lisp_Object load_now) { int have_winsock; @@ -1755,7 +1754,7 @@ This is provided to allow dial-up socket connections to be disconnected when no longer needed. Returns nil without unloading winsock if any socket connections still exist. */) - () + (void) { return term_winsock () ? Qt : Qnil; } @@ -1770,8 +1769,7 @@ doc: /* Return the short file name version (8.3) of the full path of FILENAME. If FILENAME does not exist, return nil. All path elements in FILENAME are converted to their short names. */) - (filename) - Lisp_Object filename; + (Lisp_Object filename) { char shortname[MAX_PATH]; @@ -1795,8 +1793,7 @@ doc: /* Return the long file name version of the full path of FILENAME. If FILENAME does not exist, return nil. All path elements in FILENAME are converted to their long names. */) - (filename) - Lisp_Object filename; + (Lisp_Object filename) { char longname[ MAX_PATH ]; int drive_only = 0; @@ -1833,8 +1830,7 @@ any other symbol will be interpreted as normal. If successful, the return value is t, otherwise nil. */) - (process, priority) - Lisp_Object process, priority; + (Lisp_Object process, Lisp_Object priority) { HANDLE proc_handle = GetCurrentProcess (); DWORD priority_class = NORMAL_PRIORITY_CLASS; @@ -1956,8 +1952,7 @@ locale information is returned. If LCID (a 16-bit number) is not a valid locale, the result is nil. */) - (lcid, longform) - Lisp_Object lcid, longform; + (Lisp_Object lcid, Lisp_Object longform) { int got_abbrev; int got_full; @@ -2003,7 +1998,7 @@ doc: /* Return Windows locale id for current locale setting. This is a numerical value; use `w32-get-locale-info' to convert to a human-readable form. */) - () + (void) { return make_number (GetThreadLocale ()); } @@ -2043,7 +2038,7 @@ doc: /* Return list of all valid Windows locale ids. Each id is a numerical value; use `w32-get-locale-info' to convert to a human-readable form. */) - () + (void) { Vw32_valid_locale_ids = Qnil; @@ -2060,8 +2055,7 @@ parameter USERP is non-nil, the user default locale setting is returned. This is a numerical value; use `w32-get-locale-info' to convert to a human-readable form. */) - (userp) - Lisp_Object userp; + (Lisp_Object userp) { if (NILP (userp)) return make_number (GetSystemDefaultLCID ()); @@ -2072,8 +2066,7 @@ DEFUN ("w32-set-current-locale", Fw32_set_current_locale, Sw32_set_current_locale, 1, 1, 0, doc: /* Make Windows locale LCID be the current locale setting for Emacs. If successful, the new locale id is returned, otherwise nil. */) - (lcid) - Lisp_Object lcid; + (Lisp_Object lcid) { CHECK_NUMBER (lcid); @@ -2107,7 +2100,7 @@ DEFUN ("w32-get-valid-codepages", Fw32_get_valid_codepages, Sw32_get_valid_codepages, 0, 0, 0, doc: /* Return list of all valid Windows codepages. */) - () + (void) { Vw32_valid_codepages = Qnil; @@ -2121,7 +2114,7 @@ DEFUN ("w32-get-console-codepage", Fw32_get_console_codepage, Sw32_get_console_codepage, 0, 0, 0, doc: /* Return current Windows codepage for console input. */) - () + (void) { return make_number (GetConsoleCP ()); } @@ -2132,8 +2125,7 @@ doc: /* Make Windows codepage CP be the current codepage setting for Emacs. The codepage setting affects keyboard input and display in tty mode. If successful, the new CP is returned, otherwise nil. */) - (cp) - Lisp_Object cp; + (Lisp_Object cp) { CHECK_NUMBER (cp); @@ -2150,7 +2142,7 @@ DEFUN ("w32-get-console-output-codepage", Fw32_get_console_output_codepage, Sw32_get_console_output_codepage, 0, 0, 0, doc: /* Return current Windows codepage for console output. */) - () + (void) { return make_number (GetConsoleOutputCP ()); } @@ -2161,8 +2153,7 @@ doc: /* Make Windows codepage CP be the current codepage setting for Emacs. The codepage setting affects keyboard input and display in tty mode. If successful, the new CP is returned, otherwise nil. */) - (cp) - Lisp_Object cp; + (Lisp_Object cp) { CHECK_NUMBER (cp); @@ -2180,8 +2171,7 @@ Sw32_get_codepage_charset, 1, 1, 0, doc: /* Return charset of codepage CP. Returns nil if the codepage is not valid. */) - (cp) - Lisp_Object cp; + (Lisp_Object cp) { CHARSETINFO info; @@ -2201,7 +2191,7 @@ Sw32_get_valid_keyboard_layouts, 0, 0, 0, doc: /* Return list of Windows keyboard languages and layouts. The return value is a list of pairs of language id and layout id. */) - () + (void) { int num_layouts = GetKeyboardLayoutList (0, NULL); HKL * layouts = (HKL *) alloca (num_layouts * sizeof (HKL)); @@ -2227,7 +2217,7 @@ Sw32_get_keyboard_layout, 0, 0, 0, doc: /* Return current Windows keyboard language and layout. The return value is the cons of the language id and the layout id. */) - () + (void) { DWORD kl = (DWORD) GetKeyboardLayout (dwWindowsThreadId); @@ -2241,8 +2231,7 @@ doc: /* Make LAYOUT be the current keyboard layout for Emacs. The keyboard layout setting affects interpretation of keyboard input. If successful, the new layout id is returned, otherwise nil. */) - (layout) - Lisp_Object layout; + (Lisp_Object layout) { DWORD kl;
--- a/src/w32select.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/w32select.c Thu Jul 08 22:47:34 2010 +0000 @@ -681,8 +681,7 @@ DEFUN ("w32-set-clipboard-data", Fw32_set_clipboard_data, Sw32_set_clipboard_data, 1, 2, 0, doc: /* This sets the clipboard data to the given text. */) - (string, ignored) - Lisp_Object string, ignored; + (Lisp_Object string, Lisp_Object ignored) { BOOL ok = TRUE; int nbytes; @@ -802,8 +801,7 @@ DEFUN ("w32-get-clipboard-data", Fw32_get_clipboard_data, Sw32_get_clipboard_data, 0, 1, 0, doc: /* This gets the clipboard data in text format. */) - (ignored) - Lisp_Object ignored; + (Lisp_Object ignored) { HGLOBAL htext; Lisp_Object ret = Qnil; @@ -1027,8 +1025,7 @@ \(Those are literal upper-case symbol names, since that's what X expects.) For convenience, the symbol nil is the same as `PRIMARY', and t is the same as `SECONDARY'. */) - (selection) - Lisp_Object selection; + (Lisp_Object selection) { CHECK_SYMBOL (selection);
--- a/src/w32term.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/w32term.c Thu Jul 08 22:47:34 2010 +0000 @@ -323,7 +323,7 @@ XCreateGC (void *ignore, Window window, unsigned long mask, XGCValues *xgcv) { XGCValues *gc = (XGCValues *) xmalloc (sizeof (XGCValues)); - bzero (gc, sizeof (XGCValues)); + memset (gc, 0, sizeof (XGCValues)); XChangeGC (ignore, gc, mask, xgcv); @@ -5826,7 +5826,7 @@ { struct w32_display_info *dpyinfo = &one_w32_display_info; - bzero (dpyinfo, sizeof (*dpyinfo)); + memset (dpyinfo, 0, sizeof (*dpyinfo)); /* Put it on w32_display_name_list. */ w32_display_name_list = Fcons (Fcons (display_name, Qnil),
--- a/src/w32uniscribe.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/w32uniscribe.c Thu Jul 08 22:47:34 2010 +0000 @@ -97,7 +97,7 @@ HDC dc; FRAME_PTR f = XFRAME (frame); - bzero (&font_match_pattern, sizeof (font_match_pattern)); + memset (&font_match_pattern, 0, sizeof (font_match_pattern)); /* Limit enumerated fonts to outline fonts to save time. */ font_match_pattern.lfOutPrecision = OUT_OUTLINE_PRECIS;
--- a/src/w32xfns.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/w32xfns.c Thu Jul 08 22:47:34 2010 +0000 @@ -178,7 +178,7 @@ if (nQueue) { - bcopy (&(lpHead->w32msg), lpmsg, sizeof (W32Msg)); + memcpy (lpmsg, &lpHead->w32msg, sizeof (W32Msg)); { int_msg * lpCur = lpHead; @@ -250,7 +250,7 @@ if (!lpNew) return (FALSE); - bcopy (lpmsg, &(lpNew->w32msg), sizeof (W32Msg)); + memcpy (&lpNew->w32msg, lpmsg, sizeof (W32Msg)); lpNew->lpNext = NULL; enter_crit (); @@ -280,7 +280,7 @@ if (!lpNew) return (FALSE); - bcopy (lpmsg, &(lpNew->w32msg), sizeof (W32Msg)); + memcpy (&lpNew->w32msg, lpmsg, sizeof (W32Msg)); enter_crit ();
--- a/src/window.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/window.c Thu Jul 08 22:47:34 2010 +0000 @@ -205,16 +205,14 @@ DEFUN ("windowp", Fwindowp, Swindowp, 1, 1, 0, doc: /* Return t if OBJECT is a window. */) - (object) - Lisp_Object object; + (Lisp_Object object) { return WINDOWP (object) ? Qt : Qnil; } DEFUN ("window-live-p", Fwindow_live_p, Swindow_live_p, 1, 1, 0, doc: /* Return t if OBJECT is a window which is currently visible. */) - (object) - Lisp_Object object; + (Lisp_Object object) { return WINDOW_LIVE_P (object) ? Qt : Qnil; } @@ -243,9 +241,9 @@ p->dedicated = Qnil; p->window_parameters = Qnil; p->pseudo_window_p = 0; - bzero (&p->cursor, sizeof (p->cursor)); - bzero (&p->last_cursor, sizeof (p->last_cursor)); - bzero (&p->phys_cursor, sizeof (p->phys_cursor)); + memset (&p->cursor, 0, sizeof (p->cursor)); + memset (&p->last_cursor, 0, sizeof (p->last_cursor)); + memset (&p->phys_cursor, 0, sizeof (p->phys_cursor)); p->desired_matrix = p->current_matrix = 0; p->nrows_scale_factor = p->ncols_scale_factor = 1; p->phys_cursor_type = -1; @@ -274,7 +272,7 @@ DEFUN ("selected-window", Fselected_window, Sselected_window, 0, 0, 0, doc: /* Return the window that the cursor now appears in and commands apply to. */) - () + (void) { return selected_window; } @@ -283,8 +281,7 @@ doc: /* Return the window used now for minibuffers. If the optional argument FRAME is specified, return the minibuffer window used by that frame. */) - (frame) - Lisp_Object frame; + (Lisp_Object frame) { if (NILP (frame)) frame = selected_frame; @@ -295,8 +292,7 @@ DEFUN ("window-minibuffer-p", Fwindow_minibuffer_p, Swindow_minibuffer_p, 0, 1, 0, doc: /* Return non-nil if WINDOW is a minibuffer window. WINDOW defaults to the selected window. */) - (window) - Lisp_Object window; + (Lisp_Object window) { struct window *w = decode_window (window); return MINI_WINDOW_P (w) ? Qt : Qnil; @@ -320,8 +316,7 @@ POS is fully visible; otherwise, RTOP and RBOT are the number of pixels off-window at the top and bottom of the row, ROWH is the height of the display row, and VPOS is the row number (0-based) containing POS. */) - (pos, window, partially) - Lisp_Object pos, window, partially; + (Lisp_Object pos, Lisp_Object window, Lisp_Object partially) { register struct window *w; register int posint; @@ -389,8 +384,7 @@ Return nil if window display is not up-to-date. In that case, use `pos-visible-in-window-p' to obtain the information. */) - (line, window) - Lisp_Object line, window; + (Lisp_Object line, Lisp_Object window) { register struct window *w; register struct buffer *b; @@ -505,8 +499,7 @@ DEFUN ("window-buffer", Fwindow_buffer, Swindow_buffer, 0, 1, 0, doc: /* Return the buffer that WINDOW is displaying. WINDOW defaults to the selected window. */) - (window) - Lisp_Object window; + (Lisp_Object window) { return decode_window (window)->buffer; } @@ -516,8 +509,7 @@ WINDOW defaults to the selected window. The return value includes WINDOW's mode line and header line, if any. */) - (window) - Lisp_Object window; + (Lisp_Object window) { return decode_any_window (window)->total_lines; } @@ -529,8 +521,7 @@ Note: The return value is the number of columns available for text in WINDOW. If you want to find out how many columns WINDOW takes up, use (let ((edges (window-edges))) (- (nth 2 edges) (nth 0 edges))). */) - (window) - Lisp_Object window; + (Lisp_Object window) { return make_number (window_box_text_cols (decode_any_window (window))); } @@ -538,8 +529,7 @@ DEFUN ("window-full-width-p", Fwindow_full_width_p, Swindow_full_width_p, 0, 1, 0, doc: /* Return t if WINDOW is as wide as its frame. WINDOW defaults to the selected window. */) - (window) - Lisp_Object window; + (Lisp_Object window) { return WINDOW_FULL_WIDTH_P (decode_any_window (window)) ? Qt : Qnil; } @@ -547,8 +537,7 @@ DEFUN ("window-hscroll", Fwindow_hscroll, Swindow_hscroll, 0, 1, 0, doc: /* Return the number of columns by which WINDOW is scrolled from left margin. WINDOW defaults to the selected window. */) - (window) - Lisp_Object window; + (Lisp_Object window) { return decode_window (window)->hscroll; } @@ -559,8 +548,7 @@ Note that if `automatic-hscrolling' is non-nil, you cannot scroll the window so that the location of point moves off-window. */) - (window, ncol) - Lisp_Object window, ncol; + (Lisp_Object window, Lisp_Object ncol) { struct window *w = decode_window (window); int hscroll; @@ -581,8 +569,7 @@ doc: /* Return WINDOW's redisplay end trigger value. WINDOW defaults to the selected window. See `set-window-redisplay-end-trigger' for more information. */) - (window) - Lisp_Object window; + (Lisp_Object window) { return decode_window (window)->redisplay_end_trigger; } @@ -595,8 +582,7 @@ beyond VALUE, the functions in `redisplay-end-trigger-functions' are called with two arguments: WINDOW, and the end trigger value. Afterwards the end-trigger value is reset to nil. */) - (window, value) - register Lisp_Object window, value; + (register Lisp_Object window, Lisp_Object value) { register struct window *w; @@ -616,8 +602,7 @@ The edges include the space used by WINDOW's scroll bar, display margins, fringes, header line, and/or mode line. For the edges of just the text area, use `window-inside-edges'. */) - (window) - Lisp_Object window; + (Lisp_Object window) { register struct window *w = decode_any_window (window); @@ -638,8 +623,7 @@ The pixel edges include the space used by WINDOW's scroll bar, display margins, fringes, header line, and/or mode line. For the pixel edges of just the text area, use `window-inside-pixel-edges'. */) - (window) - Lisp_Object window; + (Lisp_Object window) { register struct window *w = decode_any_window (window); @@ -678,8 +662,7 @@ The pixel edges include the space used by WINDOW's scroll bar, display margins, fringes, header line, and/or mode line. For the pixel edges of just the text area, use `window-inside-absolute-pixel-edges'. */) - (window) - Lisp_Object window; + (Lisp_Object window) { register struct window *w = decode_any_window (window); int add_x, add_y; @@ -702,8 +685,7 @@ BOTTOM is one more than the bottommost row of WINDOW's text area. The inside edges do not include the space used by the WINDOW's scroll bar, display margins, fringes, header line, and/or mode line. */) - (window) - Lisp_Object window; + (Lisp_Object window) { register struct window *w = decode_any_window (window); @@ -728,8 +710,7 @@ BOTTOM is one more than the bottommost y position of WINDOW's text area. The inside edges do not include the space used by WINDOW's scroll bar, display margins, fringes, header line, and/or mode line. */) - (window) - Lisp_Object window; + (Lisp_Object window) { register struct window *w = decode_any_window (window); @@ -756,8 +737,7 @@ BOTTOM is one more than the bottommost y position of WINDOW's text area. The inside edges do not include the space used by WINDOW's scroll bar, display margins, fringes, header line, and/or mode line. */) - (window) - Lisp_Object window; + (Lisp_Object window) { register struct window *w = decode_any_window (window); int add_x, add_y; @@ -1002,8 +982,7 @@ `vertical-line' is returned. If they are in the windows's left or right marginal areas, `left-margin'\n\ or `right-margin' is returned. */) - (coordinates, window) - register Lisp_Object coordinates, window; + (register Lisp_Object coordinates, Lisp_Object window) { struct window *w; struct frame *f; @@ -1155,8 +1134,7 @@ If omitted, FRAME defaults to the currently selected frame. The top left corner of the frame is considered to be row 0, column 0. */) - (x, y, frame) - Lisp_Object x, y, frame; + (Lisp_Object x, Lisp_Object y, Lisp_Object frame) { struct frame *f; @@ -1189,8 +1167,7 @@ It would be more strictly correct to return the `top-level' value of point, outside of any save-excursion forms. But that is hard to define. */) - (window) - Lisp_Object window; + (Lisp_Object window) { register struct window *w = decode_window (window); @@ -1204,8 +1181,7 @@ doc: /* Return position at which display currently starts in WINDOW. WINDOW defaults to the selected window. This is updated by redisplay or by calling `set-window-start'. */) - (window) - Lisp_Object window; + (Lisp_Object window) { return Fmarker_position (decode_window (window)->start); } @@ -1231,8 +1207,7 @@ last redisplay of WINDOW was preempted, and did not finish.) If UPDATE is non-nil, compute the up-to-date position if it isn't already recorded. */) - (window, update) - Lisp_Object window, update; + (Lisp_Object window, Lisp_Object update) { Lisp_Object value; struct window *w = decode_window (window); @@ -1300,8 +1275,7 @@ DEFUN ("set-window-point", Fset_window_point, Sset_window_point, 2, 2, 0, doc: /* Make point value in WINDOW be at position POS in WINDOW's buffer. Return POS. */) - (window, pos) - Lisp_Object window, pos; + (Lisp_Object window, Lisp_Object pos) { register struct window *w = decode_window (window); @@ -1325,8 +1299,7 @@ WINDOW defaults to the selected window. Return POS. Optional third arg NOFORCE non-nil inhibits next redisplay from overriding motion of point in order to display at this exact start. */) - (window, pos, noforce) - Lisp_Object window, pos, noforce; + (Lisp_Object window, Lisp_Object pos, Lisp_Object noforce) { register struct window *w = decode_window (window); @@ -1364,8 +1337,7 @@ Functions like `set-window-buffer' may change the buffer displayed by a window, unless that window is "strongly" dedicated to its buffer, that is the value returned by `window-dedicated-p' is t. */) - (window) - Lisp_Object window; + (Lisp_Object window) { return decode_window (window)->dedicated; } @@ -1389,8 +1361,7 @@ displayed by a window, unless that window is strongly dedicated to its buffer. If and when `set-window-buffer' displays another buffer in a window, it also makes sure that the window is not marked as dedicated. */) - (window, flag) - Lisp_Object window, flag; + (Lisp_Object window, Lisp_Object flag) { register struct window *w = decode_window (window); @@ -1404,8 +1375,7 @@ doc: /* Return the parameters of WINDOW and their values. WINDOW defaults to the selected window. The return value is a list of elements of the form (PARAMETER . VALUE). */) - (window) - Lisp_Object window; + (Lisp_Object window) { return Fcopy_alist (decode_window (window)->window_parameters); } @@ -1414,8 +1384,7 @@ 2, 2, 0, doc: /* Return WINDOW's value for PARAMETER. WINDOW defaults to the selected window. */) - (window, parameter) - Lisp_Object window, parameter; + (Lisp_Object window, Lisp_Object parameter) { Lisp_Object result; @@ -1427,8 +1396,7 @@ Sset_window_parameter, 3, 3, 0, doc: /* Set WINDOW's value of PARAMETER to VALUE. WINDOW defaults to the selected window. Return VALUE. */) - (window, parameter, value) - Lisp_Object window, parameter, value; + (Lisp_Object window, Lisp_Object parameter, Lisp_Object value) { register struct window *w = decode_window (window); Lisp_Object old_alist_elt; @@ -1446,8 +1414,7 @@ 0, 1, 0, doc: /* Return the display-table that WINDOW is using. WINDOW defaults to the selected window. */) - (window) - Lisp_Object window; + (Lisp_Object window) { return decode_window (window)->display_table; } @@ -1479,8 +1446,7 @@ DEFUN ("set-window-display-table", Fset_window_display_table, Sset_window_display_table, 2, 2, 0, doc: /* Set WINDOW's display-table to TABLE. */) - (window, table) - register Lisp_Object window, table; + (register Lisp_Object window, Lisp_Object table) { register struct window *w; @@ -1557,9 +1523,9 @@ p->total_lines = o->total_lines; p->desired_matrix = p->current_matrix = 0; p->vscroll = 0; - bzero (&p->cursor, sizeof (p->cursor)); - bzero (&p->last_cursor, sizeof (p->last_cursor)); - bzero (&p->phys_cursor, sizeof (p->phys_cursor)); + memset (&p->cursor, 0, sizeof (p->cursor)); + memset (&p->last_cursor, 0, sizeof (p->last_cursor)); + memset (&p->phys_cursor, 0, sizeof (p->phys_cursor)); p->phys_cursor_type = -1; p->phys_cursor_width = -1; p->must_be_updated_p = 0; @@ -1596,8 +1562,7 @@ doc: /* Remove WINDOW from its frame. WINDOW defaults to the selected window. Return nil. Signal an error when WINDOW is the only window on its frame. */) - (window) - register Lisp_Object window; + (register Lisp_Object window) { struct frame *f; if (NILP (window)) @@ -2094,8 +2059,7 @@ `next-window' to iterate through the entire cycle of acceptable windows, eventually ending up back at the window you started with. `previous-window' traverses the same cycle, in the reverse order. */) - (window, minibuf, all_frames) - Lisp_Object window, minibuf, all_frames; + (Lisp_Object window, Lisp_Object minibuf, Lisp_Object all_frames) { return next_window (window, minibuf, all_frames, 1); } @@ -2112,8 +2076,7 @@ acceptable windows, eventually ending up back at the window you started with. `next-window' traverses the same cycle, in the reverse order. */) - (window, minibuf, all_frames) - Lisp_Object window, minibuf, all_frames; + (Lisp_Object window, Lisp_Object minibuf, Lisp_Object all_frames) { return next_window (window, minibuf, all_frames, 0); } @@ -2132,8 +2095,7 @@ The argument ALL-FRAMES has the same meaning as in `next-window', but the MINIBUF argument of `next-window' is always effectively nil. */) - (count, all_frames) - Lisp_Object count, all_frames; + (Lisp_Object count, Lisp_Object all_frames) { Lisp_Object window; int i; @@ -2159,8 +2121,7 @@ MINIBUF nil or omitted means include the minibuffer window only if it's active. MINIBUF neither nil nor t means never include the minibuffer window. */) - (frame, minibuf, window) - Lisp_Object frame, minibuf, window; + (Lisp_Object frame, Lisp_Object minibuf, Lisp_Object window) { if (NILP (window)) window = FRAMEP (frame) ? XFRAME (frame)->selected_window : selected_window; @@ -2472,8 +2433,7 @@ If FRAME is t, search all frames. If FRAME is nil, search only the selected frame. If FRAME is a frame, search only that frame. */) - (frame, dedicated) - Lisp_Object frame, dedicated; + (Lisp_Object frame, Lisp_Object dedicated) { register Lisp_Object w; /* First try for a window that is full-width */ @@ -2498,8 +2458,7 @@ If FRAME is t, search all frames. If FRAME is nil, search only the selected frame. If FRAME is a frame, search only that frame. */) - (frame, dedicated) - Lisp_Object frame, dedicated; + (Lisp_Object frame, Lisp_Object dedicated) { return window_loop (GET_LARGEST_WINDOW, dedicated, 0, frame); @@ -2514,8 +2473,7 @@ If FRAME is t, search all frames. If FRAME is nil, search only the selected frame. If FRAME is a frame, search only that frame. */) - (buffer_or_name, frame) - Lisp_Object buffer_or_name, frame; + (Lisp_Object buffer_or_name, Lisp_Object frame) { Lisp_Object buffer; @@ -2539,8 +2497,7 @@ depends on the value of (window-start WINDOW), so if calling this function in a program gives strange scrolling, make sure the window-start value is reasonable when this function is called. */) - (window) - Lisp_Object window; + (Lisp_Object window) { struct window *w; int startpos; @@ -2607,8 +2564,7 @@ If FRAME is a frame, search only that frame. When a window showing BUFFER-OR-NAME is dedicated and the only window of its frame, that frame is deleted when there are other frames left. */) - (buffer_or_name, frame) - Lisp_Object buffer_or_name, frame; + (Lisp_Object buffer_or_name, Lisp_Object frame) { Lisp_Object buffer; @@ -2643,8 +2599,7 @@ deleted. If that window is the only window on its frame, that frame is deleted too when there are other frames left. If there are no other frames left, some other buffer is displayed in that window. */) - (buffer_or_name) - Lisp_Object buffer_or_name; + (Lisp_Object buffer_or_name) { Lisp_Object buffer; @@ -3481,7 +3436,7 @@ XSETFASTINT (w->window_end_pos, 0); XSETFASTINT (w->window_end_vpos, 0); - bzero (&w->last_cursor, sizeof w->last_cursor); + memset (&w->last_cursor, 0, sizeof w->last_cursor); w->window_end_valid = Qnil; if (!(keep_margins_p && samebuf)) { /* If we're not actually changing the buffer, don't reset hscroll and @@ -3570,8 +3525,7 @@ This function runs `window-scroll-functions' before running `window-configuration-change-hook'. */) - (window, buffer_or_name, keep_margins) - register Lisp_Object window, buffer_or_name, keep_margins; + (register Lisp_Object window, Lisp_Object buffer_or_name, Lisp_Object keep_margins) { register Lisp_Object tem, buffer; register struct window *w = decode_window (window); @@ -3614,8 +3568,7 @@ Note that the main editor command loop selects the buffer of the selected window before each command. */) - (window, norecord) - register Lisp_Object window, norecord; + (register Lisp_Object window, Lisp_Object norecord) { register struct window *w; register struct window *ow; @@ -3715,8 +3668,7 @@ If optional arg OBJECT is a window, force redisplay of that window only. If OBJECT is a buffer or buffer name, force redisplay of all windows displaying that buffer. */) - (object) - Lisp_Object object; + (Lisp_Object object) { if (NILP (object)) { @@ -3857,8 +3809,7 @@ if it was selected before. See Info node `(elisp)Splitting Windows' for more details and examples. */) - (window, size, horizontal) - Lisp_Object window, size, horizontal; + (Lisp_Object window, Lisp_Object size, Lisp_Object horizontal) { register Lisp_Object new; register struct window *o, *p; @@ -3948,7 +3899,7 @@ p->parent = o->parent; p->buffer = Qt; p->window_end_valid = Qnil; - bzero (&p->last_cursor, sizeof p->last_cursor); + memset (&p->last_cursor, 0, sizeof p->last_cursor); /* Duplicate special geometry settings. */ @@ -3997,8 +3948,7 @@ This function can delete windows if they get too small. The size of fixed size windows is not altered by this function. */) - (size, horizontal) - Lisp_Object size, horizontal; + (Lisp_Object size, Lisp_Object horizontal) { CHECK_NUMBER (size); enlarge_window (selected_window, XINT (size), !NILP (horizontal)); @@ -4017,8 +3967,7 @@ This function can delete windows if they get too small. The size of fixed size windows is not altered by this function. */) - (size, horizontal) - Lisp_Object size, horizontal; + (Lisp_Object size, Lisp_Object horizontal) { CHECK_NUMBER (size); enlarge_window (selected_window, -XINT (size), !NILP (horizontal)); @@ -4470,8 +4419,7 @@ Following siblings of the selected window are resized to fulfill the size request. If they become too small in the process, they are not deleted; instead, we signal an error. */) - (window, delta, horizontal) - Lisp_Object window, delta, horizontal; + (Lisp_Object window, Lisp_Object delta, Lisp_Object horizontal) { CHECK_NUMBER (delta); if (NILP (window)) @@ -5366,8 +5314,7 @@ Negative ARG means scroll downward. If ARG is the atom `-', scroll downward by nearly full screen. When calling from a program, supply as argument a number, nil, or `-'. */) - (arg) - Lisp_Object arg; + (Lisp_Object arg) { scroll_command (arg, 1); return Qnil; @@ -5380,8 +5327,7 @@ Negative ARG means scroll upward. If ARG is the atom `-', scroll upward by nearly full screen. When calling from a program, supply as argument a number, nil, or `-'. */) - (arg) - Lisp_Object arg; + (Lisp_Object arg) { scroll_command (arg, -1); return Qnil; @@ -5394,7 +5340,7 @@ If in the minibuffer, `minibuffer-scroll-window' if non-nil specifies the window. This takes precedence over `other-window-scroll-buffer'. */) - () + (void) { Lisp_Object window; @@ -5444,8 +5390,7 @@ If in the minibuffer, `minibuffer-scroll-window' if non-nil specifies the window to scroll. This takes precedence over `other-window-scroll-buffer'. */) - (arg) - Lisp_Object arg; + (Lisp_Object arg) { Lisp_Object window; struct window *w; @@ -5488,8 +5433,7 @@ lower bound for automatic scrolling, i.e. automatic scrolling will not scroll a window to a column less than the value returned by this function. This happens in an interactive call. */) - (arg, set_minimum) - register Lisp_Object arg, set_minimum; + (register Lisp_Object arg, Lisp_Object set_minimum) { Lisp_Object result; int hscroll; @@ -5518,8 +5462,7 @@ lower bound for automatic scrolling, i.e. automatic scrolling will not scroll a window to a column less than the value returned by this function. This happens in an interactive call. */) - (arg, set_minimum) - register Lisp_Object arg, set_minimum; + (register Lisp_Object arg, Lisp_Object set_minimum) { Lisp_Object result; int hscroll; @@ -5542,7 +5485,7 @@ DEFUN ("minibuffer-selected-window", Fminibuffer_selected_window, Sminibuffer_selected_window, 0, 0, 0, doc: /* Return the window which was selected when entering the minibuffer. Returns nil, if selected window is not a minibuffer window. */) - () + (void) { if (minibuf_level > 0 && MINI_WINDOW_P (XWINDOW (selected_window)) @@ -5624,8 +5567,7 @@ Just C-u as prefix means put point in the center of the window and redisplay normally--don't erase and redraw the frame. */) - (arg) - register Lisp_Object arg; + (register Lisp_Object arg) { struct window *w = XWINDOW (selected_window); struct buffer *buf = XBUFFER (w->buffer); @@ -5809,8 +5751,7 @@ The return value does not include the mode line, any header line, nor any partial-height lines in the text display area. */) - (window) - Lisp_Object window; + (Lisp_Object window) { struct window *w = decode_window (window); int pixel_height = window_box_height (w); @@ -5826,8 +5767,7 @@ With no argument, position point at center of window. An argument specifies vertical position within the window; zero means top of window, negative means relative to bottom of window. */) - (arg) - Lisp_Object arg; + (Lisp_Object arg) { struct window *w = XWINDOW (selected_window); int lines, start; @@ -5940,16 +5880,14 @@ DEFUN ("window-configuration-p", Fwindow_configuration_p, Swindow_configuration_p, 1, 1, 0, doc: /* Return t if OBJECT is a window-configuration object. */) - (object) - Lisp_Object object; + (Lisp_Object object) { return WINDOW_CONFIGURATIONP (object) ? Qt : Qnil; } DEFUN ("window-configuration-frame", Fwindow_configuration_frame, Swindow_configuration_frame, 1, 1, 0, doc: /* Return the frame that CONFIG, a window-configuration object, is about. */) - (config) - Lisp_Object config; + (Lisp_Object config) { register struct save_window_data *data; struct Lisp_Vector *saved_windows; @@ -5969,8 +5907,7 @@ If CONFIGURATION was made from a frame that is now deleted, only frame-independent values can be restored. In this case, the return value is nil. Otherwise the value is t. */) - (configuration) - Lisp_Object configuration; + (Lisp_Object configuration) { register struct save_window_data *data; struct Lisp_Vector *saved_windows; @@ -6476,8 +6413,7 @@ its value is -not- saved. This also records the currently selected frame, and FRAME's focus redirection (see `redirect-frame-focus'). */) - (frame) - Lisp_Object frame; + (Lisp_Object frame) { register Lisp_Object tem; register int n_windows; @@ -6525,8 +6461,7 @@ Also restore which buffer is current. Does not restore the value of point in current buffer. usage: (save-window-excursion BODY...) */) - (args) - Lisp_Object args; + (Lisp_Object args) { register Lisp_Object val; register int count = SPECPDL_INDEX (); @@ -6597,8 +6532,7 @@ If FRAME is nil or omitted, return information on the currently selected frame. */) - (frame) - Lisp_Object frame; + (Lisp_Object frame) { FRAME_PTR f; @@ -6627,8 +6561,7 @@ reserve for the left marginal area. Optional third arg RIGHT-WIDTH does the same for the right marginal area. A nil width parameter means no margin. */) - (window, left_width, right_width) - Lisp_Object window, left_width, right_width; + (Lisp_Object window, Lisp_Object left_width, Lisp_Object right_width) { struct window *w = decode_window (window); @@ -6672,8 +6605,7 @@ Value is a cons of the form (LEFT-WIDTH . RIGHT-WIDTH). If a marginal area does not exist, its width will be returned as nil. */) - (window) - Lisp_Object window; + (Lisp_Object window) { struct window *w = decode_window (window); return Fcons (w->left_margin_cols, w->right_margin_cols); @@ -6698,8 +6630,7 @@ If optional fourth arg OUTSIDE-MARGINS is non-nil, draw the fringes outside of the display margins. By default, fringes are drawn between display marginal areas and the text area. */) - (window, left_width, right_width, outside_margins) - Lisp_Object window, left_width, right_width, outside_margins; + (Lisp_Object window, Lisp_Object left_width, Lisp_Object right_width, Lisp_Object outside_margins) { struct window *w = decode_window (window); @@ -6736,8 +6667,7 @@ doc: /* Get width of fringes of window WINDOW. If WINDOW is omitted or nil, use the currently selected window. Value is a list of the form (LEFT-WIDTH RIGHT-WIDTH OUTSIDE-MARGINS). */) - (window) - Lisp_Object window; + (Lisp_Object window) { struct window *w = decode_window (window); @@ -6764,8 +6694,7 @@ If WIDTH is nil, use the frame's scroll-bar width. If VERTICAL-TYPE is t, use the frame's scroll-bar type. Fourth parameter HORIZONTAL-TYPE is currently unused. */) - (window, width, vertical_type, horizontal_type) - Lisp_Object window, width, vertical_type, horizontal_type; + (Lisp_Object window, Lisp_Object width, Lisp_Object vertical_type, Lisp_Object horizontal_type) { struct window *w = decode_window (window); @@ -6809,8 +6738,7 @@ Value is a list of the form (WIDTH COLS VERTICAL-TYPE HORIZONTAL-TYPE). If WIDTH is nil or TYPE is t, the window is using the frame's corresponding value. */) - (window) - Lisp_Object window; + (Lisp_Object window) { struct window *w = decode_window (window); return Fcons (make_number ((WINDOW_CONFIG_SCROLL_BAR_WIDTH (w) @@ -6832,8 +6760,7 @@ Use the selected window if WINDOW is nil or omitted. Normally, value is a multiple of the canonical character height of WINDOW; optional second arg PIXELS-P means value is measured in pixels. */) - (window, pixels_p) - Lisp_Object window, pixels_p; + (Lisp_Object window, Lisp_Object pixels_p) { Lisp_Object result; struct frame *f; @@ -6866,8 +6793,7 @@ corresponds to an integral number of pixels. The return value is the result of this rounding. If PIXELS-P is non-nil, the return value is VSCROLL. */) - (window, vscroll, pixels_p) - Lisp_Object window, vscroll, pixels_p; + (Lisp_Object window, Lisp_Object vscroll, Lisp_Object pixels_p) { struct window *w; struct frame *f; @@ -7101,8 +7027,7 @@ doc: /* Compare two window configurations as regards the structure of windows. This function ignores details such as the values of point and mark and scrolling positions. */) - (x, y) - Lisp_Object x, y; + (Lisp_Object x, Lisp_Object y) { if (compare_window_configurations (x, y, 1)) return Qt;
--- a/src/xdisp.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/xdisp.c Thu Jul 08 22:47:34 2010 +0000 @@ -2576,7 +2576,7 @@ } /* Clear IT. */ - bzero (it, sizeof *it); + memset (it, 0, sizeof *it); it->current.overlay_string_index = -1; it->current.dpvec_index = -1; it->base_face_id = remapped_base_face_id; @@ -4912,7 +4912,7 @@ entries = \ (struct overlay_entry *) alloca (new_size \ * sizeof *entries); \ - bcopy (old, entries, size * sizeof *entries); \ + memcpy (entries, old, size * sizeof *entries); \ size = new_size; \ } \ \ @@ -5630,7 +5630,7 @@ it->stop_charpos = -1; /* Set iterator position and end position. */ - bzero (&it->current, sizeof it->current); + memset (&it->current, 0, sizeof it->current); it->current.overlay_string_index = -1; it->current.dpvec_index = -1; xassert (charpos >= 0); @@ -7999,7 +7999,7 @@ len = SBYTES (msg) + 1; SAFE_ALLOCA (buffer, char *, len); - bcopy (SDATA (msg), buffer, len); + memcpy (buffer, SDATA (msg), len); message_dolog (buffer, len - 1, 1, 0); SAFE_FREE (); @@ -8328,7 +8328,7 @@ USE_SAFE_ALLOCA; SAFE_ALLOCA (buffer, char *, nbytes); - bcopy (SDATA (m), buffer, nbytes); + memcpy (buffer, SDATA (m), nbytes); message_dolog (buffer, nbytes, 1, multibyte); SAFE_FREE (); } @@ -9630,12 +9630,7 @@ Re-allocate mode_line_noprop_buf if necessary. */ static void -#ifdef PROTOTYPES store_mode_line_noprop_char (char c) -#else -store_mode_line_noprop_char (c) - char c; -#endif { /* If output position has reached the end of the allocated buffer, double the buffer's size. */ @@ -9754,7 +9749,7 @@ higher level than this.) */ if (! STRINGP (f->name) || SBYTES (f->name) != len - || bcmp (title, SDATA (f->name), len) != 0) + || memcmp (title, SDATA (f->name), len) != 0) x_implicitly_set_name (f, make_string (title, len), Qnil); } } @@ -10529,8 +10524,7 @@ DEFUN ("tool-bar-lines-needed", Ftool_bar_lines_needed, Stool_bar_lines_needed, 0, 1, 0, doc: /* Return the number of lines occupied by the tool bar of FRAME. */) - (frame) - Lisp_Object frame; + (Lisp_Object frame) { struct frame *f; struct window *w; @@ -16375,8 +16369,7 @@ Shows contents of glyph row structures. With non-nil parameter GLYPHS, dump glyphs as well. If GLYPHS is 1 show glyphs in short form, otherwise show glyphs in long form. */) - (glyphs) - Lisp_Object glyphs; + (Lisp_Object glyphs) { struct window *w = XWINDOW (selected_window); struct buffer *buffer = XBUFFER (w->buffer); @@ -16394,7 +16387,7 @@ DEFUN ("dump-frame-glyph-matrix", Fdump_frame_glyph_matrix, Sdump_frame_glyph_matrix, 0, 0, "", doc: /* */) - () + (void) { struct frame *f = XFRAME (selected_frame); dump_glyph_matrix (f->current_matrix, 1); @@ -16407,8 +16400,7 @@ GLYPH 0 means don't dump glyphs. GLYPH 1 means dump glyphs in short form. GLYPH > 1 or omitted means dump glyphs in long form. */) - (row, glyphs) - Lisp_Object row, glyphs; + (Lisp_Object row, Lisp_Object glyphs) { struct glyph_matrix *matrix; int vpos; @@ -16429,8 +16421,7 @@ GLYPH 0 means don't dump glyphs. GLYPH 1 means dump glyphs in short form. GLYPH > 1 or omitted means dump glyphs in long form. */) - (row, glyphs) - Lisp_Object row, glyphs; + (Lisp_Object row, Lisp_Object glyphs) { struct frame *sf = SELECTED_FRAME (); struct glyph_matrix *m = XWINDOW (sf->tool_bar_window)->current_matrix; @@ -16448,8 +16439,7 @@ DEFUN ("trace-redisplay", Ftrace_redisplay, Strace_redisplay, 0, 1, "P", doc: /* Toggle tracing of redisplay. With ARG, turn tracing on if and only if ARG is positive. */) - (arg) - Lisp_Object arg; + (Lisp_Object arg) { if (NILP (arg)) trace_redisplay_p = !trace_redisplay_p; @@ -16466,9 +16456,7 @@ DEFUN ("trace-to-stderr", Ftrace_to_stderr, Strace_to_stderr, 1, MANY, "", doc: /* Like `format', but print result to stderr. usage: (trace-to-stderr STRING &rest OBJECTS) */) - (nargs, args) - int nargs; - Lisp_Object *args; + (int nargs, Lisp_Object *args) { Lisp_Object s = Fformat (nargs, args); fprintf (stderr, "%s", SDATA (s)); @@ -16763,7 +16751,7 @@ saved_pos = it->position; it->what = IT_CHARACTER; - bzero (&it->position, sizeof it->position); + memset (&it->position, 0, sizeof it->position); it->object = make_number (0); it->c = ' '; it->len = 1; @@ -16883,7 +16871,7 @@ (((it->ascent + it->descent) * FONT_BASE (font)) / FONT_HEIGHT (font)); saved_pos = it->position; - bzero (&it->position, sizeof it->position); + memset (&it->position, 0, sizeof it->position); saved_avoid_cursor = it->avoid_cursor_p; it->avoid_cursor_p = 1; saved_face_id = it->face_id; @@ -16916,7 +16904,7 @@ saved_pos = it->position; it->what = IT_CHARACTER; - bzero (&it->position, sizeof it->position); + memset (&it->position, 0, sizeof it->position); it->object = make_number (0); it->c = ' '; it->len = 1; @@ -17987,8 +17975,7 @@ paragraphs, text begins at the right margin and is read from right to left. See also `bidi-paragraph-direction'. */) - (buffer) - Lisp_Object buffer; + (Lisp_Object buffer) { struct buffer *buf; struct buffer *old; @@ -18952,8 +18939,7 @@ Optional third and fourth args WINDOW and BUFFER specify the window and buffer to use as the context for the formatting (defaults are the selected window and the window's buffer). */) - (format, face, window, buffer) - Lisp_Object format, face, window, buffer; + (Lisp_Object format, Lisp_Object face, Lisp_Object window, Lisp_Object buffer) { struct it it; int len; @@ -19259,7 +19245,7 @@ eol_str = invalid_eol_type; eol_str_len = sizeof (invalid_eol_type) - 1; } - bcopy (eol_str, buf, eol_str_len); + memcpy (buf, eol_str, eol_str_len); buf += eol_str_len; } @@ -20073,8 +20059,7 @@ value of the `invisible' property of the text of interest. The non-nil value returned can be t for truly invisible text or something else if the text is replaced by an ellipsis. */) - (pos_or_prop) - Lisp_Object pos_or_prop; + (Lisp_Object pos_or_prop) { Lisp_Object prop = (NATNUMP (pos_or_prop) || MARKERP (pos_or_prop) @@ -20397,7 +20382,7 @@ XChar2b *char2b, struct window *w, struct glyph_row *row, enum glyph_row_area area, int start, enum draw_glyphs_face hl) { - bzero (s, sizeof *s); + memset (s, 0, sizeof *s); s->w = w; s->f = XFRAME (w->frame); #ifdef HAVE_NTGUI @@ -24235,9 +24220,7 @@ A polygon is a cons (poly . [x0 y0 x1 y1 ...]) where each pair in the vector describes one corner in the polygon. Returns the alist element for the first matching AREA in MAP. */) - (map, x, y) - Lisp_Object map; - Lisp_Object x, y; + (Lisp_Object map, Lisp_Object x, Lisp_Object y) { if (NILP (map)) return Qnil;
--- a/src/xfaces.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/xfaces.c Thu Jul 08 22:47:34 2010 +0000 @@ -626,7 +626,7 @@ DEFUN ("dump-colors", Fdump_colors, Sdump_colors, 0, 0, 0, doc: /* Dump currently allocated colors to stderr. */) - () + (void) { int i, n; @@ -764,7 +764,7 @@ { GC gc = xmalloc (sizeof (*gc)); if (gc) - bcopy (xgcv, gc, sizeof (XGCValues)); + memcpy (gc, xgcv, sizeof (XGCValues)); return gc; } @@ -951,8 +951,7 @@ DEFUN ("clear-face-cache", Fclear_face_cache, Sclear_face_cache, 0, 1, 0, doc: /* Clear face caches on all frames. Optional THOROUGHLY non-nil means try to free unused fonts, too. */) - (thoroughly) - Lisp_Object thoroughly; + (Lisp_Object thoroughly) { clear_face_cache (!NILP (thoroughly)); ++face_change_count; @@ -974,8 +973,7 @@ HEIGHT is its height, and DATA is a string containing the bits of the pixmap. Bits are stored row by row, each row occupies \(WIDTH + 7)/8 bytes. */) - (object) - Lisp_Object object; + (Lisp_Object object) { int pixmap_p = 0; @@ -1327,8 +1325,7 @@ doc: /* Return non-nil if COLOR is a shade of gray (or white or black). FRAME specifies the frame and thus the display for interpreting COLOR. If FRAME is nil or omitted, use the selected frame. */) - (color, frame) - Lisp_Object color, frame; + (Lisp_Object color, Lisp_Object frame) { struct frame *f; @@ -1349,8 +1346,7 @@ Otherwise, this function tells whether it can be used as a foreground. If FRAME is nil or omitted, use the selected frame. COLOR must be a valid color name. */) - (color, frame, background_p) - Lisp_Object frame, color, background_p; + (Lisp_Object color, Lisp_Object frame, Lisp_Object background_p) { struct frame *f; @@ -1687,8 +1683,7 @@ giving the registry and encoding of the font. The result list is sorted according to the current setting of the face font sort order. */) - (family, frame) - Lisp_Object family, frame; + (Lisp_Object family, Lisp_Object frame) { Lisp_Object font_spec, list, *drivers, vec; int i, nfonts, ndrivers; @@ -1785,8 +1780,7 @@ The optional fifth argument WIDTH, if specified, is a number of columns occupied by a character of a font. In that case, return only fonts the WIDTH times as wide as FACE on FRAME. */) - (pattern, face, frame, maximum, width) - Lisp_Object pattern, face, frame, maximum, width; + (Lisp_Object pattern, Lisp_Object face, Lisp_Object frame, Lisp_Object maximum, Lisp_Object width) { struct frame *f; int size, avgwidth; @@ -2190,8 +2184,8 @@ lface = lface_from_face_name_no_resolve (f, face_name, signal_p); if (! NILP (lface)) - bcopy (XVECTOR (lface)->contents, attrs, - LFACE_VECTOR_SIZE * sizeof *attrs); + memcpy (attrs, XVECTOR (lface)->contents, + LFACE_VECTOR_SIZE * sizeof *attrs); return !NILP (lface); } @@ -2717,8 +2711,7 @@ If optional argument FRAME is specified, make a frame-local face for that frame. Otherwise operate on the global face definition. Value is a vector of face attributes. */) - (face, frame) - Lisp_Object face, frame; + (Lisp_Object face, Lisp_Object frame) { Lisp_Object global_lface, lface; struct frame *f; @@ -2806,8 +2799,7 @@ If optional second argument FRAME is non-nil, check for the existence of a frame-local face with name FACE on that frame. Otherwise check for the existence of a global face. */) - (face, frame) - Lisp_Object face, frame; + (Lisp_Object face, Lisp_Object frame) { Lisp_Object lface; @@ -2835,8 +2827,7 @@ FRAME controls where the data is copied to. The value is TO. */) - (from, to, frame, new_frame) - Lisp_Object from, to, frame, new_frame; + (Lisp_Object from, Lisp_Object to, Lisp_Object frame, Lisp_Object new_frame) { Lisp_Object lface, copy; @@ -2861,8 +2852,8 @@ copy = Finternal_make_lisp_face (to, new_frame); } - bcopy (XVECTOR (lface)->contents, XVECTOR (copy)->contents, - LFACE_VECTOR_SIZE * sizeof (Lisp_Object)); + memcpy (XVECTOR (copy)->contents, XVECTOR (lface)->contents, + LFACE_VECTOR_SIZE * sizeof (Lisp_Object)); /* Changing a named face means that all realized faces depending on that face are invalid. Since we cannot tell which realized faces @@ -2887,8 +2878,7 @@ FRAME t means change the default for new frames. FRAME 0 means change the face on all frames, and change the default for new frames. */) - (face, attr, value, frame) - Lisp_Object face, attr, value, frame; + (Lisp_Object face, Lisp_Object attr, Lisp_Object value, Lisp_Object frame) { Lisp_Object lface; Lisp_Object old_value = Qnil; @@ -3514,8 +3504,7 @@ DEFUN ("internal-face-x-get-resource", Finternal_face_x_get_resource, Sinternal_face_x_get_resource, 3, 3, 0, doc: /* */) - (resource, class, frame) - Lisp_Object resource, class, frame; + (Lisp_Object resource, Lisp_Object class, Lisp_Object frame) { Lisp_Object value = Qnil; CHECK_STRING (resource); @@ -3560,8 +3549,7 @@ Finternal_set_lisp_face_attribute_from_resource, Sinternal_set_lisp_face_attribute_from_resource, 3, 4, 0, doc: /* */) - (face, attr, value, frame) - Lisp_Object face, attr, value, frame; + (Lisp_Object face, Lisp_Object attr, Lisp_Object value, Lisp_Object frame) { CHECK_SYMBOL (face); CHECK_SYMBOL (attr); @@ -3722,8 +3710,7 @@ inherited from another face. For most possible attributes, the only relative value that users see is `unspecified'. However, for :height, floating point values are also relative. */) - (attribute, value) - Lisp_Object attribute, value; + (Lisp_Object attribute, Lisp_Object value) { if (EQ (value, Qunspecified) || (EQ (value, Qignore_defface))) return Qt; @@ -3738,8 +3725,7 @@ doc: /* Return face ATTRIBUTE VALUE1 merged with VALUE2. If VALUE1 or VALUE2 are absolute (see `face-attribute-relative-p'), then the result will be absolute, otherwise it will be relative. */) - (attribute, value1, value2) - Lisp_Object attribute, value1, value2; + (Lisp_Object attribute, Lisp_Object value1, Lisp_Object value2) { if (EQ (value1, Qunspecified) || EQ (value1, Qignore_defface)) return value2; @@ -3759,8 +3745,7 @@ If the optional argument FRAME is given, report on face SYMBOL in that frame. If FRAME is t, report on the defaults for face SYMBOL (for new frames). If FRAME is omitted or nil, use the selected frame. */) - (symbol, keyword, frame) - Lisp_Object symbol, keyword, frame; + (Lisp_Object symbol, Lisp_Object keyword, Lisp_Object frame) { Lisp_Object lface, value = Qnil; @@ -3827,8 +3812,7 @@ Sinternal_lisp_face_attribute_values, 1, 1, 0, doc: /* Return a list of valid discrete values for face attribute ATTR. Value is nil if ATTR doesn't have a discrete set of valid values. */) - (attr) - Lisp_Object attr; + (Lisp_Object attr) { Lisp_Object result = Qnil; @@ -3851,8 +3835,7 @@ Sinternal_merge_in_global_face, 2, 2, 0, doc: /* Add attributes from frame-default definition of FACE to FACE on FRAME. Default face attributes override any local face attributes. */) - (face, frame) - Lisp_Object face, frame; + (Lisp_Object face, Lisp_Object frame) { int i; Lisp_Object global_lface, local_lface, *gvec, *lvec; @@ -3890,9 +3873,9 @@ { /* Ensure that the face vector is fully specified by merging the previously-cached vector. */ - bcopy (oldface->lface, attrs, sizeof attrs); + memcpy (attrs, oldface->lface, sizeof attrs); merge_face_vectors (f, lvec, attrs, 0); - bcopy (attrs, lvec, sizeof attrs); + memcpy (lvec, attrs, sizeof attrs); newface = realize_face (c, lvec, DEFAULT_FACE_ID); if ((! UNSPECIFIEDP (gvec[LFACE_FAMILY_INDEX]) @@ -3930,8 +3913,7 @@ If FRAME is omitted or nil, use the selected frame. And, in this case, if the optional third argument CHARACTER is given, return the font name used for CHARACTER. */) - (face, frame, character) - Lisp_Object face, frame, character; + (Lisp_Object face, Lisp_Object frame, Lisp_Object character) { if (EQ (frame, Qt)) { @@ -3997,7 +3979,7 @@ if (SBYTES (v1) != SBYTES (v2)) return 0; - return bcmp (SDATA (v1), SDATA (v2), SBYTES (v1)) == 0; + return memcmp (SDATA (v1), SDATA (v2), SBYTES (v1)) == 0; case_Lisp_Int: case Lisp_Symbol: @@ -4031,8 +4013,7 @@ If the optional argument FRAME is given, report on FACE1 and FACE2 in that frame. If FRAME is t, report on the defaults for FACE1 and FACE2 (for new frames). If FRAME is omitted or nil, use the selected frame. */) - (face1, face2, frame) - Lisp_Object face1, face2, frame; + (Lisp_Object face1, Lisp_Object face2, Lisp_Object frame) { int equal_p; struct frame *f; @@ -4061,8 +4042,7 @@ If the optional argument FRAME is given, report on face FACE in that frame. If FRAME is t, report on the defaults for face FACE (for new frames). If FRAME is omitted or nil, use the selected frame. */) - (face, frame) - Lisp_Object face, frame; + (Lisp_Object face, Lisp_Object frame) { struct frame *f; Lisp_Object lface; @@ -4090,8 +4070,7 @@ 0, 1, 0, doc: /* Return an alist of frame-local faces defined on FRAME. For internal use only. */) - (frame) - Lisp_Object frame; + (Lisp_Object frame) { struct frame *f = frame_or_selected_frame (frame, 0); return f->face_alist; @@ -4169,9 +4148,9 @@ make_realized_face (Lisp_Object *attr) { struct face *face = (struct face *) xmalloc (sizeof *face); - bzero (face, sizeof *face); + memset (face, 0, sizeof *face); face->ascii_face = face; - bcopy (attr, face->lface, sizeof face->lface); + memcpy (face->lface, attr, sizeof face->lface); return face; } @@ -4281,8 +4260,7 @@ COLOR1 and COLOR2 may be either strings containing the color name, or lists of the form (RED GREEN BLUE). If FRAME is unspecified or nil, the current frame is used. */) - (color1, color2, frame) - Lisp_Object color1, color2, frame; + (Lisp_Object color1, Lisp_Object color2, Lisp_Object frame) { struct frame *f; XColor cdef1, cdef2; @@ -4316,10 +4294,10 @@ int size; c = (struct face_cache *) xmalloc (sizeof *c); - bzero (c, sizeof *c); + memset (c, 0, sizeof *c); size = FACE_CACHE_BUCKETS_SIZE * sizeof *c->buckets; c->buckets = (struct face **) xmalloc (size); - bzero (c->buckets, size); + memset (c->buckets, 0, size); c->size = 50; c->faces_by_id = (struct face **) xmalloc (c->size * sizeof *c->faces_by_id); c->f = f; @@ -4383,7 +4361,7 @@ c->used = 0; size = FACE_CACHE_BUCKETS_SIZE * sizeof *c->buckets; - bzero (c->buckets, size); + memset (c->buckets, 0, size); /* Must do a thorough redisplay the next time. Mark current matrices as invalid because they will reference faces freed @@ -4680,7 +4658,7 @@ if (! get_lface_attributes (f, symbol, symbol_attrs, signal_p, 0)) return -1; - bcopy (default_face->lface, attrs, sizeof attrs); + memcpy (attrs, default_face->lface, sizeof attrs); merge_face_vectors (f, symbol_attrs, attrs, 0); return lookup_face (f, attrs); @@ -4781,7 +4759,7 @@ steps = eabs (steps); face = FACE_FROM_ID (f, face_id); - bcopy (face->lface, attrs, sizeof attrs); + memcpy (attrs, face->lface, sizeof attrs); pt = last_pt = XFASTINT (attrs[LFACE_HEIGHT_INDEX]); new_face_id = face_id; last_height = FONT_HEIGHT (face->font); @@ -4832,7 +4810,7 @@ return face_id; face = FACE_FROM_ID (f, face_id); - bcopy (face->lface, attrs, sizeof attrs); + memcpy (attrs, face->lface, sizeof attrs); attrs[LFACE_HEIGHT_INDEX] = make_number (height); font_clear_prop (attrs, FONT_SIZE_INDEX); face_id = lookup_face (f, attrs); @@ -4862,7 +4840,7 @@ if (!get_lface_attributes (f, symbol, symbol_attrs, signal_p, 0)) return -1; - bcopy (default_face->lface, attrs, sizeof attrs); + memcpy (attrs, default_face->lface, sizeof attrs); merge_face_vectors (f, symbol_attrs, attrs, 0); return lookup_face (f, attrs); } @@ -4870,8 +4848,7 @@ DEFUN ("face-attributes-as-vector", Fface_attributes_as_vector, Sface_attributes_as_vector, 1, 1, 0, doc: /* Return a vector of face attributes corresponding to PLIST. */) - (plist) - Lisp_Object plist; + (Lisp_Object plist) { Lisp_Object lface; lface = Fmake_vector (make_number (LFACE_VECTOR_SIZE), @@ -4953,7 +4930,7 @@ Lisp_Object merged_attrs[LFACE_VECTOR_SIZE]; int i; - bcopy (def_attrs, merged_attrs, sizeof merged_attrs); + memcpy (merged_attrs, def_attrs, sizeof merged_attrs); merge_face_vectors (f, attrs, merged_attrs, 0); @@ -5188,8 +5165,7 @@ as it can display a yellowish color, but `:slant italic' will _not_ be satisfied by the tty display code's automatic substitution of a `dim' face for italic. */) - (attributes, display) - Lisp_Object attributes, display; + (Lisp_Object attributes, Lisp_Object display) { int supports = 0, i; Lisp_Object frame; @@ -5266,15 +5242,14 @@ `:weight' in ORDER, font selection first tries to find a font with a suitable height, and then tries to match the font weight. Value is ORDER. */) - (order) - Lisp_Object order; + (Lisp_Object order) { Lisp_Object list; int i; int indices[DIM (font_sort_order)]; CHECK_LIST (order); - bzero (indices, sizeof indices); + memset (indices, 0, sizeof indices); i = 0; for (list = order; @@ -5306,9 +5281,9 @@ if (indices[i] == 0) signal_error ("Invalid font sort order", order); - if (bcmp (indices, font_sort_order, sizeof indices) != 0) - { - bcopy (indices, font_sort_order, sizeof font_sort_order); + if (memcmp (indices, font_sort_order, sizeof indices) != 0) + { + memcpy (font_sort_order, indices, sizeof font_sort_order); free_all_realized_faces (Qnil); } @@ -5325,8 +5300,7 @@ ALIST is an alist of (FAMILY ALTERNATIVE1 ALTERNATIVE2 ...) entries. Each ALTERNATIVE is tried in order if no fonts of font family FAMILY can be found. Value is ALIST. */) - (alist) - Lisp_Object alist; + (Lisp_Object alist) { Lisp_Object entry, tail, tail2; @@ -5355,8 +5329,7 @@ ALIST is an alist of (REGISTRY ALTERNATIVE1 ALTERNATIVE2 ...) entries. Each ALTERNATIVE is tried in order if no fonts of font registry REGISTRY can be found. Value is ALIST. */) - (alist) - Lisp_Object alist; + (Lisp_Object alist) { Lisp_Object entry, tail, tail2; @@ -5553,7 +5526,7 @@ /* Realize the face; it must be fully-specified now. */ xassert (lface_fully_specified_p (XVECTOR (lface)->contents)); check_lface (lface); - bcopy (XVECTOR (lface)->contents, attrs, sizeof attrs); + memcpy (attrs, XVECTOR (lface)->contents, sizeof attrs); face = realize_face (c, attrs, DEFAULT_FACE_ID); #ifdef HAVE_WINDOW_SYSTEM @@ -6040,8 +6013,7 @@ color of the display and whose background is the default foreground color. For such faces, the bold face attribute is ignored if this variable is non-nil. */) - (suppress) - Lisp_Object suppress; + (Lisp_Object suppress) { tty_suppress_bold_inverse_default_colors_p = !NILP (suppress); ++face_change_count; @@ -6074,7 +6046,7 @@ { Lisp_Object attrs[LFACE_VECTOR_SIZE]; struct face *default_face = FACE_FROM_ID (f, DEFAULT_FACE_ID); - bcopy (default_face->lface, attrs, sizeof attrs); + memcpy (attrs, default_face->lface, sizeof attrs); merge_face_ref (f, prop, attrs, 1, 0); face_id = lookup_face (f, attrs); } @@ -6163,7 +6135,7 @@ return default_face->id; /* Begin with attributes from the default face. */ - bcopy (default_face->lface, attrs, sizeof attrs); + memcpy (attrs, default_face->lface, sizeof attrs); /* Merge in attributes specified via text properties. */ if (!NILP (prop)) @@ -6257,7 +6229,7 @@ return DEFAULT_FACE_ID; /* Begin with attributes from the default face. */ - bcopy (default_face->lface, attrs, sizeof attrs); + memcpy (attrs, default_face->lface, sizeof attrs); /* Merge in attributes specified via text properties. */ if (!NILP (prop)) @@ -6358,7 +6330,7 @@ return base_face->id; /* Begin with attributes from the base face. */ - bcopy (base_face->lface, attrs, sizeof attrs); + memcpy (attrs, base_face->lface, sizeof attrs); /* Merge in attributes specified via text properties. */ if (!NILP (prop)) @@ -6413,7 +6385,7 @@ } /* Begin with attributes from the base face. */ - bcopy (base_face->lface, attrs, sizeof attrs); + memcpy (attrs, base_face->lface, sizeof attrs); if (!NILP (face_name)) { @@ -6446,8 +6418,7 @@ The file should define one named RGB color per line like so: R G B name where R,G,B are numbers between 0 and 255 and name is an arbitrary string. */) - (filename) - Lisp_Object filename; + (Lisp_Object filename) { FILE *fp; Lisp_Object cmap = Qnil; @@ -6529,8 +6500,7 @@ DEFUN ("dump-face", Fdump_face, Sdump_face, 0, 1, 0, doc: /* */) - (n) - Lisp_Object n; + (Lisp_Object n) { if (NILP (n)) { @@ -6564,7 +6534,7 @@ DEFUN ("show-face-resources", Fshow_face_resources, Sshow_face_resources, 0, 0, 0, doc: /* */) - () + (void) { fprintf (stderr, "number of colors = %d\n", ncolors_allocated); fprintf (stderr, "number of pixmaps = %d\n", npixmaps_allocated);
--- a/src/xfns.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/xfns.c Thu Jul 08 22:47:34 2010 +0000 @@ -1925,7 +1925,7 @@ { /* There is no base font name, use the default. */ int len = strlen (base_fontname) + 2; fontsetname = xmalloc (len); - bzero (fontsetname, len); + memset (fontsetname, 0, len); strcpy (fontsetname, base_fontname); } else @@ -1946,7 +1946,7 @@ Use the specified font plus the default. */ int len = strlen (base_fontname) + strlen (xic_defaut_fontset) + 3; fontsetname = xmalloc (len); - bzero (fontsetname, len); + memset (fontsetname, 0, len); strcpy (fontsetname, base_fontname); strcat (fontsetname, sep); strcat (fontsetname, xic_defaut_fontset); @@ -1983,7 +1983,7 @@ int diff = (p2 - p3) - 2; base = alloca (strlen (base_fontname) + 1); - bcopy (base_fontname, base, p3 - base_fontname); + memcpy (base, base_fontname, p3 - base_fontname); base[p3 - base_fontname] = '*'; base[(p3 - base_fontname) + 1] = '-'; strcpy (base + (p3 - base_fontname) + 2, p2); @@ -1996,33 +1996,33 @@ /* Build the font spec that matches all charsets. */ len = p - base_fontname + strlen (allcs) + 1; font_allcs = (char *) alloca (len); - bzero (font_allcs, len); - bcopy (base_fontname, font_allcs, p - base_fontname); + memset (font_allcs, 0, len); + memcpy (font_allcs, base_fontname, p - base_fontname); strcat (font_allcs, allcs); /* Build the font spec that matches all families and add-styles. */ len = p - p1 + strlen (allcs) + strlen (allfamilies) + 1; font_allfamilies = (char *) alloca (len); - bzero (font_allfamilies, len); + memset (font_allfamilies, 0, len); strcpy (font_allfamilies, allfamilies); - bcopy (p1, font_allfamilies + strlen (allfamilies), p - p1); + memcpy (font_allfamilies + strlen (allfamilies), p1, p - p1); strcat (font_allfamilies, allcs); /* Build the font spec that matches all. */ len = p - p2 + strlen (allcs) + strlen (all) + strlen (allfamilies) + 1; font_all = (char *) alloca (len); - bzero (font_all, len); + memset (font_all, 0, len); strcpy (font_all, allfamilies); strcat (font_all, all); - bcopy (p2, font_all + strlen (all) + strlen (allfamilies), p - p2); + memcpy (font_all + strlen (all) + strlen (allfamilies), p2, p - p2); strcat (font_all, allcs); /* Build the actual font set name. */ len = strlen (base_fontname) + strlen (font_allcs) + strlen (font_allfamilies) + strlen (font_all) + 5; fontsetname = xmalloc (len); - bzero (fontsetname, len); + memset (fontsetname, 0, len); strcpy (fontsetname, base_fontname); strcat (fontsetname, sep); strcat (fontsetname, font_allcs); @@ -3060,8 +3060,7 @@ 0, 1, 0, doc: /* Send the size hints for frame FRAME to the window manager. If FRAME is nil, use the selected frame. */) - (frame) - Lisp_Object frame; + (Lisp_Object frame) { struct frame *f; if (NILP (frame)) @@ -3116,8 +3115,7 @@ be shared by the new frame. This function is an internal primitive--use `make-frame' instead. */) - (parms) - Lisp_Object parms; + (Lisp_Object parms) { struct frame *f; Lisp_Object frame, tem; @@ -3194,7 +3192,7 @@ f->output_method = output_x_window; f->output_data.x = (struct x_output *) xmalloc (sizeof (struct x_output)); - bzero (f->output_data.x, sizeof (struct x_output)); + memset (f->output_data.x, 0, sizeof (struct x_output)); f->output_data.x->icon_bitmap = -1; FRAME_FONTSET (f) = -1; f->output_data.x->scroll_bar_foreground_pixel = -1; @@ -3561,8 +3559,7 @@ DEFUN ("x-focus-frame", Fx_focus_frame, Sx_focus_frame, 1, 1, 0, doc: /* Set the input focus to FRAME. FRAME nil means use the selected frame. */) - (frame) - Lisp_Object frame; + (Lisp_Object frame) { struct frame *f = check_x_frame (frame); Display *dpy = FRAME_X_DISPLAY (f); @@ -3581,8 +3578,7 @@ DEFUN ("xw-color-defined-p", Fxw_color_defined_p, Sxw_color_defined_p, 1, 2, 0, doc: /* Internal function called by `color-defined-p', which see. */) - (color, frame) - Lisp_Object color, frame; + (Lisp_Object color, Lisp_Object frame) { XColor foo; FRAME_PTR f = check_x_frame (frame); @@ -3597,8 +3593,7 @@ DEFUN ("xw-color-values", Fxw_color_values, Sxw_color_values, 1, 2, 0, doc: /* Internal function called by `color-values', which see. */) - (color, frame) - Lisp_Object color, frame; + (Lisp_Object color, Lisp_Object frame) { XColor foo; FRAME_PTR f = check_x_frame (frame); @@ -3615,8 +3610,7 @@ DEFUN ("xw-display-color-p", Fxw_display_color_p, Sxw_display_color_p, 0, 1, 0, doc: /* Internal function called by `display-color-p', which see. */) - (terminal) - Lisp_Object terminal; + (Lisp_Object terminal) { struct x_display_info *dpyinfo = check_x_display_info (terminal); @@ -3643,8 +3637,7 @@ The optional argument TERMINAL specifies which display to ask about. TERMINAL should be a terminal object, a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (terminal) - Lisp_Object terminal; + (Lisp_Object terminal) { struct x_display_info *dpyinfo = check_x_display_info (terminal); @@ -3672,8 +3665,7 @@ The optional argument TERMINAL specifies which display to ask about. TERMINAL should be a terminal object, a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (terminal) - Lisp_Object terminal; + (Lisp_Object terminal) { struct x_display_info *dpyinfo = check_x_display_info (terminal); @@ -3686,8 +3678,7 @@ The optional argument TERMINAL specifies which display to ask about. TERMINAL should be a terminal object, a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (terminal) - Lisp_Object terminal; + (Lisp_Object terminal) { struct x_display_info *dpyinfo = check_x_display_info (terminal); @@ -3700,8 +3691,7 @@ The optional argument TERMINAL specifies which display to ask about. TERMINAL should be a terminal object, a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (terminal) - Lisp_Object terminal; + (Lisp_Object terminal) { struct x_display_info *dpyinfo = check_x_display_info (terminal); @@ -3714,8 +3704,7 @@ The optional argument TERMINAL specifies which display to ask about. TERMINAL should be a terminal object, a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (terminal) - Lisp_Object terminal; + (Lisp_Object terminal) { struct x_display_info *dpyinfo = check_x_display_info (terminal); @@ -3739,8 +3728,7 @@ The optional argument TERMINAL specifies which display to ask about. TERMINAL should be a terminal object, a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (terminal) - Lisp_Object terminal; + (Lisp_Object terminal) { struct x_display_info *dpyinfo = check_x_display_info (terminal); @@ -3754,8 +3742,7 @@ The optional argument TERMINAL specifies which display to ask about. TERMINAL should be a terminal object, a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (terminal) - Lisp_Object terminal; + (Lisp_Object terminal) { struct x_display_info *dpyinfo = check_x_display_info (terminal); char *vendor = ServerVendor (dpyinfo->display); @@ -3773,8 +3760,7 @@ The optional argument TERMINAL specifies which display to ask about. TERMINAL should be a terminal object, a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (terminal) - Lisp_Object terminal; + (Lisp_Object terminal) { struct x_display_info *dpyinfo = check_x_display_info (terminal); Display *dpy = dpyinfo->display; @@ -3789,8 +3775,7 @@ The optional argument TERMINAL specifies which display to ask about. TERMINAL should be a terminal object, a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (terminal) - Lisp_Object terminal; + (Lisp_Object terminal) { struct x_display_info *dpyinfo = check_x_display_info (terminal); @@ -3802,8 +3787,7 @@ The optional argument TERMINAL specifies which display to ask about. TERMINAL should be a terminal object, a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (terminal) - Lisp_Object terminal; + (Lisp_Object terminal) { struct x_display_info *dpyinfo = check_x_display_info (terminal); @@ -3815,8 +3799,7 @@ The optional argument TERMINAL specifies which display to ask about. TERMINAL should be a terminal object, a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (terminal) - Lisp_Object terminal; + (Lisp_Object terminal) { struct x_display_info *dpyinfo = check_x_display_info (terminal); @@ -3830,8 +3813,7 @@ The optional argument TERMINAL specifies which display to ask about. TERMINAL should be a terminal object, a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (terminal) - Lisp_Object terminal; + (Lisp_Object terminal) { struct x_display_info *dpyinfo = check_x_display_info (terminal); Lisp_Object result; @@ -3867,8 +3849,7 @@ The optional argument TERMINAL specifies which display to ask about. TERMINAL should a terminal object, a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (terminal) - Lisp_Object terminal; + (Lisp_Object terminal) { struct x_display_info *dpyinfo = check_x_display_info (terminal); Lisp_Object result; @@ -3907,8 +3888,7 @@ The optional argument TERMINAL specifies which display to ask about. TERMINAL should be a terminal object, a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (terminal) - Lisp_Object terminal; + (Lisp_Object terminal) { struct x_display_info *dpyinfo = check_x_display_info (terminal); @@ -4120,8 +4100,7 @@ Optional second arg XRM-STRING is a string of resources in xrdb format. If the optional third arg MUST-SUCCEED is non-nil, terminate Emacs if we can't open the connection. */) - (display, xrm_string, must_succeed) - Lisp_Object display, xrm_string, must_succeed; + (Lisp_Object display, Lisp_Object xrm_string, Lisp_Object must_succeed) { unsigned char *xrm_option; struct x_display_info *dpyinfo; @@ -4172,8 +4151,7 @@ For TERMINAL, specify a terminal object, a frame or a display name (a string). If TERMINAL is nil, that stands for the selected frame's terminal. */) - (terminal) - Lisp_Object terminal; + (Lisp_Object terminal) { struct x_display_info *dpyinfo = check_x_display_info (terminal); @@ -4187,7 +4165,7 @@ DEFUN ("x-display-list", Fx_display_list, Sx_display_list, 0, 0, 0, doc: /* Return the list of display names that Emacs has connections to. */) - () + (void) { Lisp_Object tail, result; @@ -4207,8 +4185,7 @@ The optional second argument TERMINAL specifies which display to act on. TERMINAL should be a terminal object, a frame or a display name (a string). If TERMINAL is omitted or nil, that stands for the selected frame's display. */) - (on, terminal) - Lisp_Object terminal, on; + (Lisp_Object on, Lisp_Object terminal) { struct x_display_info *dpyinfo = check_x_display_info (terminal); @@ -4251,8 +4228,7 @@ FRAME. Default is to change on the edit X window. Value is VALUE. */) - (prop, value, frame, type, format, outer_p) - Lisp_Object prop, value, frame, type, format, outer_p; + (Lisp_Object prop, Lisp_Object value, Lisp_Object frame, Lisp_Object type, Lisp_Object format, Lisp_Object outer_p) { struct frame *f = check_x_frame (frame); Atom prop_atom; @@ -4330,8 +4306,7 @@ Sx_delete_window_property, 1, 2, 0, doc: /* Remove window property PROP from X window of FRAME. FRAME nil or omitted means use the selected frame. Value is PROP. */) - (prop, frame) - Lisp_Object prop, frame; + (Lisp_Object prop, Lisp_Object frame) { struct frame *f = check_x_frame (frame); Atom prop_atom; @@ -4362,8 +4337,7 @@ Value is nil if FRAME hasn't a property with name PROP or if PROP has no value of TYPE. */) - (prop, frame, type, source, delete_p, vector_ret_p) - Lisp_Object prop, frame, type, source, delete_p, vector_ret_p; + (Lisp_Object prop, Lisp_Object frame, Lisp_Object type, Lisp_Object source, Lisp_Object delete_p, Lisp_Object vector_ret_p) { struct frame *f = check_x_frame (frame); Atom prop_atom; @@ -4431,7 +4405,7 @@ elements." This applies even if long is more than 32 bits, the X library converts from 32 bit elements received from the X server to long - and passes the long array to us. Thus, for that case bcopy can not + and passes the long array to us. Thus, for that case memcpy can not be used. We convert to a 32 bit type here, because so much code assume on that. @@ -4687,7 +4661,7 @@ counts etc. */ f->output_method = output_x_window; f->output_data.x = (struct x_output *) xmalloc (sizeof (struct x_output)); - bzero (f->output_data.x, sizeof (struct x_output)); + memset (f->output_data.x, 0, sizeof (struct x_output)); f->output_data.x->icon_bitmap = -1; FRAME_FONTSET (f) = -1; f->output_data.x->scroll_bar_foreground_pixel = -1; @@ -5024,8 +4998,7 @@ A tooltip's maximum size is specified by `x-max-tooltip-size'. Text larger than the specified size is clipped. */) - (string, frame, parms, timeout, dx, dy) - Lisp_Object string, frame, parms, timeout, dx, dy; + (Lisp_Object string, Lisp_Object frame, Lisp_Object parms, Lisp_Object timeout, Lisp_Object dx, Lisp_Object dy) { struct frame *f; struct window *w; @@ -5216,7 +5189,7 @@ DEFUN ("x-hide-tip", Fx_hide_tip, Sx_hide_tip, 0, 0, 0, doc: /* Hide the current tooltip window, if there is any. Value is t if tooltip was open, nil otherwise. */) - () + (void) { int count; Lisp_Object deleted, frame, timer; @@ -5277,7 +5250,7 @@ Sx_uses_old_gtk_dialog, 0, 0, 0, doc: /* Return t if the old Gtk+ file selection dialog is used. */) - () + (void) { #ifdef USE_GTK extern int use_dialog_box; @@ -5344,8 +5317,7 @@ Use a file selection dialog. Select DEFAULT-FILENAME in the dialog's file selection box, if specified. If MUSTMATCH is non-nil, the returned file or directory must exist. ONLY-DIR-P is ignored." */) - (prompt, dir, default_filename, mustmatch, only_dir_p) - Lisp_Object prompt, dir, default_filename, mustmatch, only_dir_p; + (Lisp_Object prompt, Lisp_Object dir, Lisp_Object default_filename, Lisp_Object mustmatch, Lisp_Object only_dir_p) { int result; struct frame *f = SELECTED_FRAME (); @@ -5516,8 +5488,7 @@ selection box, if specified. If MUSTMATCH is non-nil, the returned file or directory must exist. If ONLY-DIR-P is non-nil, the user can only select directories. */) - (prompt, dir, default_filename, mustmatch, only_dir_p) - Lisp_Object prompt, dir, default_filename, mustmatch, only_dir_p; + (Lisp_Object prompt, Lisp_Object dir, Lisp_Object default_filename, Lisp_Object mustmatch, Lisp_Object only_dir_p) { FRAME_PTR f = SELECTED_FRAME (); char *fn; @@ -5578,8 +5549,7 @@ Return a GTK-style font string corresponding to the selection. If FRAME is omitted or nil, it defaults to the selected frame. */) - (frame, ignored) - Lisp_Object frame, ignored; + (Lisp_Object frame, Lisp_Object ignored) { FRAME_PTR f = check_x_frame (frame); char *name; @@ -5667,8 +5637,7 @@ Value is t if we know that both keys are present, and are mapped to the usual X keysyms. Value is `lambda' if we cannot determine if both keys are present and mapped to the usual X keysyms. */) - (frame) - Lisp_Object frame; + (Lisp_Object frame) { #ifdef HAVE_XKBGETKEYBOARD XkbDescPtr kb; @@ -5729,9 +5698,9 @@ /* The XKB symbolic key names can be seen most easily in the PS file generated by `xkbprint -label name $DISPLAY'. */ - if (bcmp ("DELE", kb->names->keys[i].name, 4) == 0) + if (memcmp ("DELE", kb->names->keys[i].name, 4) == 0) delete_keycode = i; - else if (bcmp ("BKSP", kb->names->keys[i].name, 4) == 0) + else if (memcmp ("BKSP", kb->names->keys[i].name, 4) == 0) backspace_keycode = i; }
--- a/src/xfont.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/xfont.c Thu Jul 08 22:47:34 2010 +0000 @@ -562,7 +562,7 @@ val = assq_no_quit (QCname, AREF (spec, FONT_EXTRA_INDEX)); if (CONSP (val) && STRINGP (XCDR (val)) && SBYTES (XCDR (val)) < 512) { - bcopy (SDATA (XCDR (val)), name, SBYTES (XCDR (val)) + 1); + memcpy (name, SDATA (XCDR (val)), SBYTES (XCDR (val)) + 1); if (xfont_encode_coding_xlfd (name) < 0) return Qnil; list = xfont_list_pattern (display, name, registry, script); @@ -590,7 +590,7 @@ return Qnil; } else if (SBYTES (XCDR (val)) < 512) - bcopy (SDATA (XCDR (val)), name, SBYTES (XCDR (val)) + 1); + memcpy (name, SDATA (XCDR (val)), SBYTES (XCDR (val)) + 1); else return Qnil; if (xfont_encode_coding_xlfd (name) < 0) @@ -669,7 +669,7 @@ if (! *p1 || p1 == p0) continue; if (last_len == p1 - p0 - && bcmp (last_family, p0, last_len) == 0) + && memcmp (last_family, p0, last_len) == 0) continue; last_len = p1 - p0; last_family = p0; @@ -980,7 +980,7 @@ int i, first, x; if (metrics) - bzero (metrics, sizeof (struct font_metrics)); + memset (metrics, 0, sizeof (struct font_metrics)); for (i = 0, x = 0, first = 1; i < nglyphs; i++) { XChar2b char2b;
--- a/src/xmenu.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/xmenu.c Thu Jul 08 22:47:34 2010 +0000 @@ -260,8 +260,7 @@ If the user gets rid of the dialog box without making a valid choice, for instance using the window manager, then this produces a quit and `x-popup-dialog' does not return. */) - (position, contents, header) - Lisp_Object position, contents, header; + (Lisp_Object position, Lisp_Object contents, Lisp_Object header) { FRAME_PTR f = NULL; Lisp_Object window; @@ -518,8 +517,7 @@ escape key. If FRAME has no menu bar this function does nothing. If FRAME is nil or not given, use the selected frame. */) - (frame) - Lisp_Object frame; + (Lisp_Object frame) { XEvent ev; FRAME_PTR f = check_x_frame (frame); @@ -597,8 +595,7 @@ escape key. If FRAME has no menu bar this function does nothing. If FRAME is nil or not given, use the selected frame. */) - (frame) - Lisp_Object frame; + (Lisp_Object frame) { GtkWidget *menubar; FRAME_PTR f; @@ -1067,8 +1064,8 @@ /* Save the frame's previous menu bar contents data. */ if (previous_menu_items_used) - bcopy (XVECTOR (f->menu_bar_vector)->contents, previous_items, - previous_menu_items_used * sizeof (Lisp_Object)); + memcpy (previous_items, XVECTOR (f->menu_bar_vector)->contents, + previous_menu_items_used * sizeof (Lisp_Object)); /* Fill in menu_items with the current menu bar contents. This can evaluate Lisp code. */ @@ -1282,7 +1279,9 @@ /* Make menu pop down on C-g. */ XtOverrideTranslations (menubar_widget, override); +#ifdef USE_LUCID apply_systemfont_to_menu (menubar_widget); +#endif } { @@ -1614,7 +1613,9 @@ popup_deactivate_callback, menu_highlight_callback); +#ifdef USE_LUCID apply_systemfont_to_menu (menu); +#endif dummy.type = ButtonPress; dummy.serial = 0; @@ -2016,7 +2017,7 @@ abort(); dialog_id = widget_id_tick++; -#ifdef HAVE_XFT +#ifdef USE_LUCID apply_systemfont_to_dialog (f->output_data.x->widget); #endif lw_create_widget (first_wv->name, "dialog", dialog_id, first_wv, @@ -2452,12 +2453,10 @@ item_data = (unsigned char *) alloca (maxwidth + SBYTES (descrip) + 1); - bcopy (SDATA (item_name), item_data, - SBYTES (item_name)); + memcpy (item_data, SDATA (item_name), SBYTES (item_name)); for (j = SCHARS (item_name); j < maxwidth; j++) item_data[j] = ' '; - bcopy (SDATA (descrip), item_data + j, - SBYTES (descrip)); + memcpy (item_data + j, SDATA (descrip), SBYTES (descrip)); item_data[j + SBYTES (descrip)] = 0; } else @@ -2624,7 +2623,7 @@ DEFUN ("menu-or-popup-active-p", Fmenu_or_popup_active_p, Smenu_or_popup_active_p, 0, 0, 0, doc: /* Return t if a menu or popup dialog is active. */) - () + (void) { #ifdef HAVE_MENUS return (popup_activated ()) ? Qt : Qnil;
--- a/src/xrdb.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/xrdb.c Thu Jul 08 22:47:34 2010 +0000 @@ -233,7 +233,7 @@ path = (char *) realloc (path, path_size); } - bcopy (next, path + path_len, next_len); + memcpy (path + path_len, next, next_len); path_len += next_len; p++; @@ -259,7 +259,7 @@ path = (char *) realloc (path, path_size); } - bcopy (suffix, path + path_len, suffix_len); + memcpy (path + path_len, suffix, suffix_len); path_len += suffix_len; } @@ -644,7 +644,7 @@ if (type == x_rm_string) ret_value->addr = (char *) value.addr; else - bcopy (value.addr, ret_value->addr, ret_value->size); + memcpy (ret_value->addr, value.addr, ret_value->size); return value.size; }
--- a/src/xselect.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/xselect.c Thu Jul 08 22:47:34 2010 +0000 @@ -191,7 +191,7 @@ This only happens for large requests which uses the incremental protocol. */ for (queue_tmp = selection_queue; queue_tmp; queue_tmp = queue_tmp->next) { - if (!bcmp (&queue_tmp->event, event, sizeof (*event))) + if (!memcmp (&queue_tmp->event, event, sizeof (*event))) { TRACE1 ("DECLINE DUP SELECTION EVENT %08lx", (unsigned long)queue_tmp); x_decline_selection_request (event); @@ -1534,7 +1534,7 @@ elements." This applies even if long is more than 32 bits, the X library converts from 32 bit elements received from the X server to long - and passes the long array to us. Thus, for that case bcopy can not + and passes the long array to us. Thus, for that case memcpy can not be used. We convert to a 32 bit type here, because so much code assume on that. @@ -1556,7 +1556,7 @@ else { *actual_size_ret *= *actual_format_ret / 8; - bcopy (tmp_data, (*data_ret) + offset, *actual_size_ret); + memcpy ((*data_ret) + offset, tmp_data, *actual_size_ret); offset += *actual_size_ret; } @@ -1658,7 +1658,7 @@ *data_ret = (unsigned char *) xrealloc (*data_ret, *size_bytes_ret); } - bcopy (tmp_data, (*data_ret) + offset, tmp_size_bytes); + memcpy ((*data_ret) + offset, tmp_data, tmp_size_bytes); offset += tmp_size_bytes; /* Use xfree, not XFree, because x_get_window_property @@ -2094,8 +2094,7 @@ \(Those are literal upper-case symbol names, since that's what X expects.) VALUE is typically a string, or a cons of two markers, but may be anything that the functions on `selection-converter-alist' know about. */) - (selection_name, selection_value) - Lisp_Object selection_name, selection_value; + (Lisp_Object selection_name, Lisp_Object selection_value) { check_x (); CHECK_SYMBOL (selection_name); @@ -2117,8 +2116,7 @@ TYPE is the type of data desired, typically `STRING'. TIME_STAMP is the time to use in the XConvertSelection call for foreign selections. If omitted, defaults to the time for the last event. */) - (selection_symbol, target_type, time_stamp) - Lisp_Object selection_symbol, target_type, time_stamp; + (Lisp_Object selection_symbol, Lisp_Object target_type, Lisp_Object time_stamp) { Lisp_Object val = Qnil; struct gcpro gcpro1, gcpro2; @@ -2163,9 +2161,7 @@ Sx_disown_selection_internal, 1, 2, 0, doc: /* If we own the selection SELECTION, disown it. Disowning it means there is no such selection. */) - (selection, time) - Lisp_Object selection; - Lisp_Object time; + (Lisp_Object selection, Lisp_Object time) { Time timestamp; Atom selection_atom; @@ -2239,8 +2235,7 @@ \(Those are literal upper-case symbol names, since that's what X expects.) For convenience, the symbol nil is the same as `PRIMARY', and t is the same as `SECONDARY'. */) - (selection) - Lisp_Object selection; + (Lisp_Object selection) { check_x (); CHECK_SYMBOL (selection); @@ -2260,8 +2255,7 @@ \(Those are literal upper-case symbol names, since that's what X expects.) For convenience, the symbol nil is the same as `PRIMARY', and t is the same as `SECONDARY'. */) - (selection) - Lisp_Object selection; + (Lisp_Object selection) { Window owner; Atom atom; @@ -2323,8 +2317,7 @@ DEFUN ("x-get-cut-buffer-internal", Fx_get_cut_buffer_internal, Sx_get_cut_buffer_internal, 1, 1, 0, doc: /* Returns the value of the named cut buffer (typically CUT_BUFFER0). */) - (buffer) - Lisp_Object buffer; + (Lisp_Object buffer) { Window window; Atom buffer_atom; @@ -2374,8 +2367,7 @@ DEFUN ("x-store-cut-buffer-internal", Fx_store_cut_buffer_internal, Sx_store_cut_buffer_internal, 2, 2, 0, doc: /* Sets the value of the named cut buffer (typically CUT_BUFFER0). */) - (buffer, string) - Lisp_Object buffer, string; + (Lisp_Object buffer, Lisp_Object string) { Window window; Atom buffer_atom; @@ -2440,8 +2432,7 @@ Sx_rotate_cut_buffers_internal, 1, 1, 0, doc: /* Rotate the values of the cut buffers by N steps. Positive N means shift the values forward, negative means backward. */) - (n) - Lisp_Object n; + (Lisp_Object n) { Window window; Atom props[8]; @@ -2624,8 +2615,7 @@ Use the display for FRAME or the current frame if FRAME is not given or nil. If the value is 0 or the atom is not known, return the empty string. */) - (value, frame) - Lisp_Object value, frame; + (Lisp_Object value, Lisp_Object frame) { struct frame *f = check_x_frame (frame); char *name = 0; @@ -2665,8 +2655,7 @@ doc: /* Request that dnd events are made for ClientMessages with ATOM. ATOM can be a symbol or a string. The ATOM is interned on the display that FRAME is on. If FRAME is nil, the selected frame is used. */) - (atom, frame) - Lisp_Object atom, frame; + (Lisp_Object atom, Lisp_Object frame) { Atom x_atom; struct frame *f = check_x_frame (frame); @@ -2783,8 +2772,7 @@ with the high 16 bits from the car and the lower 16 bit from the cdr. If more values than fits into the event is given, the excessive values are ignored. */) - (display, dest, from, message_type, format, values) - Lisp_Object display, dest, from, message_type, format, values; + (Lisp_Object display, Lisp_Object dest, Lisp_Object from, Lisp_Object message_type, Lisp_Object format, Lisp_Object values) { struct x_display_info *dpyinfo = check_x_display_info (display); Window wdest;
--- a/src/xsettings.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/xsettings.c Thu Jul 08 22:47:34 2010 +0000 @@ -703,7 +703,7 @@ Sfont_get_system_normal_font, 0, 0, 0, doc: /* Get the system default application font. */) - () + (void) { return current_font ? make_string (current_font, strlen (current_font)) @@ -713,7 +713,7 @@ DEFUN ("font-get-system-font", Ffont_get_system_font, Sfont_get_system_font, 0, 0, 0, doc: /* Get the system default fixed width font. */) - () + (void) { return current_mono_font ? make_string (current_mono_font, strlen (current_mono_font)) @@ -725,7 +725,7 @@ doc: /* Get the system tool bar style. If no system tool bar style is known, return `tool-bar-style' if set to a known style. Otherwise return image. */) - () + (void) { if (EQ (Vtool_bar_style, Qimage) || EQ (Vtool_bar_style, Qtext)
--- a/src/xsmfns.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/xsmfns.c Thu Jul 08 22:47:34 2010 +0000 @@ -154,7 +154,7 @@ /* Check if smc_interact_CB was called and we shall generate a SAVE_SESSION_EVENT. */ if (emacs_event.kind != NO_EVENT) - bcopy (&emacs_event, bufp, sizeof (struct input_event)); + memcpy (bufp, &emacs_event, sizeof (struct input_event)); return emacs_event.kind != NO_EVENT ? 1 : 0; } @@ -519,8 +519,7 @@ is told to abort the window system shutdown. Do not call this function yourself. */) - (event) - Lisp_Object event; + (Lisp_Object event) { /* Check doing_interact so that we don't do anything if someone called this at the wrong time. */
--- a/src/xterm.c Wed Jul 07 22:09:05 2010 +0000 +++ b/src/xterm.c Thu Jul 08 22:47:34 2010 +0000 @@ -4131,7 +4131,7 @@ scroll_bar_windows = (struct window **) xrealloc (scroll_bar_windows, nbytes); - bzero (&scroll_bar_windows[i], nbytes - old_nbytes); + memset (&scroll_bar_windows[i], 0, nbytes - old_nbytes); scroll_bar_windows_size = new_size; } @@ -5608,7 +5608,7 @@ if (f->output_data.x->saved_menu_event == 0) \ f->output_data.x->saved_menu_event \ = (XEvent *) xmalloc (sizeof (XEvent)); \ - bcopy (&event, f->output_data.x->saved_menu_event, size); \ + memcpy (f->output_data.x->saved_menu_event, &event, size); \ inev.ie.kind = MENU_BAR_ACTIVATE_EVENT; \ XSETFRAME (inev.ie.frame_or_window, f); \ } \ @@ -6245,7 +6245,7 @@ this enables ComposeCharacter to work whether or not it is combined with Meta. */ if (modifiers & dpyinfo->meta_mod_mask) - bzero (&compose_status, sizeof (compose_status)); + memset (&compose_status, 0, sizeof (compose_status)); #ifdef HAVE_X_I18N if (FRAME_XIC (f)) @@ -6293,7 +6293,7 @@ if (compose_status.chars_matched > 0 && nbytes == 0) break; - bzero (&compose_status, sizeof (compose_status)); + memset (&compose_status, 0, sizeof (compose_status)); orig_keysym = keysym; /* Common for all keysym input events. */ @@ -6707,7 +6707,7 @@ by the rest of Emacs, we put it here. */ int tool_bar_p = 0; - bzero (&compose_status, sizeof (compose_status)); + memset (&compose_status, 0, sizeof (compose_status)); last_mouse_glyph_frame = 0; last_user_time = event.xbutton.time; @@ -7553,7 +7553,7 @@ if (x_error_message->string[0]) { char string[X_ERROR_MESSAGE_SIZE]; - bcopy (x_error_message->string, string, X_ERROR_MESSAGE_SIZE); + memcpy (string, x_error_message->string, X_ERROR_MESSAGE_SIZE); x_uncatch_errors (); error (format, string); } @@ -8077,7 +8077,7 @@ xim_inst->dpyinfo = dpyinfo; len = strlen (resource_name); xim_inst->resource_name = (char *) xmalloc (len + 1); - bcopy (resource_name, xim_inst->resource_name, len + 1); + memcpy (xim_inst->resource_name, resource_name, len + 1); XRegisterIMInstantiateCallback (dpyinfo->display, dpyinfo->xrdb, resource_name, EMACS_CLASS, xim_instantiate_callback, @@ -9929,7 +9929,7 @@ /* We have definitely succeeded. Record the new connection. */ dpyinfo = (struct x_display_info *) xmalloc (sizeof (struct x_display_info)); - bzero (dpyinfo, sizeof *dpyinfo); + memset (dpyinfo, 0, sizeof *dpyinfo); terminal = x_create_terminal (dpyinfo);