aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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 @@
12005-09-30 Dan Nicolaescu <dann@ics.uci.edu>
2
3 * image.c (slurp_file, xbm_read_bitmap_data): Cast to the correct
4 type.
5 * xterm.c (handle_one_xevent, handle_one_xevent): Likewise.
6
7 * unexelf.c (fatal): Fix prototype.
8
9 * term.c (fatal): Implement using varargs.
10
11 * regex.c (re_char): Move typedef ...
12 * regex.h (re_char): ... here.
13 (re_iswctype, re_wctype, re_set_whitespace_regexp): New
14 prototypes.
15
16 * emacs.c (malloc_set_state): Fix return type.
17 (endif): Fix type.
18
19 * lisp.h (fatal): Add argument types.
20
21 * dispextern.h (fatal): Delete prototype.
22
23 * systime.h: (make_time): Prototype moved from ...
24 * editfns.c (make_time): ... here.
25
26 * editfns.c: Move systime.h include after lisp.h.
27 * dired.c:
28 * xsmfns.c:
29 * process.c: Likewise.
30
31 * alloc.c (old_malloc_hook, old_realloc_hook, old_realloc_hook):
32 Add parameter types.
33 (__malloc_hook, __realloc_hook, __free_hook): Fix prototypes.
34 (emacs_blocked_free): Change definition to match __free_hook.
35 (emacs_blocked_malloc): Change definition to match __malloc_hook.
36 (emacs_blocked_realloc): Change definition to match
37 __realloc_hook.
38
12005-09-30 Romain Francoise <romain@orebokech.com> 392005-09-30 Romain Francoise <romain@orebokech.com>
2 40
3 * minibuf.c (Fread_buffer): Follow convention for reading from the 41 * 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 ()
1161#ifndef SYNC_INPUT 1161#ifndef SYNC_INPUT
1162 1162
1163#ifndef DOUG_LEA_MALLOC 1163#ifndef DOUG_LEA_MALLOC
1164extern void * (*__malloc_hook) P_ ((size_t)); 1164extern void * (*__malloc_hook) P_ ((size_t, const void *));
1165extern void * (*__realloc_hook) P_ ((void *, size_t)); 1165extern void * (*__realloc_hook) P_ ((void *, size_t, const void *));
1166extern void (*__free_hook) P_ ((void *)); 1166extern void (*__free_hook) P_ ((void *, const void *));
1167/* Else declared in malloc.h, perhaps with an extra arg. */ 1167/* Else declared in malloc.h, perhaps with an extra arg. */
1168#endif /* DOUG_LEA_MALLOC */ 1168#endif /* DOUG_LEA_MALLOC */
1169static void * (*old_malloc_hook) (); 1169static void * (*old_malloc_hook) P_ ((size_t, const void *));
1170static void * (*old_realloc_hook) (); 1170static void * (*old_realloc_hook) P_ ((void *, size_t, const void*));
1171static void (*old_free_hook) (); 1171static void (*old_free_hook) P_ ((void*, const void*));
1172 1172
1173/* This function is used as the hook for free to call. */ 1173/* This function is used as the hook for free to call. */
1174 1174
1175static void 1175static void
1176emacs_blocked_free (ptr) 1176emacs_blocked_free (ptr, ptr2)
1177 void *ptr; 1177 void *ptr;
1178 const void *ptr2;
1178{ 1179{
1179 BLOCK_INPUT_ALLOC; 1180 BLOCK_INPUT_ALLOC;
1180 1181
@@ -1221,8 +1222,9 @@ emacs_blocked_free (ptr)
1221/* This function is the malloc hook that Emacs uses. */ 1222/* This function is the malloc hook that Emacs uses. */
1222 1223
1223static void * 1224static void *
1224emacs_blocked_malloc (size) 1225emacs_blocked_malloc (size, ptr)
1225 size_t size; 1226 size_t size;
1227 const void *ptr;
1226{ 1228{
1227 void *value; 1229 void *value;
1228 1230
@@ -1268,9 +1270,10 @@ emacs_blocked_malloc (size)
1268/* This function is the realloc hook that Emacs uses. */ 1270/* This function is the realloc hook that Emacs uses. */
1269 1271
1270static void * 1272static void *
1271emacs_blocked_realloc (ptr, size) 1273emacs_blocked_realloc (ptr, size, ptr2)
1272 void *ptr; 1274 void *ptr;
1273 size_t size; 1275 size_t size;
1276 const void *ptr2;
1274{ 1277{
1275 void *value; 1278 void *value;
1276 1279
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. */
33#include <grp.h> 33#include <grp.h>
34#endif 34#endif
35 35
36#include "systime.h"
37#include <errno.h> 36#include <errno.h>
38 37
39#ifdef VMS 38#ifdef VMS
@@ -93,6 +92,7 @@ extern struct direct *readdir ();
93#endif 92#endif
94 93
95#include "lisp.h" 94#include "lisp.h"
95#include "systime.h"
96#include "buffer.h" 96#include "buffer.h"
97#include "commands.h" 97#include "commands.h"
98#include "charset.h" 98#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 *));
2940extern void set_tty_color_mode P_ ((struct frame *, Lisp_Object)); 2940extern void set_tty_color_mode P_ ((struct frame *, Lisp_Object));
2941extern void tty_setup_colors P_ ((int)); 2941extern void tty_setup_colors P_ ((int));
2942extern void term_init P_ ((char *)); 2942extern void term_init P_ ((char *));
2943extern void fatal P_ ((/* char *, ... */));
2944void cursor_to P_ ((int, int)); 2943void cursor_to P_ ((int, int));
2945extern int tty_capable_p P_ ((struct frame *, unsigned, unsigned long, unsigned long)); 2944extern int tty_capable_p P_ ((struct frame *, unsigned, unsigned long, unsigned long));
2946 2945
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;
148/* From glibc, a routine that returns a copy of the malloc internal state. */ 148/* From glibc, a routine that returns a copy of the malloc internal state. */
149extern void *malloc_get_state (); 149extern void *malloc_get_state ();
150/* From glibc, a routine that overwrites the malloc internal state. */ 150/* From glibc, a routine that overwrites the malloc internal state. */
151extern void malloc_set_state (); 151extern int malloc_set_state ();
152/* Non-zero if the MALLOC_CHECK_ enviroment variable was set while 152/* Non-zero if the MALLOC_CHECK_ enviroment variable was set while
153 dumping. Used to work around a bug in glibc's malloc. */ 153 dumping. Used to work around a bug in glibc's malloc. */
154int malloc_using_checking; 154int malloc_using_checking;
@@ -1001,7 +1001,7 @@ main (argc, argv
1001 && !getrlimit (RLIMIT_STACK, &rlim)) 1001 && !getrlimit (RLIMIT_STACK, &rlim))
1002 { 1002 {
1003 long newlim; 1003 long newlim;
1004 extern int re_max_failures; 1004 extern size_t re_max_failures;
1005 /* Approximate the amount regex.c needs per unit of re_max_failures. */ 1005 /* Approximate the amount regex.c needs per unit of re_max_failures. */
1006 int ratio = 20 * sizeof (char *); 1006 int ratio = 20 * sizeof (char *);
1007 /* Then add 33% to cover the size of the smaller stacks that regex.c 1007 /* 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)
2178 2178
2179 if (stat (file, &st) == 0 2179 if (stat (file, &st) == 0
2180 && (fp = fopen (file, "rb")) != NULL 2180 && (fp = fopen (file, "rb")) != NULL
2181 && (buf = (char *) xmalloc (st.st_size), 2181 && (buf = (unsigned char *) xmalloc (st.st_size),
2182 fread (buf, 1, st.st_size, fp) == st.st_size)) 2182 fread (buf, 1, st.st_size, fp) == st.st_size))
2183 { 2183 {
2184 *size = st.st_size; 2184 *size = st.st_size;
@@ -3029,7 +3029,7 @@ xbm_read_bitmap_data (contents, end, width, height, data)
3029 3029
3030 bytes_per_line = (*width + 7) / 8 + padding_p; 3030 bytes_per_line = (*width + 7) / 8 + padding_p;
3031 nbytes = bytes_per_line * *height; 3031 nbytes = bytes_per_line * *height;
3032 p = *data = (char *) xmalloc (nbytes); 3032 p = *data = (unsigned char *) xmalloc (nbytes);
3033 3033
3034 if (v10) 3034 if (v10)
3035 { 3035 {
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));
3158 3158
3159/* Defined in term.c */ 3159/* Defined in term.c */
3160extern void syms_of_term P_ ((void)); 3160extern void syms_of_term P_ ((void));
3161extern void fatal () NO_RETURN; 3161extern void fatal P_ ((const char *msgid, ...)) NO_RETURN;
3162 3162
3163#ifdef HAVE_X_WINDOWS 3163#ifdef HAVE_X_WINDOWS
3164/* Defined in fontset.c */ 3164/* 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. */
118#include <sys/wait.h> 118#include <sys/wait.h>
119#endif 119#endif
120 120
121#include "lisp.h"
121#include "systime.h" 122#include "systime.h"
122#include "systty.h" 123#include "systty.h"
123 124
124#include "lisp.h"
125#include "window.h" 125#include "window.h"
126#include "buffer.h" 126#include "buffer.h"
127#include "charset.h" 127#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 ()
524#define MAX(a, b) ((a) > (b) ? (a) : (b)) 524#define MAX(a, b) ((a) > (b) ? (a) : (b))
525#define MIN(a, b) ((a) < (b) ? (a) : (b)) 525#define MIN(a, b) ((a) < (b) ? (a) : (b))
526 526
527/* Type of source-pattern and string chars. */
528typedef const unsigned char re_char;
529
530typedef char boolean; 527typedef char boolean;
531#define false 0 528#define false 0
532#define true 1 529#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,
603 RECC_ASCII, RECC_UNIBYTE 603 RECC_ASCII, RECC_UNIBYTE
604} re_wctype_t; 604} re_wctype_t;
605 605
606extern char re_iswctype (int ch, re_wctype_t cc);
607extern re_wctype_t re_wctype (const unsigned char* str);
608
606typedef int re_wchar_t; 609typedef int re_wchar_t;
607 610
611/* Type of source-pattern and string chars. */
612typedef const unsigned char re_char;
613
614extern void re_set_whitespace_regexp (re_char *regexp);
615
608#endif /* not WIDE_CHAR_SUPPORT */ 616#endif /* not WIDE_CHAR_SUPPORT */
609 617
610#endif /* regex.h */ 618#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));
157/* defined in keyboard.c */ 157/* defined in keyboard.c */
158extern void set_waiting_for_input __P ((EMACS_TIME *)); 158extern void set_waiting_for_input __P ((EMACS_TIME *));
159 159
160/* When lisp.h is not included Lisp_Object is not defined (this can
161 happen when this files is used outside the src directory).
162 Use GCPRO1 to determine if lisp.h was included. */
163#ifdef GCPRO1
164/* defined in dired.c */
165extern Lisp_Object make_time __P ((time_t));
166#endif
167
160/* Compare times T1 and T2. Value is 0 if T1 and T2 are the same. 168/* Compare times T1 and T2. Value is 0 if T1 and T2 are the same.
161 Value is < 0 if T1 is less than T2. Value is > 0 otherwise. */ 169 Value is < 0 if T1 is less than T2. Value is > 0 otherwise. */
162 170
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. */
25#include <stdio.h> 25#include <stdio.h>
26#include <ctype.h> 26#include <ctype.h>
27#include <string.h> 27#include <string.h>
28#include <stdarg.h>
28 29
29#include "termchar.h" 30#include "termchar.h"
30#include "termopts.h" 31#include "termopts.h"
@@ -2689,12 +2690,13 @@ to do `unset TERMCAP' (C-shell: `unsetenv TERMCAP') as well.",
2689 2690
2690/* VARARGS 1 */ 2691/* VARARGS 1 */
2691void 2692void
2692fatal (str, arg1, arg2) 2693fatal (const char *str, ...)
2693 char *str, *arg1, *arg2;
2694{ 2694{
2695 va_list ap;
2696 va_start (ap, str);
2695 fprintf (stderr, "emacs: "); 2697 fprintf (stderr, "emacs: ");
2696 fprintf (stderr, str, arg1, arg2); 2698 vfprintf (stderr, str, ap);
2697 fprintf (stderr, "\n"); 2699 va_end (ap);
2698 fflush (stderr); 2700 fflush (stderr);
2699 exit (1); 2701 exit (1);
2700} 2702}
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:
412#include <string.h> 412#include <string.h>
413#else 413#else
414#include <config.h> 414#include <config.h>
415extern void fatal (char *, ...); 415extern void fatal (const char *msgid, ...);
416#endif 416#endif
417 417
418#include <sys/types.h> 418#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. */
45#include <sys/param.h> 45#include <sys/param.h>
46#include <stdio.h> 46#include <stdio.h>
47 47
48#include "lisp.h"
48#include "systime.h" 49#include "systime.h"
49#include "sysselect.h" 50#include "sysselect.h"
50#include "lisp.h"
51#include "termhooks.h" 51#include "termhooks.h"
52#include "termopts.h" 52#include "termopts.h"
53#include "xterm.h" 53#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)
6231 if (status_return == XBufferOverflow) 6231 if (status_return == XBufferOverflow)
6232 { 6232 {
6233 copy_bufsiz = nbytes + 1; 6233 copy_bufsiz = nbytes + 1;
6234 copy_bufptr = (char *) alloca (copy_bufsiz); 6234 copy_bufptr = (unsigned char *) alloca (copy_bufsiz);
6235 nbytes = XmbLookupString (FRAME_XIC (f), 6235 nbytes = XmbLookupString (FRAME_XIC (f),
6236 &event.xkey, copy_bufptr, 6236 &event.xkey, copy_bufptr,
6237 copy_bufsiz, &keysym, 6237 copy_bufsiz, &keysym,
@@ -6249,7 +6249,7 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
6249 if (status_return == XBufferOverflow) 6249 if (status_return == XBufferOverflow)
6250 { 6250 {
6251 copy_bufsiz = nbytes + 1; 6251 copy_bufsiz = nbytes + 1;
6252 copy_bufptr = (char *) alloca (copy_bufsiz); 6252 copy_bufptr = (unsigned char *) alloca (copy_bufsiz);
6253 nbytes = Xutf8LookupString (FRAME_XIC (f), 6253 nbytes = Xutf8LookupString (FRAME_XIC (f),
6254 &event.xkey, 6254 &event.xkey,
6255 copy_bufptr, 6255 copy_bufptr,