aboutsummaryrefslogtreecommitdiff
path: root/gdb/utils.c
diff options
context:
space:
mode:
authorJohn Gilmore <gnu@cygnus>1992-02-20 19:23:42 +0000
committerJohn Gilmore <gnu@cygnus>1992-02-20 19:23:42 +0000
commit088c3a0b74c7431d31ec5d095f4e68bdd2d90c0b (patch)
tree0ce19e10e2ec6ba41392bf245df0841bfde317bc /gdb/utils.c
parent8b87cbae28c26fd9b5bed99eb134f6c66ee946ac (diff)
downloadgdb-088c3a0b74c7431d31ec5d095f4e68bdd2d90c0b.zip
gdb-088c3a0b74c7431d31ec5d095f4e68bdd2d90c0b.tar.gz
gdb-088c3a0b74c7431d31ec5d095f4e68bdd2d90c0b.tar.bz2
* defs.h: Include ansidecl.h and PARAMS macro. Use PARAMS
to make prototypes for all functions declared here. * cplus-dem.c: Avoid declaring xmalloc and xrealloc. * c-exp.y: Rename SIGNED, OR, and AND to avoid conflict. * environ.c: Include <stdio.h> before defs.h. Minor cleanup. * ieee-float.h: Use PARAMS for prototypes; make some params const. * ieee-float.c, valarith.c: Include <stdio.h>. Lint. b*=>mem*. * m2-exp.y: Remove unused CONST; Rename OR and AND. * utils.c: Avoid declaring malloc and realloc. Lint. (request_quit): Accept signal-number parameter.
Diffstat (limited to 'gdb/utils.c')
-rw-r--r--gdb/utils.c33
1 files changed, 23 insertions, 10 deletions
diff --git a/gdb/utils.c b/gdb/utils.c
index ab48cec..3fba8bf 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -36,8 +36,6 @@ extern volatile void return_to_top_level ();
extern volatile void exit ();
extern char *gdb_readline ();
extern char *getenv();
-extern char *malloc();
-extern char *realloc();
/* If this definition isn't overridden by the header files, assume
that isatty and fileno exist on this system. */
@@ -166,6 +164,21 @@ free_current_contents (location)
{
free (*location);
}
+
+/* Provide a known function that does nothing, to use as a base for
+ for a possibly long chain of cleanups. This is useful where we
+ use the cleanup chain for handling normal cleanups as well as dealing
+ with cleanups that need to be done as a result of a call to error().
+ In such cases, we may not be certain where the first cleanup is, unless
+ we have a do-nothing one to always use as the base. */
+
+/* ARGSUSED */
+void
+null_cleanup (arg)
+ char **arg;
+{
+}
+
/* Provide a hook for modules wishing to print their own warning messages
to set up the terminal state in a compatible way, without them having
@@ -417,13 +430,14 @@ quit ()
/* Control C comes here */
void
-request_quit ()
+request_quit (signo)
+ int signo;
{
quit_flag = 1;
#ifdef USG
/* Restore the signal handler. */
- signal (SIGINT, request_quit);
+ signal (signo, request_quit);
#endif
if (immediate_quit)
@@ -461,7 +475,7 @@ myread (desc, addr, len)
char *
savestring (ptr, size)
- char *ptr;
+ const char *ptr;
int size;
{
register char *p = (char *) xmalloc (size + 1);
@@ -619,16 +633,15 @@ parse_escape (string_ptr)
}
}
-/* Print the character CH on STREAM as part of the contents
+/* Print the character C on STREAM as part of the contents
of a literal string whose delimiter is QUOTER. */
void
-printchar (ch, stream, quoter)
- unsigned char ch;
+printchar (c, stream, quoter)
+ register int c;
FILE *stream;
int quoter;
{
- register int c = ch;
if (c < 040 || (sevenbit_strings && c >= 0177)) {
switch (c)
@@ -788,7 +801,7 @@ wrap_here(indent)
void
fputs_filtered (linebuffer, stream)
- char *linebuffer;
+ const char *linebuffer;
FILE *stream;
{
char *lineptr;