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 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
#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;
/* 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;
/* 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;
#include <grp.h>
#endif
-#include "systime.h"
#include <errno.h>
#ifdef VMS
#endif
#include "lisp.h"
+#include "systime.h"
#include "buffer.h"
#include "commands.h"
#include "charset.h"
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));
/* 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;
&& !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
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;
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)
{
/* 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 */
#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"
#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
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 */
/* 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. */
#include <stdio.h>
#include <ctype.h>
#include <string.h>
+#include <stdarg.h>
#include "termchar.h"
#include "termopts.h"
/* 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);
}
#include <string.h>
#else
#include <config.h>
-extern void fatal (char *, ...);
+extern void fatal (const char *msgid, ...);
#endif
#include <sys/types.h>
#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"
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,
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,