summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Nicolaescu <dann@ics.uci.edu>2005-09-30 22:38:16 +0000
committerDan Nicolaescu <dann@ics.uci.edu>2005-09-30 22:38:16 +0000
commitfa8459a34e076cacde3b7c259af9b5dd84b60802 (patch)
treeb3d68a9fe6cdfe631bcecb42b30b087aa566e942
parentb17f937955a92bd8416821ec847d859bc9c3de85 (diff)
downloademacs-fa8459a34e076cacde3b7c259af9b5dd84b60802.tar.gz
* image.c (slurp_file, xbm_read_bitmap_data): Cast to the correct
type. * xterm.c (handle_one_xevent, handle_one_xevent): Likewise. * unexelf.c (fatal): Fix prototype. * term.c (fatal): Implement using varargs. * regex.c (re_char): Move typedef ... * regex.h (re_char): ... here. (re_iswctype, re_wctype, re_set_whitespace_regexp): New prototypes. * emacs.c (malloc_set_state): Fix return type. (endif): Fix type. * lisp.h (fatal): Add argument types. * dispextern.h (fatal): Delete prototype. * systime.h: (make_time): Prototype moved from ... * editfns.c (make_time): ... here. * editfns.c: Move systime.h include after lisp.h. * dired.c: * xsmfns.c: * process.c: Likewise. * alloc.c (old_malloc_hook, old_realloc_hook, old_realloc_hook): Add parameter types. (__malloc_hook, __realloc_hook, __free_hook): Fix prototypes. (emacs_blocked_free): Change definition to match __free_hook. (emacs_blocked_malloc): Change definition to match __malloc_hook. (emacs_blocked_realloc): Change definition to match __realloc_hook.
-rw-r--r--src/ChangeLog38
-rw-r--r--src/alloc.c21
-rw-r--r--src/dired.c2
-rw-r--r--src/dispextern.h1
-rw-r--r--src/emacs.c4
-rw-r--r--src/image.c4
-rw-r--r--src/lisp.h2
-rw-r--r--src/process.c2
-rw-r--r--src/regex.c3
-rw-r--r--src/regex.h8
-rw-r--r--src/systime.h8
-rw-r--r--src/term.c10
-rw-r--r--src/unexelf.c2
-rw-r--r--src/xsmfns.c2
-rw-r--r--src/xterm.c4
15 files changed, 83 insertions, 28 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 13c2c0562eb..eee90b5a2e7 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,41 @@
+2005-09-30 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * image.c (slurp_file, xbm_read_bitmap_data): Cast to the correct
+ type.
+ * xterm.c (handle_one_xevent, handle_one_xevent): Likewise.
+
+ * unexelf.c (fatal): Fix prototype.
+
+ * term.c (fatal): Implement using varargs.
+
+ * regex.c (re_char): Move typedef ...
+ * regex.h (re_char): ... here.
+ (re_iswctype, re_wctype, re_set_whitespace_regexp): New
+ prototypes.
+
+ * emacs.c (malloc_set_state): Fix return type.
+ (endif): Fix type.
+
+ * lisp.h (fatal): Add argument types.
+
+ * dispextern.h (fatal): Delete prototype.
+
+ * systime.h: (make_time): Prototype moved from ...
+ * editfns.c (make_time): ... here.
+
+ * editfns.c: Move systime.h include after lisp.h.
+ * dired.c:
+ * xsmfns.c:
+ * process.c: Likewise.
+
+ * alloc.c (old_malloc_hook, old_realloc_hook, old_realloc_hook):
+ Add parameter types.
+ (__malloc_hook, __realloc_hook, __free_hook): Fix prototypes.
+ (emacs_blocked_free): Change definition to match __free_hook.
+ (emacs_blocked_malloc): Change definition to match __malloc_hook.
+ (emacs_blocked_realloc): Change definition to match
+ __realloc_hook.
+
2005-09-30 Romain Francoise <romain@orebokech.com>
* minibuf.c (Fread_buffer): Follow convention for reading from the
diff --git a/src/alloc.c b/src/alloc.c
index 3c9b2199e52..ccf4afff9f8 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -1161,20 +1161,21 @@ refill_memory_reserve ()
#ifndef SYNC_INPUT
#ifndef DOUG_LEA_MALLOC
-extern void * (*__malloc_hook) P_ ((size_t));
-extern void * (*__realloc_hook) P_ ((void *, size_t));
-extern void (*__free_hook) P_ ((void *));
+extern void * (*__malloc_hook) P_ ((size_t, const void *));
+extern void * (*__realloc_hook) P_ ((void *, size_t, const void *));
+extern void (*__free_hook) P_ ((void *, const void *));
/* Else declared in malloc.h, perhaps with an extra arg. */
#endif /* DOUG_LEA_MALLOC */
-static void * (*old_malloc_hook) ();
-static void * (*old_realloc_hook) ();
-static void (*old_free_hook) ();
+static void * (*old_malloc_hook) P_ ((size_t, const void *));
+static void * (*old_realloc_hook) P_ ((void *, size_t, const void*));
+static void (*old_free_hook) P_ ((void*, const void*));
/* This function is used as the hook for free to call. */
static void
-emacs_blocked_free (ptr)
+emacs_blocked_free (ptr, ptr2)
void *ptr;
+ const void *ptr2;
{
BLOCK_INPUT_ALLOC;
@@ -1221,8 +1222,9 @@ emacs_blocked_free (ptr)
/* This function is the malloc hook that Emacs uses. */
static void *
-emacs_blocked_malloc (size)
+emacs_blocked_malloc (size, ptr)
size_t size;
+ const void *ptr;
{
void *value;
@@ -1268,9 +1270,10 @@ emacs_blocked_malloc (size)
/* This function is the realloc hook that Emacs uses. */
static void *
-emacs_blocked_realloc (ptr, size)
+emacs_blocked_realloc (ptr, size, ptr2)
void *ptr;
size_t size;
+ const void *ptr2;
{
void *value;
diff --git a/src/dired.c b/src/dired.c
index 927276e15c0..1f20ef8d10a 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -33,7 +33,6 @@ Boston, MA 02110-1301, USA. */
#include <grp.h>
#endif
-#include "systime.h"
#include <errno.h>
#ifdef VMS
@@ -93,6 +92,7 @@ extern struct direct *readdir ();
#endif
#include "lisp.h"
+#include "systime.h"
#include "buffer.h"
#include "commands.h"
#include "charset.h"
diff --git a/src/dispextern.h b/src/dispextern.h
index d6537bcd67a..2fa33e87ebb 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -2940,7 +2940,6 @@ extern void calculate_costs P_ ((struct frame *));
extern void set_tty_color_mode P_ ((struct frame *, Lisp_Object));
extern void tty_setup_colors P_ ((int));
extern void term_init P_ ((char *));
-extern void fatal P_ ((/* char *, ... */));
void cursor_to P_ ((int, int));
extern int tty_capable_p P_ ((struct frame *, unsigned, unsigned long, unsigned long));
diff --git a/src/emacs.c b/src/emacs.c
index bcba251f8c7..80281d4f26b 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -148,7 +148,7 @@ void *malloc_state_ptr;
/* From glibc, a routine that returns a copy of the malloc internal state. */
extern void *malloc_get_state ();
/* From glibc, a routine that overwrites the malloc internal state. */
-extern void malloc_set_state ();
+extern int malloc_set_state ();
/* Non-zero if the MALLOC_CHECK_ enviroment variable was set while
dumping. Used to work around a bug in glibc's malloc. */
int malloc_using_checking;
@@ -1001,7 +1001,7 @@ main (argc, argv
&& !getrlimit (RLIMIT_STACK, &rlim))
{
long newlim;
- extern int re_max_failures;
+ extern size_t re_max_failures;
/* Approximate the amount regex.c needs per unit of re_max_failures. */
int ratio = 20 * sizeof (char *);
/* Then add 33% to cover the size of the smaller stacks that regex.c
diff --git a/src/image.c b/src/image.c
index bdc78c2d718..3b6969b0c28 100644
--- a/src/image.c
+++ b/src/image.c
@@ -2178,7 +2178,7 @@ slurp_file (file, size)
if (stat (file, &st) == 0
&& (fp = fopen (file, "rb")) != NULL
- && (buf = (char *) xmalloc (st.st_size),
+ && (buf = (unsigned char *) xmalloc (st.st_size),
fread (buf, 1, st.st_size, fp) == st.st_size))
{
*size = st.st_size;
@@ -3029,7 +3029,7 @@ xbm_read_bitmap_data (contents, end, width, height, data)
bytes_per_line = (*width + 7) / 8 + padding_p;
nbytes = bytes_per_line * *height;
- p = *data = (char *) xmalloc (nbytes);
+ p = *data = (unsigned char *) xmalloc (nbytes);
if (v10)
{
diff --git a/src/lisp.h b/src/lisp.h
index 3ca63554840..57372cfd64f 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -3158,7 +3158,7 @@ extern void syms_of_dired P_ ((void));
/* Defined in term.c */
extern void syms_of_term P_ ((void));
-extern void fatal () NO_RETURN;
+extern void fatal P_ ((const char *msgid, ...)) NO_RETURN;
#ifdef HAVE_X_WINDOWS
/* Defined in fontset.c */
diff --git a/src/process.c b/src/process.c
index 3b01f9fd3e6..45aeb3f6f35 100644
--- a/src/process.c
+++ b/src/process.c
@@ -118,10 +118,10 @@ Boston, MA 02110-1301, USA. */
#include <sys/wait.h>
#endif
+#include "lisp.h"
#include "systime.h"
#include "systty.h"
-#include "lisp.h"
#include "window.h"
#include "buffer.h"
#include "charset.h"
diff --git a/src/regex.c b/src/regex.c
index fd18864110b..c765f4bd16b 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -524,9 +524,6 @@ init_syntax_once ()
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
-/* Type of source-pattern and string chars. */
-typedef const unsigned char re_char;
-
typedef char boolean;
#define false 0
#define true 1
diff --git a/src/regex.h b/src/regex.h
index 557700dc93d..45a9f6fff0d 100644
--- a/src/regex.h
+++ b/src/regex.h
@@ -603,8 +603,16 @@ typedef enum { RECC_ERROR = 0,
RECC_ASCII, RECC_UNIBYTE
} re_wctype_t;
+extern char re_iswctype (int ch, re_wctype_t cc);
+extern re_wctype_t re_wctype (const unsigned char* str);
+
typedef int re_wchar_t;
+/* Type of source-pattern and string chars. */
+typedef const unsigned char re_char;
+
+extern void re_set_whitespace_regexp (re_char *regexp);
+
#endif /* not WIDE_CHAR_SUPPORT */
#endif /* regex.h */
diff --git a/src/systime.h b/src/systime.h
index 1d0022e93d7..9851db4cf33 100644
--- a/src/systime.h
+++ b/src/systime.h
@@ -157,6 +157,14 @@ extern int set_file_times __P ((const char *, EMACS_TIME, EMACS_TIME));
/* defined in keyboard.c */
extern void set_waiting_for_input __P ((EMACS_TIME *));
+/* When lisp.h is not included Lisp_Object is not defined (this can
+ happen when this files is used outside the src directory).
+ Use GCPRO1 to determine if lisp.h was included. */
+#ifdef GCPRO1
+/* defined in dired.c */
+extern Lisp_Object make_time __P ((time_t));
+#endif
+
/* Compare times T1 and T2. Value is 0 if T1 and T2 are the same.
Value is < 0 if T1 is less than T2. Value is > 0 otherwise. */
diff --git a/src/term.c b/src/term.c
index 2b4ea7e23a4..21333826b3c 100644
--- a/src/term.c
+++ b/src/term.c
@@ -25,6 +25,7 @@ Boston, MA 02110-1301, USA. */
#include <stdio.h>
#include <ctype.h>
#include <string.h>
+#include <stdarg.h>
#include "termchar.h"
#include "termopts.h"
@@ -2689,12 +2690,13 @@ to do `unset TERMCAP' (C-shell: `unsetenv TERMCAP') as well.",
/* VARARGS 1 */
void
-fatal (str, arg1, arg2)
- char *str, *arg1, *arg2;
+fatal (const char *str, ...)
{
+ va_list ap;
+ va_start (ap, str);
fprintf (stderr, "emacs: ");
- fprintf (stderr, str, arg1, arg2);
- fprintf (stderr, "\n");
+ vfprintf (stderr, str, ap);
+ va_end (ap);
fflush (stderr);
exit (1);
}
diff --git a/src/unexelf.c b/src/unexelf.c
index ee563b36a97..e33a9a1aeb3 100644
--- a/src/unexelf.c
+++ b/src/unexelf.c
@@ -412,7 +412,7 @@ temacs:
#include <string.h>
#else
#include <config.h>
-extern void fatal (char *, ...);
+extern void fatal (const char *msgid, ...);
#endif
#include <sys/types.h>
diff --git a/src/xsmfns.c b/src/xsmfns.c
index 0215d562548..e7f3e6fa3e5 100644
--- a/src/xsmfns.c
+++ b/src/xsmfns.c
@@ -45,9 +45,9 @@ Boston, MA 02110-1301, USA. */
#include <sys/param.h>
#include <stdio.h>
+#include "lisp.h"
#include "systime.h"
#include "sysselect.h"
-#include "lisp.h"
#include "termhooks.h"
#include "termopts.h"
#include "xterm.h"
diff --git a/src/xterm.c b/src/xterm.c
index 5bd38550f67..1234694de4a 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -6231,7 +6231,7 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
if (status_return == XBufferOverflow)
{
copy_bufsiz = nbytes + 1;
- copy_bufptr = (char *) alloca (copy_bufsiz);
+ copy_bufptr = (unsigned char *) alloca (copy_bufsiz);
nbytes = XmbLookupString (FRAME_XIC (f),
&event.xkey, copy_bufptr,
copy_bufsiz, &keysym,
@@ -6249,7 +6249,7 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
if (status_return == XBufferOverflow)
{
copy_bufsiz = nbytes + 1;
- copy_bufptr = (char *) alloca (copy_bufsiz);
+ copy_bufptr = (unsigned char *) alloca (copy_bufsiz);
nbytes = Xutf8LookupString (FRAME_XIC (f),
&event.xkey,
copy_bufptr,