Commit d2aa42f8 authored by Dan Nicolaescu's avatar Dan Nicolaescu

Convert function definitions and declarations to standard C.

* src/vm-limit.c (memory_warnings):
* src/keyboard.c (modify_event_symbol):
* src/floatfns.c (rounding_driver, ceiling2, floor2, truncate2)
(round2, emacs_rint):
* src/process.c (send_process, old_sigpipe): Convert function
definitions and declarations to standard C.
parent d3da34e0
2010-07-05 Dan Nicolaescu <dann@ics.uci.edu> 2010-07-05 Dan Nicolaescu <dann@ics.uci.edu>
Juanma Barranquero <lekktu@gmail.com>
* vm-limit.c (memory_warnings):
* keyboard.c (modify_event_symbol):
* floatfns.c (rounding_driver, ceiling2, floor2, truncate2)
(round2, emacs_rint):
* process.c (send_process, old_sigpipe): Convert function
definitions and declarations to standard C.
2010-07-05 Juanma Barranquero <lekktu@gmail.com>
* buffer.c, cm.c, eval.c, keyboard.c, process.c, term.c, vm-limit.c, * buffer.c, cm.c, eval.c, keyboard.c, process.c, term.c, vm-limit.c,
* xdisp.c: Convert function definitions to standard C. * xdisp.c: Convert function definitions to standard C.
......
...@@ -70,7 +70,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ ...@@ -70,7 +70,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* This declaration is omitted on some systems, like Ultrix. */ /* This declaration is omitted on some systems, like Ultrix. */
#if !defined (HPUX) && defined (HAVE_LOGB) && !defined (logb) #if !defined (HPUX) && defined (HAVE_LOGB) && !defined (logb)
extern double logb (); extern double logb (double);
#endif /* not HPUX and HAVE_LOGB and no logb macro */ #endif /* not HPUX and HAVE_LOGB and no logb macro */
#if defined(DOMAIN) && defined(SING) && defined(OVERFLOW) #if defined(DOMAIN) && defined(SING) && defined(OVERFLOW)
...@@ -778,11 +778,10 @@ This is the same as the exponent of a float. */) ...@@ -778,11 +778,10 @@ This is the same as the exponent of a float. */)
/* the rounding functions */ /* the rounding functions */
static Lisp_Object static Lisp_Object
rounding_driver (arg, divisor, double_round, int_round2, name) rounding_driver (Lisp_Object arg, Lisp_Object divisor,
register Lisp_Object arg, divisor; double (*double_round) (double),
double (*double_round) (); EMACS_INT (*int_round2) (EMACS_INT, EMACS_INT),
EMACS_INT (*int_round2) (); char *name)
char *name;
{ {
CHECK_NUMBER_OR_FLOAT (arg); CHECK_NUMBER_OR_FLOAT (arg);
...@@ -832,8 +831,7 @@ rounding_driver (arg, divisor, double_round, int_round2, name) ...@@ -832,8 +831,7 @@ rounding_driver (arg, divisor, double_round, int_round2, name)
integer functions. */ integer functions. */
static EMACS_INT static EMACS_INT
ceiling2 (i1, i2) ceiling2 (EMACS_INT i1, EMACS_INT i2)
EMACS_INT i1, i2;
{ {
return (i2 < 0 return (i2 < 0
? (i1 < 0 ? ((-1 - i1) / -i2) + 1 : - (i1 / -i2)) ? (i1 < 0 ? ((-1 - i1) / -i2) + 1 : - (i1 / -i2))
...@@ -841,8 +839,7 @@ ceiling2 (i1, i2) ...@@ -841,8 +839,7 @@ ceiling2 (i1, i2)
} }
static EMACS_INT static EMACS_INT
floor2 (i1, i2) floor2 (EMACS_INT i1, EMACS_INT i2)
EMACS_INT i1, i2;
{ {
return (i2 < 0 return (i2 < 0
? (i1 <= 0 ? -i1 / -i2 : -1 - ((i1 - 1) / -i2)) ? (i1 <= 0 ? -i1 / -i2 : -1 - ((i1 - 1) / -i2))
...@@ -850,8 +847,7 @@ floor2 (i1, i2) ...@@ -850,8 +847,7 @@ floor2 (i1, i2)
} }
static EMACS_INT static EMACS_INT
truncate2 (i1, i2) truncate2 (EMACS_INT i1, EMACS_INT i2)
EMACS_INT i1, i2;
{ {
return (i2 < 0 return (i2 < 0
? (i1 < 0 ? -i1 / -i2 : - (i1 / -i2)) ? (i1 < 0 ? -i1 / -i2 : - (i1 / -i2))
...@@ -859,8 +855,7 @@ truncate2 (i1, i2) ...@@ -859,8 +855,7 @@ truncate2 (i1, i2)
} }
static EMACS_INT static EMACS_INT
round2 (i1, i2) round2 (EMACS_INT i1, EMACS_INT i2)
EMACS_INT i1, i2;
{ {
/* The C language's division operator gives us one remainder R, but /* The C language's division operator gives us one remainder R, but
we want the remainder R1 on the other side of 0 if R1 is closer we want the remainder R1 on the other side of 0 if R1 is closer
...@@ -880,16 +875,14 @@ round2 (i1, i2) ...@@ -880,16 +875,14 @@ round2 (i1, i2)
#define emacs_rint rint #define emacs_rint rint
#else #else
static double static double
emacs_rint (d) emacs_rint (double d)
double d;
{ {
return floor (d + 0.5); return floor (d + 0.5);
} }
#endif #endif
static double static double
double_identity (d) double_identity (double d)
double d;
{ {
return d; return d;
} }
......
...@@ -528,8 +528,6 @@ EMACS_TIME timer_check (int do_it_now); ...@@ -528,8 +528,6 @@ EMACS_TIME timer_check (int do_it_now);
extern Lisp_Object Vhistory_length, Vtranslation_table_for_input; extern Lisp_Object Vhistory_length, Vtranslation_table_for_input;
extern char *x_get_keysym_name ();
static void record_menu_key (Lisp_Object c); static void record_menu_key (Lisp_Object c);
static int echo_length (void); static int echo_length (void);
...@@ -611,7 +609,7 @@ Lisp_Object Venable_disabled_menus_and_buttons; ...@@ -611,7 +609,7 @@ Lisp_Object Venable_disabled_menus_and_buttons;
#define READABLE_EVENTS_IGNORE_SQUEEZABLES (1 << 2) #define READABLE_EVENTS_IGNORE_SQUEEZABLES (1 << 2)
/* Function for init_keyboard to call with no args (if nonzero). */ /* Function for init_keyboard to call with no args (if nonzero). */
void (*keyboard_init_hook) (); void (*keyboard_init_hook) (void);
static int read_avail_input (int); static int read_avail_input (int);
static void get_input_pending (int *, int); static void get_input_pending (int *, int);
...@@ -6583,6 +6581,7 @@ modify_event_symbol (int symbol_num, unsigned int modifiers, Lisp_Object symbol_ ...@@ -6583,6 +6581,7 @@ modify_event_symbol (int symbol_num, unsigned int modifiers, Lisp_Object symbol_
#ifdef HAVE_WINDOW_SYSTEM #ifdef HAVE_WINDOW_SYSTEM
if (NILP (value)) if (NILP (value))
{ {
extern char *x_get_keysym_name (KeySym keysym);
char *name = x_get_keysym_name (symbol_num); char *name = x_get_keysym_name (symbol_num);
if (name) if (name)
value = intern (name); value = intern (name);
......
...@@ -182,7 +182,7 @@ Lisp_Object Quser, Qgroup, Qetime, Qpcpu, Qpmem, Qtime, Qctime; ...@@ -182,7 +182,7 @@ Lisp_Object Quser, Qgroup, Qetime, Qpcpu, Qpmem, Qtime, Qctime;
#include "syswait.h" #include "syswait.h"
extern char *get_operating_system_release (); extern char *get_operating_system_release (void);
/* Serial processes require termios or Windows. */ /* Serial processes require termios or Windows. */
#if defined (HAVE_TERMIOS) || defined (WINDOWSNT) #if defined (HAVE_TERMIOS) || defined (WINDOWSNT)
...@@ -5606,7 +5606,7 @@ send_process (volatile Lisp_Object proc, unsigned char *volatile buf, ...@@ -5606,7 +5606,7 @@ send_process (volatile Lisp_Object proc, unsigned char *volatile buf,
int rv; int rv;
struct coding_system *coding; struct coding_system *coding;
struct gcpro gcpro1; struct gcpro gcpro1;
SIGTYPE (*volatile old_sigpipe) (); SIGTYPE (*volatile old_sigpipe) (int);
GCPRO1 (object); GCPRO1 (object);
...@@ -5719,7 +5719,7 @@ send_process (volatile Lisp_Object proc, unsigned char *volatile buf, ...@@ -5719,7 +5719,7 @@ send_process (volatile Lisp_Object proc, unsigned char *volatile buf,
while (this > 0) while (this > 0)
{ {
int outfd = p->outfd; int outfd = p->outfd;
old_sigpipe = (SIGTYPE (*) ()) signal (SIGPIPE, send_process_trap); old_sigpipe = (SIGTYPE (*) (int)) signal (SIGPIPE, send_process_trap);
#ifdef DATAGRAM_SOCKETS #ifdef DATAGRAM_SOCKETS
if (DATAGRAM_CHAN_P (outfd)) if (DATAGRAM_CHAN_P (outfd))
{ {
......
...@@ -251,7 +251,7 @@ check_memory_limits (void) ...@@ -251,7 +251,7 @@ check_memory_limits (void)
void void
memory_warnings (POINTER start, void (*warnfun) (char *)) memory_warnings (POINTER start, void (*warnfun) (char *))
{ {
extern void (* __after_morecore_hook) (); /* From gmalloc.c */ extern void (* __after_morecore_hook) (void); /* From gmalloc.c */
if (start) if (start)
data_space_start = start; data_space_start = start;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment