diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 68 | ||||
| -rw-r--r-- | src/alloc.c | 2 | ||||
| -rw-r--r-- | src/buffer.c | 115 | ||||
| -rw-r--r-- | src/chartab.c | 8 | ||||
| -rw-r--r-- | src/cm.c | 3 | ||||
| -rw-r--r-- | src/composite.c | 1 | ||||
| -rw-r--r-- | src/data.c | 3 | ||||
| -rw-r--r-- | src/dispnew.c | 3 | ||||
| -rw-r--r-- | src/emacs.c | 3 | ||||
| -rw-r--r-- | src/floatfns.c | 3 | ||||
| -rw-r--r-- | src/font.c | 29 | ||||
| -rw-r--r-- | src/gtkutil.c | 1 | ||||
| -rw-r--r-- | src/image.c | 4 | ||||
| -rw-r--r-- | src/indent.c | 3 | ||||
| -rw-r--r-- | src/intervals.c | 24 | ||||
| -rw-r--r-- | src/lread.c | 4 | ||||
| -rw-r--r-- | src/ralloc.c | 2 | ||||
| -rw-r--r-- | src/regex.c | 17 | ||||
| -rw-r--r-- | src/sysdep.c | 3 | ||||
| -rw-r--r-- | src/termcap.c | 50 | ||||
| -rw-r--r-- | src/tparam.c | 5 | ||||
| -rw-r--r-- | src/unexhp9k800.c | 172 | ||||
| -rw-r--r-- | src/w32.c | 8 | ||||
| -rw-r--r-- | src/widget.c | 6 | ||||
| -rw-r--r-- | src/xdisp.c | 5 | ||||
| -rw-r--r-- | src/xfaces.c | 10 | ||||
| -rw-r--r-- | src/xfns.c | 7 | ||||
| -rw-r--r-- | src/xmenu.c | 11 | ||||
| -rw-r--r-- | src/xrdb.c | 23 |
29 files changed, 292 insertions, 301 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index e4f3401eb4d..4e69399154d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | 2011-07-09 Paul Eggert <eggert@cs.ucla.edu> | 1 | 2011-07-11 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 2 | ||
| 3 | * image.c: Integer signedness and overflow and related fixes. | 3 | * image.c: Integer signedness and overflow and related fixes. |
| 4 | This is not an exhaustive set of fixes, but it's time to | 4 | This is not an exhaustive set of fixes, but it's time to |
| @@ -151,6 +151,72 @@ | |||
| 151 | Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally | 151 | Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally |
| 152 | well either way, and we prefer signed to unsigned. | 152 | well either way, and we prefer signed to unsigned. |
| 153 | 153 | ||
| 154 | 2011-07-10 Johan Bockgård <bojohan@gnu.org> | ||
| 155 | |||
| 156 | * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check. | ||
| 157 | |||
| 158 | 2011-07-10 Jan Djärv <jan.h.d@swipnet.se> | ||
| 159 | |||
| 160 | * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event | ||
| 161 | for non-popups (Bug#3642). | ||
| 162 | |||
| 163 | 2011-07-10 Andreas Schwab <schwab@linux-m68k.org> | ||
| 164 | |||
| 165 | * alloc.c (reset_malloc_hooks): Protoize. | ||
| 166 | * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge) | ||
| 167 | (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise. | ||
| 168 | * cm.c (losecursor): Likewise. | ||
| 169 | * data.c (fmod): Likewise. | ||
| 170 | * dispnew.c (swap_glyphs_in_rows): Likewise. | ||
| 171 | * emacs.c (memory_warning_signal): Likewise. | ||
| 172 | * floatfns.c (float_error): Likewise. | ||
| 173 | * font.c (check_gstring, check_otf_features, otf_tag_symbol) | ||
| 174 | (otf_open, font_otf_capability, generate_otf_features) | ||
| 175 | (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor): | ||
| 176 | Likewise. | ||
| 177 | * image.c (pbm_read_file): Likewise. | ||
| 178 | * indent.c (string_display_width): Likewise. | ||
| 179 | * intervals.c (check_for_interval, search_for_interval) | ||
| 180 | (inc_interval_count, count_intervals, root_interval) | ||
| 181 | (adjust_intervals_for_insertion, make_new_interval): Likewise. | ||
| 182 | * lread.c (defalias): Likewise. | ||
| 183 | * ralloc.c (r_alloc_check): Likewise. | ||
| 184 | * regex.c (set_image_of_range_1, set_image_of_range) | ||
| 185 | (regex_grow_registers): Likewise. | ||
| 186 | * sysdep.c (strerror): Likewise. | ||
| 187 | * termcap.c (valid_filename_p, tprint, main): Likewise. | ||
| 188 | * tparam.c (main): Likewise. | ||
| 189 | * unexhp9k800.c (run_time_remap, save_data_space) | ||
| 190 | (update_file_ptrs, read_header, write_header, calculate_checksum) | ||
| 191 | (copy_file, copy_rest, display_header): Likewise. | ||
| 192 | * widget.c (mark_shell_size_user_specified, create_frame_gcs): | ||
| 193 | Likewise. | ||
| 194 | * xdisp.c (check_it): Likewise. | ||
| 195 | * xfaces.c (register_color, unregister_color, unregister_colors): | ||
| 196 | Likewise. | ||
| 197 | * xfns.c (print_fontset_result): Likewise. | ||
| 198 | * xrdb.c (member, fatal, main): Likewise. | ||
| 199 | |||
| 200 | 2011-07-10 Paul Eggert <eggert@cs.ucla.edu> | ||
| 201 | |||
| 202 | Fix minor problems found by static checking (Bug#9031). | ||
| 203 | * chartab.c (char_table_set_range, map_sub_char_table): | ||
| 204 | Remove unused locals. | ||
| 205 | (uniprop_table): Now static. | ||
| 206 | * composite.c (_work_char): Remove unused static var. | ||
| 207 | |||
| 208 | 2011-07-09 Juanma Barranquero <lekktu@gmail.com> | ||
| 209 | |||
| 210 | * chartab.c (uniprop_table_uncompress): Remove unused local variable. | ||
| 211 | |||
| 212 | 2011-07-09 Jan Djärv <jan.h.d@swipnet.se> | ||
| 213 | |||
| 214 | * gtkutil.c (qttip_cb): Remove code without function. | ||
| 215 | |||
| 216 | 2011-07-09 Eli Zaretskii <eliz@gnu.org> | ||
| 217 | |||
| 218 | * w32.c (pthread_sigmask): New stub. | ||
| 219 | |||
| 154 | 2011-07-08 Paul Eggert <eggert@cs.ucla.edu> | 220 | 2011-07-08 Paul Eggert <eggert@cs.ucla.edu> |
| 155 | 221 | ||
| 156 | Use pthread_sigmask, not sigprocmask (Bug#9010). | 222 | Use pthread_sigmask, not sigprocmask (Bug#9010). |
diff --git a/src/alloc.c b/src/alloc.c index 5cdd5af9ecf..f325b6ed449 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -1277,7 +1277,7 @@ emacs_blocked_realloc (void *ptr, size_t size, const void *ptr2) | |||
| 1277 | calls malloc because it is the first call, and we have an endless loop. */ | 1277 | calls malloc because it is the first call, and we have an endless loop. */ |
| 1278 | 1278 | ||
| 1279 | void | 1279 | void |
| 1280 | reset_malloc_hooks () | 1280 | reset_malloc_hooks (void) |
| 1281 | { | 1281 | { |
| 1282 | __free_hook = old_free_hook; | 1282 | __free_hook = old_free_hook; |
| 1283 | __malloc_hook = old_malloc_hook; | 1283 | __malloc_hook = old_malloc_hook; |
diff --git a/src/buffer.c b/src/buffer.c index 48dde18b02c..05e96e85112 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -4466,24 +4466,40 @@ static int mmap_initialized_p; | |||
| 4466 | #define MMAP_ALLOCATED_P(start, end) 1 | 4466 | #define MMAP_ALLOCATED_P(start, end) 1 |
| 4467 | #endif | 4467 | #endif |
| 4468 | 4468 | ||
| 4469 | /* Function prototypes. */ | 4469 | /* Perform necessary intializations for the use of mmap. */ |
| 4470 | 4470 | ||
| 4471 | static int mmap_free_1 (struct mmap_region *); | 4471 | static void |
| 4472 | static int mmap_enlarge (struct mmap_region *, int); | 4472 | mmap_init (void) |
| 4473 | static struct mmap_region *mmap_find (POINTER_TYPE *, POINTER_TYPE *); | 4473 | { |
| 4474 | static POINTER_TYPE *mmap_alloc (POINTER_TYPE **, size_t); | 4474 | #if MAP_ANON == 0 |
| 4475 | static POINTER_TYPE *mmap_realloc (POINTER_TYPE **, size_t); | 4475 | /* The value of mmap_fd is initially 0 in temacs, and -1 |
| 4476 | static void mmap_free (POINTER_TYPE **ptr); | 4476 | in a dumped Emacs. */ |
| 4477 | static void mmap_init (void); | 4477 | if (mmap_fd <= 0) |
| 4478 | { | ||
| 4479 | /* No anonymous mmap -- we need the file descriptor. */ | ||
| 4480 | mmap_fd = open ("/dev/zero", O_RDONLY); | ||
| 4481 | if (mmap_fd == -1) | ||
| 4482 | fatal ("Cannot open /dev/zero: %s", emacs_strerror (errno)); | ||
| 4483 | } | ||
| 4484 | #endif /* MAP_ANON == 0 */ | ||
| 4485 | |||
| 4486 | if (mmap_initialized_p) | ||
| 4487 | return; | ||
| 4488 | mmap_initialized_p = 1; | ||
| 4478 | 4489 | ||
| 4490 | #if MAP_ANON != 0 | ||
| 4491 | mmap_fd = -1; | ||
| 4492 | #endif | ||
| 4493 | |||
| 4494 | mmap_page_size = getpagesize (); | ||
| 4495 | } | ||
| 4479 | 4496 | ||
| 4480 | /* Return a region overlapping address range START...END, or null if | 4497 | /* Return a region overlapping address range START...END, or null if |
| 4481 | none. END is not including, i.e. the last byte in the range | 4498 | none. END is not including, i.e. the last byte in the range |
| 4482 | is at END - 1. */ | 4499 | is at END - 1. */ |
| 4483 | 4500 | ||
| 4484 | static struct mmap_region * | 4501 | static struct mmap_region * |
| 4485 | mmap_find (start, end) | 4502 | mmap_find (POINTER_TYPE *start, POINTER_TYPE *end); |
| 4486 | POINTER_TYPE *start, *end; | ||
| 4487 | { | 4503 | { |
| 4488 | struct mmap_region *r; | 4504 | struct mmap_region *r; |
| 4489 | char *s = (char *) start, *e = (char *) end; | 4505 | char *s = (char *) start, *e = (char *) end; |
| @@ -4512,8 +4528,7 @@ mmap_find (start, end) | |||
| 4512 | the region. Value is non-zero if successful. */ | 4528 | the region. Value is non-zero if successful. */ |
| 4513 | 4529 | ||
| 4514 | static int | 4530 | static int |
| 4515 | mmap_free_1 (r) | 4531 | mmap_free_1 (struct mmap_region *r) |
| 4516 | struct mmap_region *r; | ||
| 4517 | { | 4532 | { |
| 4518 | if (r->next) | 4533 | if (r->next) |
| 4519 | r->next->prev = r->prev; | 4534 | r->next->prev = r->prev; |
| @@ -4536,9 +4551,7 @@ mmap_free_1 (r) | |||
| 4536 | Value is non-zero if successful. */ | 4551 | Value is non-zero if successful. */ |
| 4537 | 4552 | ||
| 4538 | static int | 4553 | static int |
| 4539 | mmap_enlarge (r, npages) | 4554 | mmap_enlarge (struct mmap_region *r, int npages) |
| 4540 | struct mmap_region *r; | ||
| 4541 | int npages; | ||
| 4542 | { | 4555 | { |
| 4543 | char *region_end = (char *) r + r->nbytes_mapped; | 4556 | char *region_end = (char *) r + r->nbytes_mapped; |
| 4544 | size_t nbytes; | 4557 | size_t nbytes; |
| @@ -4602,8 +4615,7 @@ mmap_enlarge (r, npages) | |||
| 4602 | when Emacs starts. */ | 4615 | when Emacs starts. */ |
| 4603 | 4616 | ||
| 4604 | void | 4617 | void |
| 4605 | mmap_set_vars (restore_p) | 4618 | mmap_set_vars (int restore_p) |
| 4606 | int restore_p; | ||
| 4607 | { | 4619 | { |
| 4608 | struct mmap_region *r; | 4620 | struct mmap_region *r; |
| 4609 | 4621 | ||
| @@ -4636,9 +4648,7 @@ mmap_set_vars (restore_p) | |||
| 4636 | return null. */ | 4648 | return null. */ |
| 4637 | 4649 | ||
| 4638 | static POINTER_TYPE * | 4650 | static POINTER_TYPE * |
| 4639 | mmap_alloc (var, nbytes) | 4651 | mmap_alloc (POINTER_TYPE **var, size_t nbytes) |
| 4640 | POINTER_TYPE **var; | ||
| 4641 | size_t nbytes; | ||
| 4642 | { | 4652 | { |
| 4643 | void *p; | 4653 | void *p; |
| 4644 | size_t map; | 4654 | size_t map; |
| @@ -4675,15 +4685,29 @@ mmap_alloc (var, nbytes) | |||
| 4675 | } | 4685 | } |
| 4676 | 4686 | ||
| 4677 | 4687 | ||
| 4688 | /* Free a block of relocatable storage whose data is pointed to by | ||
| 4689 | PTR. Store 0 in *PTR to show there's no block allocated. */ | ||
| 4690 | |||
| 4691 | static void | ||
| 4692 | mmap_free (POINTER_TYPE **var) | ||
| 4693 | { | ||
| 4694 | mmap_init (); | ||
| 4695 | |||
| 4696 | if (*var) | ||
| 4697 | { | ||
| 4698 | mmap_free_1 (MMAP_REGION (*var)); | ||
| 4699 | *var = NULL; | ||
| 4700 | } | ||
| 4701 | } | ||
| 4702 | |||
| 4703 | |||
| 4678 | /* Given a pointer at address VAR to data allocated with mmap_alloc, | 4704 | /* Given a pointer at address VAR to data allocated with mmap_alloc, |
| 4679 | resize it to size NBYTES. Change *VAR to reflect the new block, | 4705 | resize it to size NBYTES. Change *VAR to reflect the new block, |
| 4680 | and return this value. If more memory cannot be allocated, then | 4706 | and return this value. If more memory cannot be allocated, then |
| 4681 | leave *VAR unchanged, and return null. */ | 4707 | leave *VAR unchanged, and return null. */ |
| 4682 | 4708 | ||
| 4683 | static POINTER_TYPE * | 4709 | static POINTER_TYPE * |
| 4684 | mmap_realloc (var, nbytes) | 4710 | mmap_realloc (POINTER_TYPE **var, size_t nbytes) |
| 4685 | POINTER_TYPE **var; | ||
| 4686 | size_t nbytes; | ||
| 4687 | { | 4711 | { |
| 4688 | POINTER_TYPE *result; | 4712 | POINTER_TYPE *result; |
| 4689 | 4713 | ||
| @@ -4753,51 +4777,6 @@ mmap_realloc (var, nbytes) | |||
| 4753 | } | 4777 | } |
| 4754 | 4778 | ||
| 4755 | 4779 | ||
| 4756 | /* Free a block of relocatable storage whose data is pointed to by | ||
| 4757 | PTR. Store 0 in *PTR to show there's no block allocated. */ | ||
| 4758 | |||
| 4759 | static void | ||
| 4760 | mmap_free (var) | ||
| 4761 | POINTER_TYPE **var; | ||
| 4762 | { | ||
| 4763 | mmap_init (); | ||
| 4764 | |||
| 4765 | if (*var) | ||
| 4766 | { | ||
| 4767 | mmap_free_1 (MMAP_REGION (*var)); | ||
| 4768 | *var = NULL; | ||
| 4769 | } | ||
| 4770 | } | ||
| 4771 | |||
| 4772 | |||
| 4773 | /* Perform necessary intializations for the use of mmap. */ | ||
| 4774 | |||
| 4775 | static void | ||
| 4776 | mmap_init () | ||
| 4777 | { | ||
| 4778 | #if MAP_ANON == 0 | ||
| 4779 | /* The value of mmap_fd is initially 0 in temacs, and -1 | ||
| 4780 | in a dumped Emacs. */ | ||
| 4781 | if (mmap_fd <= 0) | ||
| 4782 | { | ||
| 4783 | /* No anonymous mmap -- we need the file descriptor. */ | ||
| 4784 | mmap_fd = open ("/dev/zero", O_RDONLY); | ||
| 4785 | if (mmap_fd == -1) | ||
| 4786 | fatal ("Cannot open /dev/zero: %s", emacs_strerror (errno)); | ||
| 4787 | } | ||
| 4788 | #endif /* MAP_ANON == 0 */ | ||
| 4789 | |||
| 4790 | if (mmap_initialized_p) | ||
| 4791 | return; | ||
| 4792 | mmap_initialized_p = 1; | ||
| 4793 | |||
| 4794 | #if MAP_ANON != 0 | ||
| 4795 | mmap_fd = -1; | ||
| 4796 | #endif | ||
| 4797 | |||
| 4798 | mmap_page_size = getpagesize (); | ||
| 4799 | } | ||
| 4800 | |||
| 4801 | #endif /* USE_MMAP_FOR_BUFFERS */ | 4780 | #endif /* USE_MMAP_FOR_BUFFERS */ |
| 4802 | 4781 | ||
| 4803 | 4782 | ||
diff --git a/src/chartab.c b/src/chartab.c index e900a3ae71f..efe23eca83f 100644 --- a/src/chartab.c +++ b/src/chartab.c | |||
| @@ -485,7 +485,6 @@ Lisp_Object | |||
| 485 | char_table_set_range (Lisp_Object table, int from, int to, Lisp_Object val) | 485 | char_table_set_range (Lisp_Object table, int from, int to, Lisp_Object val) |
| 486 | { | 486 | { |
| 487 | struct Lisp_Char_Table *tbl = XCHAR_TABLE (table); | 487 | struct Lisp_Char_Table *tbl = XCHAR_TABLE (table); |
| 488 | Lisp_Object *contents = tbl->contents; | ||
| 489 | 488 | ||
| 490 | if (from == to) | 489 | if (from == to) |
| 491 | char_table_set (table, from, val); | 490 | char_table_set (table, from, val); |
| @@ -759,8 +758,6 @@ map_sub_char_table (void (*c_function) (Lisp_Object, Lisp_Object, Lisp_Object), | |||
| 759 | Lisp_Object function, Lisp_Object table, Lisp_Object arg, Lisp_Object val, | 758 | Lisp_Object function, Lisp_Object table, Lisp_Object arg, Lisp_Object val, |
| 760 | Lisp_Object range, Lisp_Object top) | 759 | Lisp_Object range, Lisp_Object top) |
| 761 | { | 760 | { |
| 762 | /* Pointer to the elements of TABLE. */ | ||
| 763 | Lisp_Object *contents; | ||
| 764 | /* Depth of TABLE. */ | 761 | /* Depth of TABLE. */ |
| 765 | int depth; | 762 | int depth; |
| 766 | /* Minimum and maxinum characters covered by TABLE. */ | 763 | /* Minimum and maxinum characters covered by TABLE. */ |
| @@ -777,14 +774,12 @@ map_sub_char_table (void (*c_function) (Lisp_Object, Lisp_Object, Lisp_Object), | |||
| 777 | struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); | 774 | struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); |
| 778 | 775 | ||
| 779 | depth = XINT (tbl->depth); | 776 | depth = XINT (tbl->depth); |
| 780 | contents = tbl->contents; | ||
| 781 | min_char = XINT (tbl->min_char); | 777 | min_char = XINT (tbl->min_char); |
| 782 | max_char = min_char + chartab_chars[depth - 1] - 1; | 778 | max_char = min_char + chartab_chars[depth - 1] - 1; |
| 783 | } | 779 | } |
| 784 | else | 780 | else |
| 785 | { | 781 | { |
| 786 | depth = 0; | 782 | depth = 0; |
| 787 | contents = XCHAR_TABLE (table)->contents; | ||
| 788 | min_char = 0; | 783 | min_char = 0; |
| 789 | max_char = MAX_CHAR; | 784 | max_char = MAX_CHAR; |
| 790 | } | 785 | } |
| @@ -1143,7 +1138,6 @@ uniprop_table_uncompress (Lisp_Object table, int idx) | |||
| 1143 | Lisp_Object sub = make_sub_char_table (3, min_char, Qnil); | 1138 | Lisp_Object sub = make_sub_char_table (3, min_char, Qnil); |
| 1144 | struct Lisp_Sub_Char_Table *subtbl = XSUB_CHAR_TABLE (sub); | 1139 | struct Lisp_Sub_Char_Table *subtbl = XSUB_CHAR_TABLE (sub); |
| 1145 | const unsigned char *p, *pend; | 1140 | const unsigned char *p, *pend; |
| 1146 | int i; | ||
| 1147 | 1141 | ||
| 1148 | XSUB_CHAR_TABLE (table)->contents[idx] = sub; | 1142 | XSUB_CHAR_TABLE (table)->contents[idx] = sub; |
| 1149 | p = SDATA (val), pend = p + SBYTES (val); | 1143 | p = SDATA (val), pend = p + SBYTES (val); |
| @@ -1316,7 +1310,7 @@ uniprop_get_encoder (Lisp_Object table) | |||
| 1316 | function may load a Lisp file and thus may cause | 1310 | function may load a Lisp file and thus may cause |
| 1317 | garbage-collection. */ | 1311 | garbage-collection. */ |
| 1318 | 1312 | ||
| 1319 | Lisp_Object | 1313 | static Lisp_Object |
| 1320 | uniprop_table (Lisp_Object prop) | 1314 | uniprop_table (Lisp_Object prop) |
| 1321 | { | 1315 | { |
| 1322 | Lisp_Object val, table, result; | 1316 | Lisp_Object val, table, result; |
| @@ -305,7 +305,8 @@ done: | |||
| 305 | } | 305 | } |
| 306 | 306 | ||
| 307 | #if 0 | 307 | #if 0 |
| 308 | losecursor () | 308 | void |
| 309 | losecursor (void) | ||
| 309 | { | 310 | { |
| 310 | curY = -1; | 311 | curY = -1; |
| 311 | } | 312 | } |
diff --git a/src/composite.c b/src/composite.c index cf1e053f027..d402d5ad0c4 100644 --- a/src/composite.c +++ b/src/composite.c | |||
| @@ -967,7 +967,6 @@ autocmp_chars (Lisp_Object rule, EMACS_INT charpos, EMACS_INT bytepos, EMACS_INT | |||
| 967 | } | 967 | } |
| 968 | 968 | ||
| 969 | static Lisp_Object _work_val; | 969 | static Lisp_Object _work_val; |
| 970 | static int _work_char; | ||
| 971 | 970 | ||
| 972 | /* 1 iff the character C is composable. Characters of general | 971 | /* 1 iff the character C is composable. Characters of general |
| 973 | category Z? or C? are not composable except for ZWNJ and ZWJ. */ | 972 | category Z? or C? are not composable except for ZWNJ and ZWJ. */ |
diff --git a/src/data.c b/src/data.c index eb3f870b97c..76a54547a5d 100644 --- a/src/data.c +++ b/src/data.c | |||
| @@ -2733,8 +2733,7 @@ Both must be integers or markers. */) | |||
| 2733 | 2733 | ||
| 2734 | #ifndef HAVE_FMOD | 2734 | #ifndef HAVE_FMOD |
| 2735 | double | 2735 | double |
| 2736 | fmod (f1, f2) | 2736 | fmod (double f1, double f2) |
| 2737 | double f1, f2; | ||
| 2738 | { | 2737 | { |
| 2739 | double r = f1; | 2738 | double r = f1; |
| 2740 | 2739 | ||
diff --git a/src/dispnew.c b/src/dispnew.c index c95404b5c52..15d80367701 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -1029,8 +1029,7 @@ increment_row_positions (struct glyph_row *row, | |||
| 1029 | B without changing glyph pointers in A and B. */ | 1029 | B without changing glyph pointers in A and B. */ |
| 1030 | 1030 | ||
| 1031 | static void | 1031 | static void |
| 1032 | swap_glyphs_in_rows (a, b) | 1032 | swap_glyphs_in_rows (struct glyph_row *a, struct glyph_row *b) |
| 1033 | struct glyph_row *a, *b; | ||
| 1034 | { | 1033 | { |
| 1035 | int area; | 1034 | int area; |
| 1036 | 1035 | ||
diff --git a/src/emacs.c b/src/emacs.c index a055d89d35f..39870ec0079 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -356,8 +356,7 @@ fatal_error_signal (int sig) | |||
| 356 | 356 | ||
| 357 | /* Handler for SIGDANGER. */ | 357 | /* Handler for SIGDANGER. */ |
| 358 | void | 358 | void |
| 359 | memory_warning_signal (sig) | 359 | memory_warning_signal (int sig) |
| 360 | int sig; | ||
| 361 | { | 360 | { |
| 362 | signal (sig, memory_warning_signal); | 361 | signal (sig, memory_warning_signal); |
| 363 | SIGNAL_THREAD_CHECK (sig); | 362 | SIGNAL_THREAD_CHECK (sig); |
diff --git a/src/floatfns.c b/src/floatfns.c index 850eb9f1bcc..89aa052e8b1 100644 --- a/src/floatfns.c +++ b/src/floatfns.c | |||
| @@ -958,8 +958,7 @@ Rounds the value toward zero. */) | |||
| 958 | 958 | ||
| 959 | #ifdef FLOAT_CATCH_SIGILL | 959 | #ifdef FLOAT_CATCH_SIGILL |
| 960 | static void | 960 | static void |
| 961 | float_error (signo) | 961 | float_error (int signo) |
| 962 | int signo; | ||
| 963 | { | 962 | { |
| 964 | if (! in_float) | 963 | if (! in_float) |
| 965 | fatal_error_signal (signo); | 964 | fatal_error_signal (signo); |
diff --git a/src/font.c b/src/font.c index 5aff20b1346..5f8d22157d6 100644 --- a/src/font.c +++ b/src/font.c | |||
| @@ -1738,8 +1738,7 @@ font_parse_family_registry (Lisp_Object family, Lisp_Object registry, Lisp_Objec | |||
| 1738 | #define LGSTRING_GLYPH_SIZE 8 | 1738 | #define LGSTRING_GLYPH_SIZE 8 |
| 1739 | 1739 | ||
| 1740 | static int | 1740 | static int |
| 1741 | check_gstring (gstring) | 1741 | check_gstring (Lisp_Object gstring) |
| 1742 | Lisp_Object gstring; | ||
| 1743 | { | 1742 | { |
| 1744 | Lisp_Object val; | 1743 | Lisp_Object val; |
| 1745 | int i, j; | 1744 | int i, j; |
| @@ -1793,8 +1792,7 @@ check_gstring (gstring) | |||
| 1793 | } | 1792 | } |
| 1794 | 1793 | ||
| 1795 | static void | 1794 | static void |
| 1796 | check_otf_features (otf_features) | 1795 | check_otf_features (Lisp_Object otf_features) |
| 1797 | Lisp_Object otf_features; | ||
| 1798 | { | 1796 | { |
| 1799 | Lisp_Object val; | 1797 | Lisp_Object val; |
| 1800 | 1798 | ||
| @@ -1827,8 +1825,7 @@ check_otf_features (otf_features) | |||
| 1827 | Lisp_Object otf_list; | 1825 | Lisp_Object otf_list; |
| 1828 | 1826 | ||
| 1829 | static Lisp_Object | 1827 | static Lisp_Object |
| 1830 | otf_tag_symbol (tag) | 1828 | otf_tag_symbol (OTF_Tag tag) |
| 1831 | OTF_Tag tag; | ||
| 1832 | { | 1829 | { |
| 1833 | char name[5]; | 1830 | char name[5]; |
| 1834 | 1831 | ||
| @@ -1837,8 +1834,7 @@ otf_tag_symbol (tag) | |||
| 1837 | } | 1834 | } |
| 1838 | 1835 | ||
| 1839 | static OTF * | 1836 | static OTF * |
| 1840 | otf_open (file) | 1837 | otf_open (Lisp_Object file) |
| 1841 | Lisp_Object file; | ||
| 1842 | { | 1838 | { |
| 1843 | Lisp_Object val = Fassoc (file, otf_list); | 1839 | Lisp_Object val = Fassoc (file, otf_list); |
| 1844 | OTF *otf; | 1840 | OTF *otf; |
| @@ -1860,8 +1856,7 @@ otf_open (file) | |||
| 1860 | (struct font_driver).otf_capability. */ | 1856 | (struct font_driver).otf_capability. */ |
| 1861 | 1857 | ||
| 1862 | Lisp_Object | 1858 | Lisp_Object |
| 1863 | font_otf_capability (font) | 1859 | font_otf_capability (struct font *font) |
| 1864 | struct font *font; | ||
| 1865 | { | 1860 | { |
| 1866 | OTF *otf; | 1861 | OTF *otf; |
| 1867 | Lisp_Object capability = Fcons (Qnil, Qnil); | 1862 | Lisp_Object capability = Fcons (Qnil, Qnil); |
| @@ -1935,9 +1930,7 @@ font_otf_capability (font) | |||
| 1935 | FEATURES. */ | 1930 | FEATURES. */ |
| 1936 | 1931 | ||
| 1937 | static void | 1932 | static void |
| 1938 | generate_otf_features (spec, features) | 1933 | generate_otf_features (Lisp_Object spec, char *features) |
| 1939 | Lisp_Object spec; | ||
| 1940 | char *features; | ||
| 1941 | { | 1934 | { |
| 1942 | Lisp_Object val; | 1935 | Lisp_Object val; |
| 1943 | char *p; | 1936 | char *p; |
| @@ -1972,8 +1965,7 @@ generate_otf_features (spec, features) | |||
| 1972 | } | 1965 | } |
| 1973 | 1966 | ||
| 1974 | Lisp_Object | 1967 | Lisp_Object |
| 1975 | font_otf_DeviceTable (device_table) | 1968 | font_otf_DeviceTable (OTF_DeviceTable *device_table) |
| 1976 | OTF_DeviceTable *device_table; | ||
| 1977 | { | 1969 | { |
| 1978 | int len = device_table->StartSize - device_table->EndSize + 1; | 1970 | int len = device_table->StartSize - device_table->EndSize + 1; |
| 1979 | 1971 | ||
| @@ -1982,9 +1974,7 @@ font_otf_DeviceTable (device_table) | |||
| 1982 | } | 1974 | } |
| 1983 | 1975 | ||
| 1984 | Lisp_Object | 1976 | Lisp_Object |
| 1985 | font_otf_ValueRecord (value_format, value_record) | 1977 | font_otf_ValueRecord (int value_format, OTF_ValueRecord *value_record) |
| 1986 | int value_format; | ||
| 1987 | OTF_ValueRecord *value_record; | ||
| 1988 | { | 1978 | { |
| 1989 | Lisp_Object val = Fmake_vector (make_number (8), Qnil); | 1979 | Lisp_Object val = Fmake_vector (make_number (8), Qnil); |
| 1990 | 1980 | ||
| @@ -2008,8 +1998,7 @@ font_otf_ValueRecord (value_format, value_record) | |||
| 2008 | } | 1998 | } |
| 2009 | 1999 | ||
| 2010 | Lisp_Object | 2000 | Lisp_Object |
| 2011 | font_otf_Anchor (anchor) | 2001 | font_otf_Anchor (OTF_Anchor *anchor) |
| 2012 | OTF_Anchor *anchor; | ||
| 2013 | { | 2002 | { |
| 2014 | Lisp_Object val; | 2003 | Lisp_Object val; |
| 2015 | 2004 | ||
diff --git a/src/gtkutil.c b/src/gtkutil.c index dfc5b63f375..35b366222de 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c | |||
| @@ -647,7 +647,6 @@ qttip_cb (GtkWidget *widget, | |||
| 647 | /* Change stupid Gtk+ default line wrapping. */ | 647 | /* Change stupid Gtk+ default line wrapping. */ |
| 648 | p = gtk_widget_get_parent (x->ttip_lbl); | 648 | p = gtk_widget_get_parent (x->ttip_lbl); |
| 649 | list = gtk_container_get_children (GTK_CONTAINER (p)); | 649 | list = gtk_container_get_children (GTK_CONTAINER (p)); |
| 650 | iter; | ||
| 651 | for (iter = list; iter; iter = g_list_next (iter)) | 650 | for (iter = list; iter; iter = g_list_next (iter)) |
| 652 | { | 651 | { |
| 653 | GtkWidget *w = GTK_WIDGET (iter->data); | 652 | GtkWidget *w = GTK_WIDGET (iter->data); |
diff --git a/src/image.c b/src/image.c index a09fc7a8979..f6626f61c83 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -5002,9 +5002,7 @@ pbm_scan_number (unsigned char **s, unsigned char *end) | |||
| 5002 | occurred. *SIZE is set to the size of the file. */ | 5002 | occurred. *SIZE is set to the size of the file. */ |
| 5003 | 5003 | ||
| 5004 | static char * | 5004 | static char * |
| 5005 | pbm_read_file (file, size) | 5005 | pbm_read_file (Lisp_Object file, int *size) |
| 5006 | Lisp_Object file; | ||
| 5007 | int *size; | ||
| 5008 | { | 5006 | { |
| 5009 | FILE *fp = NULL; | 5007 | FILE *fp = NULL; |
| 5010 | char *buf = NULL; | 5008 | char *buf = NULL; |
diff --git a/src/indent.c b/src/indent.c index 02d99d14ded..5c5966175aa 100644 --- a/src/indent.c +++ b/src/indent.c | |||
| @@ -725,8 +725,7 @@ current_column_1 (void) | |||
| 725 | If END is nil, that stands for the end of STRING. */ | 725 | If END is nil, that stands for the end of STRING. */ |
| 726 | 726 | ||
| 727 | static double | 727 | static double |
| 728 | string_display_width (string, beg, end) | 728 | string_display_width (Lisp_Object string, Lisp_Object beg, Lisp_Object end) |
| 729 | Lisp_Object string, beg, end; | ||
| 730 | { | 729 | { |
| 731 | register int col; | 730 | register int col; |
| 732 | register unsigned char *ptr, *stop; | 731 | register unsigned char *ptr, *stop; |
diff --git a/src/intervals.c b/src/intervals.c index 4de001f2ffc..2063655cdb9 100644 --- a/src/intervals.c +++ b/src/intervals.c | |||
| @@ -247,8 +247,7 @@ static int zero_length; | |||
| 247 | INTERVAL search_interval, found_interval; | 247 | INTERVAL search_interval, found_interval; |
| 248 | 248 | ||
| 249 | void | 249 | void |
| 250 | check_for_interval (i) | 250 | check_for_interval (INTERVAL i) |
| 251 | register INTERVAL i; | ||
| 252 | { | 251 | { |
| 253 | if (i == search_interval) | 252 | if (i == search_interval) |
| 254 | { | 253 | { |
| @@ -258,8 +257,7 @@ check_for_interval (i) | |||
| 258 | } | 257 | } |
| 259 | 258 | ||
| 260 | INTERVAL | 259 | INTERVAL |
| 261 | search_for_interval (i, tree) | 260 | search_for_interval (INTERVAL i, INTERVAL tree) |
| 262 | register INTERVAL i, tree; | ||
| 263 | { | 261 | { |
| 264 | icount = 0; | 262 | icount = 0; |
| 265 | search_interval = i; | 263 | search_interval = i; |
| @@ -269,8 +267,7 @@ search_for_interval (i, tree) | |||
| 269 | } | 267 | } |
| 270 | 268 | ||
| 271 | static void | 269 | static void |
| 272 | inc_interval_count (i) | 270 | inc_interval_count (INTERVAL i) |
| 273 | INTERVAL i; | ||
| 274 | { | 271 | { |
| 275 | icount++; | 272 | icount++; |
| 276 | if (LENGTH (i) == 0) | 273 | if (LENGTH (i) == 0) |
| @@ -280,8 +277,7 @@ inc_interval_count (i) | |||
| 280 | } | 277 | } |
| 281 | 278 | ||
| 282 | int | 279 | int |
| 283 | count_intervals (i) | 280 | count_intervals (INTERVAL i) |
| 284 | register INTERVAL i; | ||
| 285 | { | 281 | { |
| 286 | icount = 0; | 282 | icount = 0; |
| 287 | idepth = 0; | 283 | idepth = 0; |
| @@ -292,8 +288,7 @@ count_intervals (i) | |||
| 292 | } | 288 | } |
| 293 | 289 | ||
| 294 | static INTERVAL | 290 | static INTERVAL |
| 295 | root_interval (interval) | 291 | root_interval (INTERVAL interval) |
| 296 | INTERVAL interval; | ||
| 297 | { | 292 | { |
| 298 | register INTERVAL i = interval; | 293 | register INTERVAL i = interval; |
| 299 | 294 | ||
| @@ -804,9 +799,8 @@ update_interval (register INTERVAL i, EMACS_INT pos) | |||
| 804 | to the root. */ | 799 | to the root. */ |
| 805 | 800 | ||
| 806 | static INTERVAL | 801 | static INTERVAL |
| 807 | adjust_intervals_for_insertion (tree, position, length) | 802 | adjust_intervals_for_insertion (INTERVAL tree, EMACS_INT position, |
| 808 | INTERVAL tree; | 803 | EMACS_INT length) |
| 809 | EMACS_INT position, length; | ||
| 810 | { | 804 | { |
| 811 | register EMACS_INT relative_position; | 805 | register EMACS_INT relative_position; |
| 812 | register INTERVAL this; | 806 | register INTERVAL this; |
| @@ -1615,9 +1609,7 @@ reproduce_tree_obj (INTERVAL source, Lisp_Object parent) | |||
| 1615 | interval. */ | 1609 | interval. */ |
| 1616 | 1610 | ||
| 1617 | static INTERVAL | 1611 | static INTERVAL |
| 1618 | make_new_interval (intervals, start, length) | 1612 | make_new_interval (INTERVAL intervals, EMACS_INT start, EMACS_INT length) |
| 1619 | INTERVAL intervals; | ||
| 1620 | EMACS_INT start, length; | ||
| 1621 | { | 1613 | { |
| 1622 | INTERVAL slot; | 1614 | INTERVAL slot; |
| 1623 | 1615 | ||
diff --git a/src/lread.c b/src/lread.c index 6a97be2be42..bef1cc8e591 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -3981,9 +3981,7 @@ defsubr (struct Lisp_Subr *sname) | |||
| 3981 | 3981 | ||
| 3982 | #ifdef NOTDEF /* use fset in subr.el now */ | 3982 | #ifdef NOTDEF /* use fset in subr.el now */ |
| 3983 | void | 3983 | void |
| 3984 | defalias (sname, string) | 3984 | defalias (struct Lisp_Subr *sname, char *string) |
| 3985 | struct Lisp_Subr *sname; | ||
| 3986 | char *string; | ||
| 3987 | { | 3985 | { |
| 3988 | Lisp_Object sym; | 3986 | Lisp_Object sym; |
| 3989 | sym = intern (string); | 3987 | sym = intern (string); |
diff --git a/src/ralloc.c b/src/ralloc.c index 9c601a0ac24..64a47416202 100644 --- a/src/ralloc.c +++ b/src/ralloc.c | |||
| @@ -1079,7 +1079,7 @@ r_alloc_reinit (void) | |||
| 1079 | #include <assert.h> | 1079 | #include <assert.h> |
| 1080 | 1080 | ||
| 1081 | void | 1081 | void |
| 1082 | r_alloc_check () | 1082 | r_alloc_check (void) |
| 1083 | { | 1083 | { |
| 1084 | int found = 0; | 1084 | int found = 0; |
| 1085 | heap_ptr h, ph = 0; | 1085 | heap_ptr h, ph = 0; |
diff --git a/src/regex.c b/src/regex.c index d347d274819..190d1d0fe21 100644 --- a/src/regex.c +++ b/src/regex.c | |||
| @@ -2169,10 +2169,9 @@ extend_range_table_work_area (struct range_table_work_area *work_area) | |||
| 2169 | Returns -1 if successful, REG_ESPACE if ran out of space. */ | 2169 | Returns -1 if successful, REG_ESPACE if ran out of space. */ |
| 2170 | 2170 | ||
| 2171 | static int | 2171 | static int |
| 2172 | set_image_of_range_1 (work_area, start, end, translate) | 2172 | set_image_of_range_1 (struct range_table_work_area *work_area, |
| 2173 | RE_TRANSLATE_TYPE translate; | 2173 | re_wchar_t start, re_wchar_t end, |
| 2174 | struct range_table_work_area *work_area; | 2174 | RE_TRANSLATE_TYPE translate) |
| 2175 | re_wchar_t start, end; | ||
| 2176 | { | 2175 | { |
| 2177 | /* `one_case' indicates a character, or a run of characters, | 2176 | /* `one_case' indicates a character, or a run of characters, |
| 2178 | each of which is an isolate (no case-equivalents). | 2177 | each of which is an isolate (no case-equivalents). |
| @@ -2322,10 +2321,9 @@ set_image_of_range_1 (work_area, start, end, translate) | |||
| 2322 | Returns -1 if successful, REG_ESPACE if ran out of space. */ | 2321 | Returns -1 if successful, REG_ESPACE if ran out of space. */ |
| 2323 | 2322 | ||
| 2324 | static int | 2323 | static int |
| 2325 | set_image_of_range (work_area, start, end, translate) | 2324 | set_image_of_range (struct range_table_work_area *work_area, |
| 2326 | RE_TRANSLATE_TYPE translate; | 2325 | re_wchar_t start, re_wchar_t end, |
| 2327 | struct range_table_work_area *work_area; | 2326 | RE_TRANSLATE_TYPE translate) |
| 2328 | re_wchar_t start, end; | ||
| 2329 | { | 2327 | { |
| 2330 | re_wchar_t cmin, cmax; | 2328 | re_wchar_t cmin, cmax; |
| 2331 | 2329 | ||
| @@ -2412,8 +2410,7 @@ static re_char **best_regstart, **best_regend; | |||
| 2412 | but don't make them smaller. */ | 2410 | but don't make them smaller. */ |
| 2413 | 2411 | ||
| 2414 | static | 2412 | static |
| 2415 | regex_grow_registers (num_regs) | 2413 | regex_grow_registers (int num_regs) |
| 2416 | int num_regs; | ||
| 2417 | { | 2414 | { |
| 2418 | if (num_regs > regs_allocated_size) | 2415 | if (num_regs > regs_allocated_size) |
| 2419 | { | 2416 | { |
diff --git a/src/sysdep.c b/src/sysdep.c index 077d4405593..4bd1f54b9e6 100644 --- a/src/sysdep.c +++ b/src/sysdep.c | |||
| @@ -1800,8 +1800,7 @@ get_random (void) | |||
| 1800 | #ifndef HAVE_STRERROR | 1800 | #ifndef HAVE_STRERROR |
| 1801 | #ifndef WINDOWSNT | 1801 | #ifndef WINDOWSNT |
| 1802 | char * | 1802 | char * |
| 1803 | strerror (errnum) | 1803 | strerror (int errnum) |
| 1804 | int errnum; | ||
| 1805 | { | 1804 | { |
| 1806 | extern char *sys_errlist[]; | 1805 | extern char *sys_errlist[]; |
| 1807 | extern int sys_nerr; | 1806 | extern int sys_nerr; |
diff --git a/src/termcap.c b/src/termcap.c index e191f6b3af3..96b9303d62d 100644 --- a/src/termcap.c +++ b/src/termcap.c | |||
| @@ -338,8 +338,7 @@ static int name_match (char *line, char *name); | |||
| 338 | 338 | ||
| 339 | #ifdef MSDOS /* MW, May 1993 */ | 339 | #ifdef MSDOS /* MW, May 1993 */ |
| 340 | static int | 340 | static int |
| 341 | valid_filename_p (fn) | 341 | valid_filename_p (char *fn) |
| 342 | char *fn; | ||
| 343 | { | 342 | { |
| 344 | return *fn == '/' || fn[1] == ':'; | 343 | return *fn == '/' || fn[1] == ':'; |
| 345 | } | 344 | } |
| @@ -669,9 +668,29 @@ gobble_line (int fd, register struct termcap_buffer *bufp, char *append_end) | |||
| 669 | 668 | ||
| 670 | #include <stdio.h> | 669 | #include <stdio.h> |
| 671 | 670 | ||
| 672 | main (argc, argv) | 671 | static void |
| 673 | int argc; | 672 | tprint (char *cap) |
| 674 | char **argv; | 673 | { |
| 674 | char *x = tgetstr (cap, 0); | ||
| 675 | register char *y; | ||
| 676 | |||
| 677 | printf ("%s: ", cap); | ||
| 678 | if (x) | ||
| 679 | { | ||
| 680 | for (y = x; *y; y++) | ||
| 681 | if (*y <= ' ' || *y == 0177) | ||
| 682 | printf ("\\%0o", *y); | ||
| 683 | else | ||
| 684 | putchar (*y); | ||
| 685 | free (x); | ||
| 686 | } | ||
| 687 | else | ||
| 688 | printf ("none"); | ||
| 689 | putchar ('\n'); | ||
| 690 | } | ||
| 691 | |||
| 692 | int | ||
| 693 | main (int argc, char **argv) | ||
| 675 | { | 694 | { |
| 676 | char *term; | 695 | char *term; |
| 677 | char *buf; | 696 | char *buf; |
| @@ -693,27 +712,8 @@ main (argc, argv) | |||
| 693 | 712 | ||
| 694 | printf ("co: %d\n", tgetnum ("co")); | 713 | printf ("co: %d\n", tgetnum ("co")); |
| 695 | printf ("am: %d\n", tgetflag ("am")); | 714 | printf ("am: %d\n", tgetflag ("am")); |
| 696 | } | ||
| 697 | |||
| 698 | tprint (cap) | ||
| 699 | char *cap; | ||
| 700 | { | ||
| 701 | char *x = tgetstr (cap, 0); | ||
| 702 | register char *y; | ||
| 703 | 715 | ||
| 704 | printf ("%s: ", cap); | 716 | return 0; |
| 705 | if (x) | ||
| 706 | { | ||
| 707 | for (y = x; *y; y++) | ||
| 708 | if (*y <= ' ' || *y == 0177) | ||
| 709 | printf ("\\%0o", *y); | ||
| 710 | else | ||
| 711 | putchar (*y); | ||
| 712 | free (x); | ||
| 713 | } | ||
| 714 | else | ||
| 715 | printf ("none"); | ||
| 716 | putchar ('\n'); | ||
| 717 | } | 717 | } |
| 718 | 718 | ||
| 719 | #endif /* TEST */ | 719 | #endif /* TEST */ |
diff --git a/src/tparam.c b/src/tparam.c index 6aae0b97db9..ed28cd7397f 100644 --- a/src/tparam.c +++ b/src/tparam.c | |||
| @@ -265,9 +265,8 @@ tparam1 (const char *string, char *outstring, int len, | |||
| 265 | 265 | ||
| 266 | #ifdef DEBUG | 266 | #ifdef DEBUG |
| 267 | 267 | ||
| 268 | main (argc, argv) | 268 | int |
| 269 | int argc; | 269 | main (int argc, char **argv) |
| 270 | char **argv; | ||
| 271 | { | 270 | { |
| 272 | char buf[50]; | 271 | char buf[50]; |
| 273 | int args[3]; | 272 | int args[3]; |
diff --git a/src/unexhp9k800.c b/src/unexhp9k800.c index f27415a252c..ce65faffd4e 100644 --- a/src/unexhp9k800.c +++ b/src/unexhp9k800.c | |||
| @@ -64,8 +64,7 @@ static long brk_on_dump = 0; | |||
| 64 | 64 | ||
| 65 | /* Called from main, if we use shared libraries. */ | 65 | /* Called from main, if we use shared libraries. */ |
| 66 | int | 66 | int |
| 67 | run_time_remap (ignored) | 67 | run_time_remap (char *ignored) |
| 68 | char *ignored; | ||
| 69 | { | 68 | { |
| 70 | brk ((char *) brk_on_dump); | 69 | brk ((char *) brk_on_dump); |
| 71 | } | 70 | } |
| @@ -74,74 +73,11 @@ run_time_remap (ignored) | |||
| 74 | #define roundup(x,n) (((x) + ((n) - 1)) & ~((n) - 1)) /* n is power of 2 */ | 73 | #define roundup(x,n) (((x) + ((n) - 1)) & ~((n) - 1)) /* n is power of 2 */ |
| 75 | #define min(x,y) (((x) < (y)) ? (x) : (y)) | 74 | #define min(x,y) (((x) < (y)) ? (x) : (y)) |
| 76 | 75 | ||
| 77 | |||
| 78 | /* Create a new a.out file, same as old but with current data space */ | ||
| 79 | void | ||
| 80 | unexec (const char *new_name, /* name of the new a.out file to be created */ | ||
| 81 | const char *old_name) /* name of the old a.out file */ | ||
| 82 | { | ||
| 83 | int old, new; | ||
| 84 | int old_size, new_size; | ||
| 85 | struct header hdr; | ||
| 86 | struct som_exec_auxhdr auxhdr; | ||
| 87 | long i; | ||
| 88 | |||
| 89 | /* For the greatest flexibility, should create a temporary file in | ||
| 90 | the same directory as the new file. When everything is complete, | ||
| 91 | rename the temp file to the new name. | ||
| 92 | This way, a program could update its own a.out file even while | ||
| 93 | it is still executing. If problems occur, everything is still | ||
| 94 | intact. NOT implemented. */ | ||
| 95 | |||
| 96 | /* Open the input and output a.out files */ | ||
| 97 | old = open (old_name, O_RDONLY); | ||
| 98 | if (old < 0) | ||
| 99 | { perror (old_name); exit (1); } | ||
| 100 | new = open (new_name, O_CREAT|O_RDWR|O_TRUNC, 0777); | ||
| 101 | if (new < 0) | ||
| 102 | { perror (new_name); exit (1); } | ||
| 103 | |||
| 104 | /* Read the old headers */ | ||
| 105 | read_header (old, &hdr, &auxhdr); | ||
| 106 | |||
| 107 | brk_on_dump = (long) sbrk (0); | ||
| 108 | |||
| 109 | /* Decide how large the new and old data areas are */ | ||
| 110 | old_size = auxhdr.exec_dsize; | ||
| 111 | /* I suspect these two statements are separate | ||
| 112 | to avoid a compiler bug in hpux version 8. */ | ||
| 113 | i = (long) sbrk (0); | ||
| 114 | new_size = i - auxhdr.exec_dmem; | ||
| 115 | |||
| 116 | /* Copy the old file to the new, up to the data space */ | ||
| 117 | lseek (old, 0, 0); | ||
| 118 | copy_file (old, new, auxhdr.exec_dfile); | ||
| 119 | |||
| 120 | /* Skip the old data segment and write a new one */ | ||
| 121 | lseek (old, old_size, 1); | ||
| 122 | save_data_space (new, &hdr, &auxhdr, new_size); | ||
| 123 | |||
| 124 | /* Copy the rest of the file */ | ||
| 125 | copy_rest (old, new); | ||
| 126 | |||
| 127 | /* Update file pointers since we probably changed size of data area */ | ||
| 128 | update_file_ptrs (new, &hdr, &auxhdr, auxhdr.exec_dfile, new_size-old_size); | ||
| 129 | |||
| 130 | /* Save the modified header */ | ||
| 131 | write_header (new, &hdr, &auxhdr); | ||
| 132 | |||
| 133 | /* Close the binary file */ | ||
| 134 | close (old); | ||
| 135 | close (new); | ||
| 136 | } | ||
| 137 | |||
| 138 | /* Save current data space in the file, update header. */ | 76 | /* Save current data space in the file, update header. */ |
| 139 | 77 | ||
| 140 | save_data_space (file, hdr, auxhdr, size) | 78 | static void |
| 141 | int file; | 79 | save_data_space (int file, struct header *hdr, struct som_exec_auxhdr *auxhdr, |
| 142 | struct header *hdr; | 80 | int size) |
| 143 | struct som_exec_auxhdr *auxhdr; | ||
| 144 | int size; | ||
| 145 | { | 81 | { |
| 146 | /* Write the entire data space out to the file */ | 82 | /* Write the entire data space out to the file */ |
| 147 | if (write (file, auxhdr->exec_dmem, size) != size) | 83 | if (write (file, auxhdr->exec_dmem, size) != size) |
| @@ -154,12 +90,9 @@ save_data_space (file, hdr, auxhdr, size) | |||
| 154 | 90 | ||
| 155 | /* Update the values of file pointers when something is inserted. */ | 91 | /* Update the values of file pointers when something is inserted. */ |
| 156 | 92 | ||
| 157 | update_file_ptrs (file, hdr, auxhdr, location, offset) | 93 | static void |
| 158 | int file; | 94 | update_file_ptrs (int file, struct header *hdr, struct som_exec_auxhdr *auxhdr, |
| 159 | struct header *hdr; | 95 | unsigned int location, int offset) |
| 160 | struct som_exec_auxhdr *auxhdr; | ||
| 161 | unsigned int location; | ||
| 162 | int offset; | ||
| 163 | { | 96 | { |
| 164 | struct subspace_dictionary_record subspace; | 97 | struct subspace_dictionary_record subspace; |
| 165 | int i; | 98 | int i; |
| @@ -205,10 +138,8 @@ update_file_ptrs (file, hdr, auxhdr, location, offset) | |||
| 205 | 138 | ||
| 206 | /* Read in the header records from an a.out file. */ | 139 | /* Read in the header records from an a.out file. */ |
| 207 | 140 | ||
| 208 | read_header (file, hdr, auxhdr) | 141 | static void |
| 209 | int file; | 142 | read_header (int file, struct header *hdr, struct som_exec_auxhdr *auxhdr) |
| 210 | struct header *hdr; | ||
| 211 | struct som_exec_auxhdr *auxhdr; | ||
| 212 | { | 143 | { |
| 213 | 144 | ||
| 214 | /* Read the header in */ | 145 | /* Read the header in */ |
| @@ -233,10 +164,8 @@ read_header (file, hdr, auxhdr) | |||
| 233 | 164 | ||
| 234 | /* Write out the header records into an a.out file. */ | 165 | /* Write out the header records into an a.out file. */ |
| 235 | 166 | ||
| 236 | write_header (file, hdr, auxhdr) | 167 | static void |
| 237 | int file; | 168 | write_header (int file, struct header *hdr, struct som_exec_auxhdr *auxhdr) |
| 238 | struct header *hdr; | ||
| 239 | struct som_exec_auxhdr *auxhdr; | ||
| 240 | { | 169 | { |
| 241 | /* Update the checksum */ | 170 | /* Update the checksum */ |
| 242 | hdr->checksum = calculate_checksum (hdr); | 171 | hdr->checksum = calculate_checksum (hdr); |
| @@ -252,8 +181,8 @@ write_header (file, hdr, auxhdr) | |||
| 252 | 181 | ||
| 253 | /* Calculate the checksum of a SOM header record. */ | 182 | /* Calculate the checksum of a SOM header record. */ |
| 254 | 183 | ||
| 255 | calculate_checksum (hdr) | 184 | static int |
| 256 | struct header *hdr; | 185 | calculate_checksum (struct header *hdr) |
| 257 | { | 186 | { |
| 258 | int checksum, i, *ptr; | 187 | int checksum, i, *ptr; |
| 259 | 188 | ||
| @@ -267,9 +196,8 @@ calculate_checksum (hdr) | |||
| 267 | 196 | ||
| 268 | /* Copy size bytes from the old file to the new one. */ | 197 | /* Copy size bytes from the old file to the new one. */ |
| 269 | 198 | ||
| 270 | copy_file (old, new, size) | 199 | static void |
| 271 | int new, old; | 200 | copy_file (int old, int new, int size) |
| 272 | int size; | ||
| 273 | { | 201 | { |
| 274 | int len; | 202 | int len; |
| 275 | int buffer[8192]; /* word aligned will be faster */ | 203 | int buffer[8192]; /* word aligned will be faster */ |
| @@ -286,8 +214,8 @@ copy_file (old, new, size) | |||
| 286 | 214 | ||
| 287 | /* Copy the rest of the file, up to EOF. */ | 215 | /* Copy the rest of the file, up to EOF. */ |
| 288 | 216 | ||
| 289 | copy_rest (old, new) | 217 | static void |
| 290 | int new, old; | 218 | copy_rest (int old, int new) |
| 291 | { | 219 | { |
| 292 | int buffer[4096]; | 220 | int buffer[4096]; |
| 293 | int len; | 221 | int len; |
| @@ -301,9 +229,8 @@ copy_rest (old, new) | |||
| 301 | } | 229 | } |
| 302 | 230 | ||
| 303 | #ifdef DEBUG | 231 | #ifdef DEBUG |
| 304 | display_header (hdr, auxhdr) | 232 | static void |
| 305 | struct header *hdr; | 233 | display_header (struct header *hdr, struct som_exec_auxhdr *auxhdr) |
| 306 | struct som_exec_auxhdr *auxhdr; | ||
| 307 | { | 234 | { |
| 308 | /* Display the header information (debug) */ | 235 | /* Display the header information (debug) */ |
| 309 | printf ("\n\nFILE HEADER\n"); | 236 | printf ("\n\nFILE HEADER\n"); |
| @@ -320,3 +247,64 @@ display_header (hdr, auxhdr) | |||
| 320 | hdr->unloadable_sp_location, hdr->unloadable_sp_size); | 247 | hdr->unloadable_sp_location, hdr->unloadable_sp_size); |
| 321 | } | 248 | } |
| 322 | #endif /* DEBUG */ | 249 | #endif /* DEBUG */ |
| 250 | |||
| 251 | |||
| 252 | /* Create a new a.out file, same as old but with current data space */ | ||
| 253 | void | ||
| 254 | unexec (const char *new_name, /* name of the new a.out file to be created */ | ||
| 255 | const char *old_name) /* name of the old a.out file */ | ||
| 256 | { | ||
| 257 | int old, new; | ||
| 258 | int old_size, new_size; | ||
| 259 | struct header hdr; | ||
| 260 | struct som_exec_auxhdr auxhdr; | ||
| 261 | long i; | ||
| 262 | |||
| 263 | /* For the greatest flexibility, should create a temporary file in | ||
| 264 | the same directory as the new file. When everything is complete, | ||
| 265 | rename the temp file to the new name. | ||
| 266 | This way, a program could update its own a.out file even while | ||
| 267 | it is still executing. If problems occur, everything is still | ||
| 268 | intact. NOT implemented. */ | ||
| 269 | |||
| 270 | /* Open the input and output a.out files */ | ||
| 271 | old = open (old_name, O_RDONLY); | ||
| 272 | if (old < 0) | ||
| 273 | { perror (old_name); exit (1); } | ||
| 274 | new = open (new_name, O_CREAT|O_RDWR|O_TRUNC, 0777); | ||
| 275 | if (new < 0) | ||
| 276 | { perror (new_name); exit (1); } | ||
| 277 | |||
| 278 | /* Read the old headers */ | ||
| 279 | read_header (old, &hdr, &auxhdr); | ||
| 280 | |||
| 281 | brk_on_dump = (long) sbrk (0); | ||
| 282 | |||
| 283 | /* Decide how large the new and old data areas are */ | ||
| 284 | old_size = auxhdr.exec_dsize; | ||
| 285 | /* I suspect these two statements are separate | ||
| 286 | to avoid a compiler bug in hpux version 8. */ | ||
| 287 | i = (long) sbrk (0); | ||
| 288 | new_size = i - auxhdr.exec_dmem; | ||
| 289 | |||
| 290 | /* Copy the old file to the new, up to the data space */ | ||
| 291 | lseek (old, 0, 0); | ||
| 292 | copy_file (old, new, auxhdr.exec_dfile); | ||
| 293 | |||
| 294 | /* Skip the old data segment and write a new one */ | ||
| 295 | lseek (old, old_size, 1); | ||
| 296 | save_data_space (new, &hdr, &auxhdr, new_size); | ||
| 297 | |||
| 298 | /* Copy the rest of the file */ | ||
| 299 | copy_rest (old, new); | ||
| 300 | |||
| 301 | /* Update file pointers since we probably changed size of data area */ | ||
| 302 | update_file_ptrs (new, &hdr, &auxhdr, auxhdr.exec_dfile, new_size-old_size); | ||
| 303 | |||
| 304 | /* Save the modified header */ | ||
| 305 | write_header (new, &hdr, &auxhdr); | ||
| 306 | |||
| 307 | /* Close the binary file */ | ||
| 308 | close (old); | ||
| 309 | close (new); | ||
| 310 | } | ||
| @@ -1452,6 +1452,14 @@ sigprocmask (int how, const sigset_t *set, sigset_t *oset) | |||
| 1452 | } | 1452 | } |
| 1453 | 1453 | ||
| 1454 | int | 1454 | int |
| 1455 | pthread_sigmask (int how, const sigset_t *set, sigset_t *oset) | ||
| 1456 | { | ||
| 1457 | if (sigprocmask (how, set, oset) == -1) | ||
| 1458 | return EINVAL; | ||
| 1459 | return 0; | ||
| 1460 | } | ||
| 1461 | |||
| 1462 | int | ||
| 1455 | setpgrp (int pid, int gid) | 1463 | setpgrp (int pid, int gid) |
| 1456 | { | 1464 | { |
| 1457 | return 0; | 1465 | return 0; |
diff --git a/src/widget.c b/src/widget.c index 6d871ad7cb2..a09ec2631ad 100644 --- a/src/widget.c +++ b/src/widget.c | |||
| @@ -224,8 +224,7 @@ get_wm_shell (Widget w) | |||
| 224 | #if 0 /* Currently not used. */ | 224 | #if 0 /* Currently not used. */ |
| 225 | 225 | ||
| 226 | static void | 226 | static void |
| 227 | mark_shell_size_user_specified (wmshell) | 227 | mark_shell_size_user_specified (Widget wmshell) |
| 228 | Widget wmshell; | ||
| 229 | { | 228 | { |
| 230 | if (! XtIsWMShell (wmshell)) abort (); | 229 | if (! XtIsWMShell (wmshell)) abort (); |
| 231 | /* This is kind of sleazy, but I can't see how else to tell it to make it | 230 | /* This is kind of sleazy, but I can't see how else to tell it to make it |
| @@ -510,8 +509,7 @@ update_wm_hints (EmacsFrame ew) | |||
| 510 | #if 0 | 509 | #if 0 |
| 511 | 510 | ||
| 512 | static void | 511 | static void |
| 513 | create_frame_gcs (ew) | 512 | create_frame_gcs (EmacsFrame ew) |
| 514 | EmacsFrame ew; | ||
| 515 | { | 513 | { |
| 516 | struct frame *s = ew->emacs_frame.frame; | 514 | struct frame *s = ew->emacs_frame.frame; |
| 517 | 515 | ||
diff --git a/src/xdisp.c b/src/xdisp.c index dfaa9cdeac3..a4a9e236a9e 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -2209,8 +2209,7 @@ safe_call2 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2) | |||
| 2209 | This is for debugging. It is too slow to do unconditionally. */ | 2209 | This is for debugging. It is too slow to do unconditionally. */ |
| 2210 | 2210 | ||
| 2211 | static void | 2211 | static void |
| 2212 | check_it (it) | 2212 | check_it (struct it *it) |
| 2213 | struct it *it; | ||
| 2214 | { | 2213 | { |
| 2215 | if (it->method == GET_FROM_STRING) | 2214 | if (it->method == GET_FROM_STRING) |
| 2216 | { | 2215 | { |
| @@ -10510,7 +10509,7 @@ DEFUN ("tool-bar-lines-needed", Ftool_bar_lines_needed, Stool_bar_lines_needed, | |||
| 10510 | f = XFRAME (frame); | 10509 | f = XFRAME (frame); |
| 10511 | 10510 | ||
| 10512 | if (WINDOWP (f->tool_bar_window) | 10511 | if (WINDOWP (f->tool_bar_window) |
| 10513 | || (w = XWINDOW (f->tool_bar_window), | 10512 | && (w = XWINDOW (f->tool_bar_window), |
| 10514 | WINDOW_TOTAL_LINES (w) > 0)) | 10513 | WINDOW_TOTAL_LINES (w) > 0)) |
| 10515 | { | 10514 | { |
| 10516 | update_tool_bar (f, 1); | 10515 | update_tool_bar (f, 1); |
diff --git a/src/xfaces.c b/src/xfaces.c index 91f4b133466..c1e75ab3e59 100644 --- a/src/xfaces.c +++ b/src/xfaces.c | |||
| @@ -536,8 +536,7 @@ int color_count[256]; | |||
| 536 | /* Register color PIXEL as allocated. */ | 536 | /* Register color PIXEL as allocated. */ |
| 537 | 537 | ||
| 538 | void | 538 | void |
| 539 | register_color (pixel) | 539 | register_color (unsigned long pixel) |
| 540 | unsigned long pixel; | ||
| 541 | { | 540 | { |
| 542 | xassert (pixel < 256); | 541 | xassert (pixel < 256); |
| 543 | ++color_count[pixel]; | 542 | ++color_count[pixel]; |
| @@ -547,8 +546,7 @@ register_color (pixel) | |||
| 547 | /* Register color PIXEL as deallocated. */ | 546 | /* Register color PIXEL as deallocated. */ |
| 548 | 547 | ||
| 549 | void | 548 | void |
| 550 | unregister_color (pixel) | 549 | unregister_color (unsigned long pixel) |
| 551 | unsigned long pixel; | ||
| 552 | { | 550 | { |
| 553 | xassert (pixel < 256); | 551 | xassert (pixel < 256); |
| 554 | if (color_count[pixel] > 0) | 552 | if (color_count[pixel] > 0) |
| @@ -561,9 +559,7 @@ unregister_color (pixel) | |||
| 561 | /* Register N colors from PIXELS as deallocated. */ | 559 | /* Register N colors from PIXELS as deallocated. */ |
| 562 | 560 | ||
| 563 | void | 561 | void |
| 564 | unregister_colors (pixels, n) | 562 | unregister_colors (unsigned long *pixels, int n) |
| 565 | unsigned long *pixels; | ||
| 566 | int n; | ||
| 567 | { | 563 | { |
| 568 | int i; | 564 | int i; |
| 569 | for (i = 0; i < n; ++i) | 565 | for (i = 0; i < n; ++i) |
diff --git a/src/xfns.c b/src/xfns.c index c70f4bb9a82..0d1e4a1bb5e 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -2001,11 +2001,8 @@ xic_create_fontsetname (const char *base_fontname, int motif) | |||
| 2001 | 2001 | ||
| 2002 | #ifdef DEBUG_XIC_FONTSET | 2002 | #ifdef DEBUG_XIC_FONTSET |
| 2003 | static void | 2003 | static void |
| 2004 | print_fontset_result (xfs, name, missing_list, missing_count) | 2004 | print_fontset_result (XFontSet xfs, char *name, char **missing_list, |
| 2005 | XFontSet xfs; | 2005 | int missing_count) |
| 2006 | char *name; | ||
| 2007 | char **missing_list; | ||
| 2008 | int missing_count; | ||
| 2009 | { | 2006 | { |
| 2010 | if (xfs) | 2007 | if (xfs) |
| 2011 | fprintf (stderr, "XIC Fontset created: %s\n", name); | 2008 | fprintf (stderr, "XIC Fontset created: %s\n", name); |
diff --git a/src/xmenu.c b/src/xmenu.c index fc629b35104..b4338c1d653 100644 --- a/src/xmenu.c +++ b/src/xmenu.c | |||
| @@ -740,10 +740,13 @@ menu_highlight_callback (GtkWidget *widget, gpointer call_data) | |||
| 740 | help = call_data ? cb_data->help : Qnil; | 740 | help = call_data ? cb_data->help : Qnil; |
| 741 | 741 | ||
| 742 | /* If popup_activated_flag is greater than 1 we are in a popup menu. | 742 | /* If popup_activated_flag is greater than 1 we are in a popup menu. |
| 743 | Don't show help for them, they won't appear before the | 743 | Don't pass the frame to show_help_event for those. |
| 744 | popup is popped down. */ | 744 | Passing frame creates an Emacs event. As we are looping in |
| 745 | if (popup_activated_flag <= 1) | 745 | popup_widget_loop, it won't be handeled. Passing NULL shows the tip |
| 746 | show_help_event (cb_data->cl_data->f, widget, help); | 746 | directly without using an Emacs event. This is what the Lucid code |
| 747 | does below. */ | ||
| 748 | show_help_event (popup_activated_flag <= 1 ? cb_data->cl_data->f : NULL, | ||
| 749 | widget, help); | ||
| 747 | } | 750 | } |
| 748 | #else | 751 | #else |
| 749 | static void | 752 | static void |
diff --git a/src/xrdb.c b/src/xrdb.c index e18ff65f799..6a16e3260bd 100644 --- a/src/xrdb.c +++ b/src/xrdb.c | |||
| @@ -651,9 +651,7 @@ typedef char **List; | |||
| 651 | #define free_arglist(list) | 651 | #define free_arglist(list) |
| 652 | 652 | ||
| 653 | static List | 653 | static List |
| 654 | member (elt, list) | 654 | member (char *elt, List list) |
| 655 | char *elt; | ||
| 656 | List list; | ||
| 657 | { | 655 | { |
| 658 | List p; | 656 | List p; |
| 659 | 657 | ||
| @@ -665,20 +663,17 @@ member (elt, list) | |||
| 665 | } | 663 | } |
| 666 | 664 | ||
| 667 | static void | 665 | static void |
| 668 | fatal (msg, prog, x1, x2, x3, x4, x5) | 666 | fatal (char *msg, char *prog) |
| 669 | char *msg, *prog; | ||
| 670 | int x1, x2, x3, x4, x5; | ||
| 671 | { | 667 | { |
| 672 | if (errno) | 668 | if (errno) |
| 673 | perror (prog); | 669 | perror (prog); |
| 674 | 670 | ||
| 675 | (void) fprintf (stderr, msg, prog, x1, x2, x3, x4, x5); | 671 | (void) fprintf (stderr, msg, prog); |
| 676 | exit (1); | 672 | exit (1); |
| 677 | } | 673 | } |
| 678 | 674 | ||
| 679 | main (argc, argv) | 675 | int |
| 680 | int argc; | 676 | main (int argc, char **argv) |
| 681 | char **argv; | ||
| 682 | { | 677 | { |
| 683 | Display *display; | 678 | Display *display; |
| 684 | char *displayname, *resource_string, *class, *name; | 679 | char *displayname, *resource_string, *class, *name; |
| @@ -749,5 +744,7 @@ main (argc, argv) | |||
| 749 | printf ("\tExit.\n\n"); | 744 | printf ("\tExit.\n\n"); |
| 750 | 745 | ||
| 751 | XCloseDisplay (display); | 746 | XCloseDisplay (display); |
| 747 | |||
| 748 | return 0; | ||
| 752 | } | 749 | } |
| 753 | #endif /* TESTRM */ | 750 | #endif /* TESTRM */ |