Commit 971de7fb authored by Dan Nicolaescu's avatar Dan Nicolaescu

Convert (most) functions in src to standard C.

* src/alloc.c: Convert function definitions to standard C.
* src/atimer.c:
* src/bidi.c:
* src/bytecode.c:
* src/callint.c:
* src/callproc.c:
* src/casefiddle.c:
* src/casetab.c:
* src/category.c:
* src/ccl.c:
* src/character.c:
* src/charset.c:
* src/chartab.c:
* src/cmds.c:
* src/coding.c:
* src/composite.c:
* src/data.c:
* src/dbusbind.c:
* src/dired.c:
* src/dispnew.c:
* src/doc.c:
* src/doprnt.c:
* src/ecrt0.c:
* src/editfns.c:
* src/fileio.c:
* src/filelock.c:
* src/filemode.c:
* src/fns.c:
* src/font.c:
* src/fontset.c:
* src/frame.c:
* src/fringe.c:
* src/ftfont.c:
* src/ftxfont.c:
* src/gtkutil.c:
* src/indent.c:
* src/insdel.c:
* src/intervals.c:
* src/keymap.c:
* src/lread.c:
* src/macros.c:
* src/marker.c:
* src/md5.c:
* src/menu.c:
* src/minibuf.c:
* src/prefix-args.c:
* src/print.c:
* src/ralloc.c:
* src/regex.c:
* src/region-cache.c:
* src/scroll.c:
* src/search.c:
* src/sound.c:
* src/strftime.c:
* src/syntax.c:
* src/sysdep.c:
* src/termcap.c:
* src/terminal.c:
* src/terminfo.c:
* src/textprop.c:
* src/tparam.c:
* src/undo.c:
* src/unexelf.c:
* src/window.c:
* src/xfaces.c:
* src/xfns.c:
* src/xfont.c:
* src/xftfont.c:
* src/xgselect.c:
* src/xmenu.c:
* src/xrdb.c:
* src/xselect.c:
* src/xsettings.c:
* src/xsmfns.c:
* src/xterm.c: Likewise.
parent b8463cbf
2010-07-04 Dan Nicolaescu <dann@ics.uci.edu>
* alloc.c: Convert function definitions to standard C.
* atimer.c:
* bidi.c:
* bytecode.c:
* callint.c:
* callproc.c:
* casefiddle.c:
* casetab.c:
* category.c:
* ccl.c:
* character.c:
* charset.c:
* chartab.c:
* cmds.c:
* coding.c:
* composite.c:
* data.c:
* dbusbind.c:
* dired.c:
* dispnew.c:
* doc.c:
* doprnt.c:
* ecrt0.c:
* editfns.c:
* fileio.c:
* filelock.c:
* filemode.c:
* fns.c:
* font.c:
* fontset.c:
* frame.c:
* fringe.c:
* ftfont.c:
* ftxfont.c:
* gtkutil.c:
* indent.c:
* insdel.c:
* intervals.c:
* keymap.c:
* lread.c:
* macros.c:
* marker.c:
* md5.c:
* menu.c:
* minibuf.c:
* prefix-args.c:
* print.c:
* ralloc.c:
* regex.c:
* region-cache.c:
* scroll.c:
* search.c:
* sound.c:
* strftime.c:
* syntax.c:
* sysdep.c:
* termcap.c:
* terminal.c:
* terminfo.c:
* textprop.c:
* tparam.c:
* undo.c:
* unexelf.c:
* window.c:
* xfaces.c:
* xfns.c:
* xfont.c:
* xftfont.c:
* xgselect.c:
* xmenu.c:
* xrdb.c:
* xselect.c:
* xsettings.c:
* xsmfns.c:
* xterm.c: Likewise.
2010-07-03 Eli Zaretskii <eliz@gnu.org>
* msdos.c (IT_set_frame_parameters): Fix setting of colors in
......
This diff is collapsed.
......@@ -68,7 +68,7 @@ static void set_alarm (void);
static void schedule_atimer (struct atimer *);
static struct atimer *append_atimer_lists (struct atimer *,
struct atimer *);
SIGTYPE alarm_signal_handler ();
SIGTYPE alarm_signal_handler (int signo);
/* Start a new atimer of type TYPE. TIME specifies when the timer is
......@@ -90,11 +90,7 @@ SIGTYPE alarm_signal_handler ();
to cancel_atimer; don't free it yourself. */
struct atimer *
start_atimer (type, time, fn, client_data)
enum atimer_type type;
EMACS_TIME time;
atimer_callback fn;
void *client_data;
start_atimer (enum atimer_type type, struct timeval time, atimer_callback fn, void *client_data)
{
struct atimer *t;
......@@ -159,8 +155,7 @@ start_atimer (type, time, fn, client_data)
/* Cancel and free atimer TIMER. */
void
cancel_atimer (timer)
struct atimer *timer;
cancel_atimer (struct atimer *timer)
{
int i;
......@@ -199,8 +194,7 @@ cancel_atimer (timer)
result list. */
static struct atimer *
append_atimer_lists (list1, list2)
struct atimer *list1, *list2;
append_atimer_lists (struct atimer *list1, struct atimer *list2)
{
if (list1 == NULL)
return list2;
......@@ -221,8 +215,7 @@ append_atimer_lists (list1, list2)
/* Stop all timers except timer T. T null means stop all timers. */
void
stop_other_atimers (t)
struct atimer *t;
stop_other_atimers (struct atimer *t)
{
BLOCK_ATIMERS;
......@@ -257,7 +250,7 @@ stop_other_atimers (t)
stop_other_atimers. */
void
run_all_atimers ()
run_all_atimers (void)
{
if (stopped_atimers)
{
......@@ -283,8 +276,7 @@ run_all_atimers ()
/* A version of run_all_timers suitable for a record_unwind_protect. */
Lisp_Object
unwind_stop_other_atimers (dummy)
Lisp_Object dummy;
unwind_stop_other_atimers (Lisp_Object dummy)
{
run_all_atimers ();
return Qnil;
......@@ -294,7 +286,7 @@ unwind_stop_other_atimers (dummy)
/* Arrange for a SIGALRM to arrive when the next timer is ripe. */
static void
set_alarm ()
set_alarm (void)
{
if (atimers)
{
......@@ -330,8 +322,7 @@ set_alarm ()
already. */
static void
schedule_atimer (t)
struct atimer *t;
schedule_atimer (struct atimer *t)
{
struct atimer *a = atimers, *prev = NULL;
......@@ -349,7 +340,7 @@ schedule_atimer (t)
}
static void
run_timers ()
run_timers (void)
{
EMACS_TIME now;
......@@ -401,8 +392,7 @@ run_timers ()
SIGALRM. */
SIGTYPE
alarm_signal_handler (signo)
int signo;
alarm_signal_handler (int signo)
{
#ifndef SYNC_INPUT
SIGNAL_THREAD_CHECK (signo);
......@@ -420,7 +410,7 @@ alarm_signal_handler (signo)
/* Call alarm_signal_handler for pending timers. */
void
do_pending_atimers ()
do_pending_atimers (void)
{
if (pending_atimers)
{
......@@ -435,8 +425,7 @@ do_pending_atimers ()
some systems like HPUX (see process.c). */
void
turn_on_atimers (on)
int on;
turn_on_atimers (int on)
{
if (on)
{
......@@ -449,7 +438,7 @@ turn_on_atimers (on)
void
init_atimer ()
init_atimer (void)
{
free_atimers = stopped_atimers = atimers = NULL;
pending_atimers = 0;
......
......@@ -106,7 +106,7 @@ static Lisp_Object paragraph_start_re, paragraph_separate_re;
static Lisp_Object Qparagraph_start, Qparagraph_separate;
static void
bidi_initialize ()
bidi_initialize (void)
{
#include "biditype.h"
......
......@@ -272,7 +272,7 @@ struct byte_stack *byte_stack_list;
/* Mark objects on byte_stack_list. Called during GC. */
void
mark_byte_stack ()
mark_byte_stack (void)
{
struct byte_stack *stack;
Lisp_Object *obj;
......@@ -301,7 +301,7 @@ mark_byte_stack ()
counters. Called when GC has completed. */
void
unmark_byte_stack ()
unmark_byte_stack (void)
{
struct byte_stack *stack;
......@@ -1678,7 +1678,7 @@ If the third argument is incorrect, Emacs may crash. */)
}
void
syms_of_bytecode ()
syms_of_bytecode (void)
{
Qbytecode = intern_c_string ("byte-code");
staticpro (&Qbytecode);
......
......@@ -140,8 +140,7 @@ usage: (interactive &optional ARGS) */)
/* Quotify EXP: if EXP is constant, return it.
If EXP is not constant, return (quote EXP). */
Lisp_Object
quotify_arg (exp)
register Lisp_Object exp;
quotify_arg (register Lisp_Object exp)
{
if (!INTEGERP (exp) && !STRINGP (exp)
&& !NILP (exp) && !EQ (exp, Qt))
......@@ -152,8 +151,7 @@ quotify_arg (exp)
/* Modify EXP by quotifying each element (except the first). */
Lisp_Object
quotify_args (exp)
Lisp_Object exp;
quotify_args (Lisp_Object exp)
{
register Lisp_Object tail;
Lisp_Object next;
......@@ -169,8 +167,7 @@ char *callint_argfuns[]
= {"", "point", "mark", "region-beginning", "region-end"};
static void
check_mark (for_region)
int for_region;
check_mark (int for_region)
{
Lisp_Object tem;
tem = Fmarker_buffer (current_buffer->mark);
......@@ -191,8 +188,7 @@ check_mark (for_region)
of VALUES to do its job. */
static void
fix_command (input, values)
Lisp_Object input, values;
fix_command (Lisp_Object input, Lisp_Object values)
{
if (CONSP (input))
{
......@@ -897,7 +893,7 @@ Its numeric meaning is what you would get from `(interactive "p")'. */)
}
void
syms_of_callint ()
syms_of_callint (void)
{
point_marker = Fmake_marker ();
staticpro (&point_marker);
......
......@@ -137,8 +137,7 @@ static int call_process_exited;
EXFUN (Fgetenv_internal, 2);
static Lisp_Object
call_process_kill (fdpid)
Lisp_Object fdpid;
call_process_kill (Lisp_Object fdpid)
{
emacs_close (XFASTINT (Fcar (fdpid)));
EMACS_KILLPG (XFASTINT (Fcdr (fdpid)), SIGKILL);
......@@ -147,8 +146,7 @@ call_process_kill (fdpid)
}
Lisp_Object
call_process_cleanup (arg)
Lisp_Object arg;
call_process_cleanup (Lisp_Object arg)
{
Lisp_Object fdpid = Fcdr (arg);
#if defined (MSDOS)
......@@ -848,8 +846,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
}
static Lisp_Object
delete_temp_file (name)
Lisp_Object name;
delete_temp_file (Lisp_Object name)
{
/* Suppress jka-compr handling, etc. */
int count = SPECPDL_INDEX ();
......@@ -997,7 +994,7 @@ usage: (call-process-region START END PROGRAM &optional DELETE BUFFER DISPLAY &r
RETURN_UNGCPRO (unbind_to (count, Fcall_process (nargs, args)));
}
static int relocate_fd ();
static int relocate_fd (int fd, int minfd);
static char **
add_env (char **env, char **new_env, char *string)
......@@ -1052,11 +1049,7 @@ add_env (char **env, char **new_env, char *string)
executable directory by the parent. */
int
child_setup (in, out, err, new_argv, set_pgrp, current_dir)
int in, out, err;
register char **new_argv;
int set_pgrp;
Lisp_Object current_dir;
child_setup (int in, int out, int err, register char **new_argv, int set_pgrp, Lisp_Object current_dir)
{
char **env;
char *pwd_var;
......@@ -1295,8 +1288,7 @@ child_setup (in, out, err, new_argv, set_pgrp, current_dir)
/* Move the file descriptor FD so that its number is not less than MINFD.
If the file descriptor is moved at all, the original is freed. */
static int
relocate_fd (fd, minfd)
int fd, minfd;
relocate_fd (int fd, int minfd)
{
if (fd >= minfd)
return fd;
......@@ -1322,12 +1314,7 @@ relocate_fd (fd, minfd)
}
static int
getenv_internal_1 (var, varlen, value, valuelen, env)
char *var;
int varlen;
char **value;
int *valuelen;
Lisp_Object env;
getenv_internal_1 (char *var, int varlen, char **value, int *valuelen, Lisp_Object env)
{
for (; CONSP (env); env = XCDR (env))
{
......@@ -1361,12 +1348,7 @@ getenv_internal_1 (var, varlen, value, valuelen, env)
}
static int
getenv_internal (var, varlen, value, valuelen, frame)
char *var;
int varlen;
char **value;
int *valuelen;
Lisp_Object frame;
getenv_internal (char *var, int varlen, char **value, int *valuelen, Lisp_Object frame)
{
/* Try to find VAR in Vprocess_environment first. */
if (getenv_internal_1 (var, varlen, value, valuelen,
......@@ -1428,8 +1410,7 @@ If optional parameter ENV is a list, then search this list instead of
/* A version of getenv that consults the Lisp environment lists,
easily callable from C. */
char *
egetenv (var)
char *var;
egetenv (char *var)
{
char *value;
int valuelen;
......@@ -1444,7 +1425,7 @@ egetenv (var)
/* This is run before init_cmdargs. */
void
init_callproc_1 ()
init_callproc_1 (void)
{
char *data_dir = egetenv ("EMACSDATA");
char *doc_dir = egetenv ("EMACSDOC");
......@@ -1466,7 +1447,7 @@ init_callproc_1 ()
/* This is run after init_cmdargs, when Vinstallation_directory is valid. */
void
init_callproc ()
init_callproc (void)
{
char *data_dir = egetenv ("EMACSDATA");
......@@ -1555,7 +1536,7 @@ init_callproc ()
}
void
set_initial_environment ()
set_initial_environment (void)
{
register char **envp;
#ifndef CANNOT_DUMP
......@@ -1575,7 +1556,7 @@ set_initial_environment ()
}
void
syms_of_callproc ()
syms_of_callproc (void)
{
#ifdef DOS_NT
Qbuffer_file_type = intern ("buffer-file-type");
......
......@@ -33,9 +33,7 @@ enum case_action {CASE_UP, CASE_DOWN, CASE_CAPITALIZE, CASE_CAPITALIZE_UP};
Lisp_Object Qidentity;
Lisp_Object
casify_object (flag, obj)
enum case_action flag;
Lisp_Object obj;
casify_object (enum case_action flag, Lisp_Object obj)
{
register int c, c1;
register int inword = flag == CASE_DOWN;
......@@ -200,9 +198,7 @@ The argument object is not altered--the value is a copy. */)
b and e specify range of buffer to operate on. */
void
casify_region (flag, b, e)
enum case_action flag;
Lisp_Object b, e;
casify_region (enum case_action flag, Lisp_Object b, Lisp_Object e)
{
register int c;
register int inword = flag == CASE_DOWN;
......@@ -358,9 +354,7 @@ character positions to operate on. */)
}
static Lisp_Object
operate_on_word (arg, newpoint)
Lisp_Object arg;
EMACS_INT *newpoint;
operate_on_word (Lisp_Object arg, EMACS_INT *newpoint)
{
Lisp_Object val;
int farend;
......@@ -427,7 +421,7 @@ With negative argument, capitalize previous words but do not move. */)
}
void
syms_of_casefiddle ()
syms_of_casefiddle (void)
{
Qidentity = intern_c_string ("identity");
staticpro (&Qidentity);
......@@ -445,7 +439,7 @@ syms_of_casefiddle ()
}
void
keys_of_casefiddle ()
keys_of_casefiddle (void)
{
initial_define_key (control_x_map, Ctl('U'), "upcase-region");
Fput (intern ("upcase-region"), Qdisabled, Qt);
......
......@@ -34,9 +34,9 @@ Lisp_Object Vascii_canon_table, Vascii_eqv_table;
int case_temp1;
Lisp_Object case_temp2;
static void set_canon ();
static void set_identity ();
static void shuffle ();
static void set_canon (Lisp_Object case_table, Lisp_Object range, Lisp_Object elt);
static void set_identity (Lisp_Object table, Lisp_Object c, Lisp_Object elt);
static void shuffle (Lisp_Object table, Lisp_Object c, Lisp_Object elt);
DEFUN ("case-table-p", Fcase_table_p, Scase_table_p, 1, 1, 0,
doc: /* Return t if OBJECT is a case table.
......@@ -63,8 +63,7 @@ See `set-case-table' for more information on these data structures. */)
}
static Lisp_Object
check_case_table (obj)
Lisp_Object obj;
check_case_table (Lisp_Object obj)
{
CHECK_TYPE (!NILP (Fcase_table_p (obj)), Qcase_table_p, obj);
return (obj);
......@@ -85,7 +84,7 @@ This is the one used for new buffers. */)
return Vascii_downcase_table;
}
static Lisp_Object set_case_table ();
static Lisp_Object set_case_table (Lisp_Object table, int standard);
DEFUN ("set-case-table", Fset_case_table, Sset_case_table, 1, 1, 0,
doc: /* Select a new case table for the current buffer.
......@@ -120,9 +119,7 @@ See `set-case-table' for more info on case tables. */)
}
static Lisp_Object
set_case_table (table, standard)
Lisp_Object table;
int standard;
set_case_table (Lisp_Object table, int standard)
{
Lisp_Object up, canon, eqv;
......@@ -184,8 +181,7 @@ set_case_table (table, standard)
CASE_TABLE. */
static void
set_canon (case_table, range, elt)
Lisp_Object case_table, range, elt;
set_canon (Lisp_Object case_table, Lisp_Object range, Lisp_Object elt)
{
Lisp_Object up = XCHAR_TABLE (case_table)->extras[0];
Lisp_Object canon = XCHAR_TABLE (case_table)->extras[1];
......@@ -200,8 +196,7 @@ set_canon (case_table, range, elt)
character. This is called in map_char_table. */
static void
set_identity (table, c, elt)
Lisp_Object table, c, elt;
set_identity (Lisp_Object table, Lisp_Object c, Lisp_Object elt)
{
if (NATNUMP (elt))
{
......@@ -225,8 +220,7 @@ set_identity (table, c, elt)
operated. */
static void
shuffle (table, c, elt)
Lisp_Object table, c, elt;
shuffle (Lisp_Object table, Lisp_Object c, Lisp_Object elt)
{
if (NATNUMP (elt))
{
......@@ -250,7 +244,7 @@ shuffle (table, c, elt)
}
void
init_casetab_once ()
init_casetab_once (void)
{
register int i;
Lisp_Object down, up;
......@@ -296,7 +290,7 @@ init_casetab_once ()
}
void
syms_of_casetab ()
syms_of_casetab (void)
{
Qcase_table_p = intern_c_string ("case-table-p");
staticpro (&Qcase_table_p);
......
......@@ -62,8 +62,7 @@ Lisp_Object _temp_category_set;
static Lisp_Object hash_get_category_set (Lisp_Object, Lisp_Object);
static Lisp_Object
hash_get_category_set (table, category_set)
Lisp_Object table, category_set;
hash_get_category_set (Lisp_Object table, Lisp_Object category_set)
{
Lisp_Object val;
struct Lisp_Hash_Table *h;
......@@ -117,7 +116,7 @@ those categories. */)
/* Category staff. */
Lisp_Object check_category_table ();
Lisp_Object check_category_table (Lisp_Object table);
DEFUN ("define-category", Fdefine_category, Sdefine_category, 2, 3, 0,
doc: /* Define CATEGORY as a category which is described by DOCSTRING.
......@@ -196,8 +195,7 @@ DEFUN ("category-table-p", Fcategory_table_p, Scategory_table_p, 1, 1, 0,
wrong-type-argument. */
Lisp_Object
check_category_table (table)
Lisp_Object table;
check_category_table (Lisp_Object table)
{
if (NILP (table))
return current_buffer->category_table;
......@@ -224,8 +222,7 @@ This is the one used for new buffers. */)
static void
copy_category_entry (table, c, val)
Lisp_Object table, c, val;
copy_category_entry (Lisp_Object table, Lisp_Object c, Lisp_Object val)
{
val = Fcopy_sequence (val);
if (CONSP (c))
......@@ -240,8 +237,7 @@ copy_category_entry (table, c, val)
binding TABLE to a sub char table. */
Lisp_Object
copy_category_table (table)
Lisp_Object table;
copy_category_table (Lisp_Object table)
{
table = copy_char_table (table);
......@@ -304,8 +300,7 @@ Return TABLE. */)
Lisp_Object
char_category_set (c)
int c;
char_category_set (int c)
{
return CHAR_TABLE_REF (current_buffer->category_table, c);
}
......@@ -344,8 +339,7 @@ The return value is a string containing those same categories. */)
}
void
set_category_set (category_set, category, val)
Lisp_Object category_set, category, val;
set_category_set (Lisp_Object category_set, Lisp_Object category, Lisp_Object val)
{
do {
int idx = XINT (category) / 8;
......@@ -420,8 +414,7 @@ then delete CATEGORY from the category set instead of adding it. */)
directly. */
int
word_boundary_p (c1, c2)
int c1, c2;
word_boundary_p (int c1, int c2)
{
Lisp_Object category_set1, category_set2;
Lisp_Object tail;
......@@ -466,7 +459,7 @@ word_boundary_p (c1, c2)
void
init_category_once ()
init_category_once (void)
{
/* This has to be done here, before we call Fmake_char_table. */
Qcategory_table = intern_c_string ("category-table");
......@@ -489,7 +482,7 @@ init_category_once ()
}
void
syms_of_category ()
syms_of_category (void)
{
Qcategoryp = intern_c_string ("categoryp");
staticpro (&Qcategoryp);
......
......@@ -862,11 +862,7 @@ struct ccl_prog_stack
static struct ccl_prog_stack ccl_prog_stack_struct[256];
void
ccl_driver (ccl, source, destination, src_size, dst_size, charset_list)
struct ccl_program *ccl;
int *source, *destination;
int src_size, dst_size;
Lisp_Object charset_list;
ccl_driver (struct ccl_program *ccl, int *source, int *destination, int src_size, int dst_size, Lisp_Object charset_list)
{
register int *reg = ccl->reg;
register int ic = ccl->ic;
......@@ -1795,8 +1791,7 @@ ccl_driver (ccl, source, destination, src_size, dst_size, charset_list)
or nil if CCL contains invalid data. */
static Lisp_Object
resolve_symbol_ccl_program (ccl)
Lisp_Object ccl;
resolve_symbol_ccl_program (Lisp_Object ccl)
{
int i, veclen, unresolved = 0;
Lisp_Object result, contents, val;
......@@ -1867,9 +1862,7 @@ resolve_symbol_ccl_program (ccl)
symbols, return Qnil. */
static Lisp_Object
ccl_get_compiled_code (ccl_prog, idx)
Lisp_Object ccl_prog;
int *idx;
ccl_get_compiled_code (Lisp_Object ccl_prog, int *idx)
{
Lisp_Object val, slot;
......@@ -1910,9 +1903,7 @@ ccl_get_compiled_code (ccl_prog, idx)
If CCL_PROG is nil, we just reset the structure pointed by CCL. */
int
setup_ccl_program (ccl, ccl_prog)
struct ccl_program *ccl;
Lisp_Object ccl_prog;
setup_ccl_program (struct ccl_program *ccl, Lisp_Object ccl_prog)
{
int i;
......@@ -1953,8 +1944,7 @@ setup_ccl_program (ccl, ccl_prog)