]> code.delx.au - gnu-emacs/commitdiff
* image.c (slurp_file, xbm_read_bitmap_data): Cast to the correct
authorDan Nicolaescu <dann@ics.uci.edu>
Fri, 30 Sep 2005 22:38:16 +0000 (22:38 +0000)
committerDan Nicolaescu <dann@ics.uci.edu>
Fri, 30 Sep 2005 22:38:16 +0000 (22:38 +0000)
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.

15 files changed:
src/ChangeLog
src/alloc.c
src/dired.c
src/dispextern.h
src/emacs.c
src/image.c
src/lisp.h
src/process.c
src/regex.c
src/regex.h
src/systime.h
src/term.c
src/unexelf.c
src/xsmfns.c
src/xterm.c

index 13c2c0562ebac40cdb9593ede376bf52fd5513ad..eee90b5a2e703c7e16e36099d504e659af1e35e5 100644 (file)
@@ -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
index 3c9b2199e5239e2eb1348316a3c6fb8db67309be..ccf4afff9f89c48088f9dbce83692400002abb02 100644 (file)
@@ -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;
 
index 927276e15c08fe77bb3fa4483a3e7dfebf2eaedd..1f20ef8d10a5d97ef2155765c0a0c9c427b40963 100644 (file)
@@ -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"
index d6537bcd67a3c85b1931bf4e99c100f815ddb922..2fa33e87ebb3aba397993a11905248c22a572166 100644 (file)
@@ -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));
 
index bcba251f8c7c8d23bab4a87f7950efac6ba00757..80281d4f26ba7cd32de14aea5cea528be434f83f 100644 (file)
@@ -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
index bdc78c2d718fbeace889c8b41c49d3be0c28f6aa..3b6969b0c282f92bc360ddf768bd517c0574b483 100644 (file)
@@ -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)
     {
index 3ca6355484041d797e59659924a1f6c087fda112..57372cfd64f8b9cce1f3c5c52cb7cdb599d59a6f 100644 (file)
@@ -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 */
index 3b01f9fd3e63d1d0680e70038268c13381461bd4..45aeb3f6f3552b8cb96d263379837e802e0d004c 100644 (file)
@@ -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"
index fd18864110b9cb412d7fb92a5dba14abca44baa7..c765f4bd16b21e8540b155d7fccfef3843a3564c 100644 (file)
@@ -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
index 557700dc93df9db86da57fbe4eb61618df888bd9..45a9f6fff0d4335cedcfe552ed598fd132543ae7 100644 (file)
@@ -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 */
index 1d0022e93d7562bca01fca6c8f0971b87740a4b3..9851db4cf333ef8768e21e26cf425f47f3c16851 100644 (file)
@@ -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.  */
 
index 2b4ea7e23a4d53da96a133d96a53ff0b36a9446e..21333826b3c1ce2163f613a19474e7d87a8f78bf 100644 (file)
@@ -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);
 }
index ee563b36a9701e3ae86db59b98b33cc646348db2..e33a9a1aeb3534cbbe3c078e68d7a22c593ebeb7 100644 (file)
@@ -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>
index 0215d56254804a50b3b0060144f0a6b9fab27235..e7f3e6fa3e5c2ca62d019c4d1c38026188f2142e 100644 (file)
@@ -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"
index 5bd38550f679d0e4f3b393ed8cdfbf90e4bbcef6..1234694de4af9e06d6604bab2e70cc1f03454258 100644 (file)
@@ -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,