aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog68
-rw-r--r--src/alloc.c2
-rw-r--r--src/buffer.c115
-rw-r--r--src/chartab.c8
-rw-r--r--src/cm.c3
-rw-r--r--src/composite.c1
-rw-r--r--src/data.c3
-rw-r--r--src/dispnew.c3
-rw-r--r--src/emacs.c3
-rw-r--r--src/floatfns.c3
-rw-r--r--src/font.c29
-rw-r--r--src/gtkutil.c1
-rw-r--r--src/image.c4
-rw-r--r--src/indent.c3
-rw-r--r--src/intervals.c24
-rw-r--r--src/lread.c4
-rw-r--r--src/ralloc.c2
-rw-r--r--src/regex.c17
-rw-r--r--src/sysdep.c3
-rw-r--r--src/termcap.c50
-rw-r--r--src/tparam.c5
-rw-r--r--src/unexhp9k800.c172
-rw-r--r--src/w32.c8
-rw-r--r--src/widget.c6
-rw-r--r--src/xdisp.c5
-rw-r--r--src/xfaces.c10
-rw-r--r--src/xfns.c7
-rw-r--r--src/xmenu.c11
-rw-r--r--src/xrdb.c23
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 @@
12011-07-09 Paul Eggert <eggert@cs.ucla.edu> 12011-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
1542011-07-10 Johan Bockgård <bojohan@gnu.org>
155
156 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
157
1582011-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
1632011-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
2002011-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
2082011-07-09 Juanma Barranquero <lekktu@gmail.com>
209
210 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
211
2122011-07-09 Jan Djärv <jan.h.d@swipnet.se>
213
214 * gtkutil.c (qttip_cb): Remove code without function.
215
2162011-07-09 Eli Zaretskii <eliz@gnu.org>
217
218 * w32.c (pthread_sigmask): New stub.
219
1542011-07-08 Paul Eggert <eggert@cs.ucla.edu> 2202011-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
1279void 1279void
1280reset_malloc_hooks () 1280reset_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
4471static int mmap_free_1 (struct mmap_region *); 4471static void
4472static int mmap_enlarge (struct mmap_region *, int); 4472mmap_init (void)
4473static struct mmap_region *mmap_find (POINTER_TYPE *, POINTER_TYPE *); 4473{
4474static POINTER_TYPE *mmap_alloc (POINTER_TYPE **, size_t); 4474#if MAP_ANON == 0
4475static POINTER_TYPE *mmap_realloc (POINTER_TYPE **, size_t); 4475 /* The value of mmap_fd is initially 0 in temacs, and -1
4476static void mmap_free (POINTER_TYPE **ptr); 4476 in a dumped Emacs. */
4477static 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
4484static struct mmap_region * 4501static struct mmap_region *
4485mmap_find (start, end) 4502mmap_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
4514static int 4530static int
4515mmap_free_1 (r) 4531mmap_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
4538static int 4553static int
4539mmap_enlarge (r, npages) 4554mmap_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
4604void 4617void
4605mmap_set_vars (restore_p) 4618mmap_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
4638static POINTER_TYPE * 4650static POINTER_TYPE *
4639mmap_alloc (var, nbytes) 4651mmap_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
4691static void
4692mmap_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
4683static POINTER_TYPE * 4709static POINTER_TYPE *
4684mmap_realloc (var, nbytes) 4710mmap_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
4759static void
4760mmap_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
4775static void
4776mmap_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
485char_table_set_range (Lisp_Object table, int from, int to, Lisp_Object val) 485char_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
1319Lisp_Object 1313static Lisp_Object
1320uniprop_table (Lisp_Object prop) 1314uniprop_table (Lisp_Object prop)
1321{ 1315{
1322 Lisp_Object val, table, result; 1316 Lisp_Object val, table, result;
diff --git a/src/cm.c b/src/cm.c
index 42f855f1694..609632eba11 100644
--- a/src/cm.c
+++ b/src/cm.c
@@ -305,7 +305,8 @@ done:
305} 305}
306 306
307#if 0 307#if 0
308losecursor () 308void
309losecursor (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
969static Lisp_Object _work_val; 969static Lisp_Object _work_val;
970static 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
2735double 2735double
2736fmod (f1, f2) 2736fmod (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
1031static void 1031static void
1032swap_glyphs_in_rows (a, b) 1032swap_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. */
358void 358void
359memory_warning_signal (sig) 359memory_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
960static void 960static void
961float_error (signo) 961float_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
1740static int 1740static int
1741check_gstring (gstring) 1741check_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
1795static void 1794static void
1796check_otf_features (otf_features) 1795check_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)
1827Lisp_Object otf_list; 1825Lisp_Object otf_list;
1828 1826
1829static Lisp_Object 1827static Lisp_Object
1830otf_tag_symbol (tag) 1828otf_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
1839static OTF * 1836static OTF *
1840otf_open (file) 1837otf_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
1862Lisp_Object 1858Lisp_Object
1863font_otf_capability (font) 1859font_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
1937static void 1932static void
1938generate_otf_features (spec, features) 1933generate_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
1974Lisp_Object 1967Lisp_Object
1975font_otf_DeviceTable (device_table) 1968font_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
1984Lisp_Object 1976Lisp_Object
1985font_otf_ValueRecord (value_format, value_record) 1977font_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
2010Lisp_Object 2000Lisp_Object
2011font_otf_Anchor (anchor) 2001font_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
5004static char * 5004static char *
5005pbm_read_file (file, size) 5005pbm_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
727static double 727static double
728string_display_width (string, beg, end) 728string_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;
247INTERVAL search_interval, found_interval; 247INTERVAL search_interval, found_interval;
248 248
249void 249void
250check_for_interval (i) 250check_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
260INTERVAL 259INTERVAL
261search_for_interval (i, tree) 260search_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
271static void 269static void
272inc_interval_count (i) 270inc_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
282int 279int
283count_intervals (i) 280count_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
294static INTERVAL 290static INTERVAL
295root_interval (interval) 291root_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
806static INTERVAL 801static INTERVAL
807adjust_intervals_for_insertion (tree, position, length) 802adjust_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
1617static INTERVAL 1611static INTERVAL
1618make_new_interval (intervals, start, length) 1612make_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 */
3983void 3983void
3984defalias (sname, string) 3984defalias (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
1081void 1081void
1082r_alloc_check () 1082r_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
2171static int 2171static int
2172set_image_of_range_1 (work_area, start, end, translate) 2172set_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
2324static int 2323static int
2325set_image_of_range (work_area, start, end, translate) 2324set_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
2414static 2412static
2415regex_grow_registers (num_regs) 2413regex_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
1802char * 1802char *
1803strerror (errnum) 1803strerror (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 */
340static int 340static int
341valid_filename_p (fn) 341valid_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
672main (argc, argv) 671static void
673 int argc; 672tprint (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
692int
693main (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
698tprint (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
268main (argc, argv) 268int
269 int argc; 269main (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. */
66int 66int
67run_time_remap (ignored) 67run_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 */
79void
80unexec (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
140save_data_space (file, hdr, auxhdr, size) 78static void
141 int file; 79save_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
157update_file_ptrs (file, hdr, auxhdr, location, offset) 93static void
158 int file; 94update_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
208read_header (file, hdr, auxhdr) 141static void
209 int file; 142read_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
236write_header (file, hdr, auxhdr) 167static void
237 int file; 168write_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
255calculate_checksum (hdr) 184static int
256 struct header *hdr; 185calculate_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
270copy_file (old, new, size) 199static void
271 int new, old; 200copy_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
289copy_rest (old, new) 217static void
290 int new, old; 218copy_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
304display_header (hdr, auxhdr) 232static void
305 struct header *hdr; 233display_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 */
253void
254unexec (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}
diff --git a/src/w32.c b/src/w32.c
index 53bf2e811e2..de72e180c62 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -1452,6 +1452,14 @@ sigprocmask (int how, const sigset_t *set, sigset_t *oset)
1452} 1452}
1453 1453
1454int 1454int
1455pthread_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
1462int
1455setpgrp (int pid, int gid) 1463setpgrp (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
226static void 226static void
227mark_shell_size_user_specified (wmshell) 227mark_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
512static void 511static void
513create_frame_gcs (ew) 512create_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
2211static void 2211static void
2212check_it (it) 2212check_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
538void 538void
539register_color (pixel) 539register_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
549void 548void
550unregister_color (pixel) 549unregister_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
563void 561void
564unregister_colors (pixels, n) 562unregister_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
2003static void 2003static void
2004print_fontset_result (xfs, name, missing_list, missing_count) 2004print_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
749static void 752static 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
653static List 653static List
654member (elt, list) 654member (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
667static void 665static void
668fatal (msg, prog, x1, x2, x3, x4, x5) 666fatal (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
679main (argc, argv) 675int
680 int argc; 676main (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 */