diff options
author | Stu Grossman <grossman@cygnus> | 1992-11-04 23:34:54 +0000 |
---|---|---|
committer | Stu Grossman <grossman@cygnus> | 1992-11-04 23:34:54 +0000 |
commit | da60a50dc306c1281f0649847950ea9bc08bb073 (patch) | |
tree | 6774ea0b1ebc43dd4fdc20208013f47e7af0c0d7 | |
parent | 740b7efa43f092a7732fabd39d5597a7a2f310b3 (diff) | |
download | gdb-da60a50dc306c1281f0649847950ea9bc08bb073.zip gdb-da60a50dc306c1281f0649847950ea9bc08bb073.tar.gz gdb-da60a50dc306c1281f0649847950ea9bc08bb073.tar.bz2 |
* readline.c: Cast many uses of alloca to (char *) to make brain-
damaged compilers happy.
* sysdep-norm.h: Remove some crud, install dire warning.
-rw-r--r-- | readline/ChangeLog | 6 | ||||
-rw-r--r-- | readline/readline.c | 23 | ||||
-rw-r--r-- | readline/sysdep-norm.h | 6 |
3 files changed, 23 insertions, 12 deletions
diff --git a/readline/ChangeLog b/readline/ChangeLog index 8d7656c..194a5af 100644 --- a/readline/ChangeLog +++ b/readline/ChangeLog @@ -1,3 +1,9 @@ +Wed Nov 4 15:32:31 1992 Stu Grossman (grossman at cygnus.com) + + * readline.c: Cast many uses of alloca to (char *) to make brain- + damaged compilers happy. + * sysdep-norm.h: Remove some crud, install dire warning. + Thu Oct 22 01:08:13 1992 Stu Grossman (grossman at cygnus.com) * configure.in: Make SCO work again... diff --git a/readline/readline.c b/readline/readline.c index b888f30..32ca4b7 100644 --- a/readline/readline.c +++ b/readline/readline.c @@ -2101,7 +2101,7 @@ init_terminal_io (terminal_name) if (!term) term = "dumb"; - if (tgetent (term_buffer, term) < 0) + if (tgetent (term_buffer, term) <= 0) { dumb_term = 1; screenwidth = 79; @@ -3081,7 +3081,7 @@ rl_insert (count, c) readline because of extra large arguments. */ if (count > 1 && count < 1024) { - string = (char *)alloca (1 + count); + string = alloca (1 + count); for (i = 0; i < count; i++) string[i] = c; @@ -3095,7 +3095,7 @@ rl_insert (count, c) { int decreaser; - string = (char *)alloca (1024 + 1); + string = alloca (1024 + 1); for (i = 0; i < 1024; i++) string[i] = c; @@ -3119,7 +3119,7 @@ rl_insert (count, c) int key = 0, t; i = 0; - string = (char *)alloca (ibuffer_len + 1); + string = alloca (ibuffer_len + 1); string[i++] = c; while ((t = rl_get_char (&key)) && @@ -3137,7 +3137,7 @@ rl_insert (count, c) else { /* Inserting a single character. */ - string = (char *)alloca (2); + string = alloca (2); string[1] = '\0'; string[0] = c; @@ -4591,8 +4591,7 @@ rl_display_search (search_string, reverse_p, where) { char *message = (char *)NULL; - message = - (char *)alloca (1 + (search_string ? strlen (search_string) : 0) + 30); + message = alloca (1 + (search_string ? strlen (search_string) : 0) + 30); *message = '\0'; @@ -4625,7 +4624,7 @@ rl_search_history (direction, invoking_key) int invoking_key; { /* The string that the user types in to search for. */ - char *search_string = (char *)alloca (128); + char *search_string = alloca (128); /* The current length of SEARCH_STRING. */ int search_string_index; @@ -4661,7 +4660,7 @@ rl_search_history (direction, invoking_key) /* Allocate space for this many lines, +1 for the current input line, and remember those lines. */ - lines = (char **)alloca ((1 + (hlen = i)) * sizeof (char *)); + lines = alloca ((1 + (hlen = i)) * sizeof (char *)); for (i = 0; i < hlen; i++) lines[i] = hlist[i]->line; @@ -4673,7 +4672,7 @@ rl_search_history (direction, invoking_key) char *alloced_line; /* Keep that mips alloca happy. */ - alloced_line = (char *)alloca (1 + strlen (the_line)); + alloced_line = alloca (1 + strlen (the_line)); lines[i] = alloced_line; strcpy (lines[i], &the_line[0]); } @@ -5542,7 +5541,7 @@ rl_generic_bind (type, keyseq, data, map) return; } - keys = (char *)alloca (1 + (2 * strlen (keyseq))); + keys = alloca (1 + (2 * strlen (keyseq))); /* Translate the ASCII representation of KEYSEQ into an array of characters. Stuff the characters into ARRAY, and the @@ -6007,7 +6006,7 @@ rl_parse_and_bind (string) rl_set_key (). Otherwise, let the older code deal with it. */ if (*string == '"') { - char *seq = (char *)alloca (1 + strlen (string)); + char *seq = alloca (1 + strlen (string)); register int j, k = 0; for (j = 1; string[j]; j++) diff --git a/readline/sysdep-norm.h b/readline/sysdep-norm.h index 9df4040..cb89f43 100644 --- a/readline/sysdep-norm.h +++ b/readline/sysdep-norm.h @@ -1,4 +1,10 @@ /* System-dependent stuff, for ``normal'' systems */ +/* If you think you need to change this file, then you are wrong. In order to + avoid a huge ugly mass of nested #ifdefs, you should create a new file just + for your system, which contains exactly those #includes and definitions that + your system needs, AND NOTHING MORE! Then, add that file to the appropriate + place in configure.in, and viola, you are done. sysdep-sunos4.h is a good + example of how to do this. */ #ifdef __GNUC__ #define alloca __builtin_alloca |