This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[commit] Coding cleanups
- From: Andrew Cagney <ac131313 at redhat dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Thu, 09 Jan 2003 13:04:35 -0500
- Subject: [commit] Coding cleanups
FYI,
committed,
Andrew
2003-01-09 Andrew Cagney <ac131313@redhat.com>
* infrun.c (follow_fork): Use ISO C definition.
* expprint.c (print_subexp): Use xfree instead of free.
* charset.c: Include "gdb_string.h" instead of <string.h>.
(register_iconv_charsets): Use ISO C definition.
(host_charset, target_charset): Ditto.
* Makefile.in (charset.o): Update dependencies.
(mi-cmd-env.o): Update dependencies.
Index: mi/ChangeLog
2003-01-09 Andrew Cagney <ac131313@redhat.com>
* mi-cmd-env.c: Include "gdb_string.h" instead of <string.h>.
Move all includes to after "defs.h".
Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.310
diff -u -r1.310 Makefile.in
--- Makefile.in 6 Jan 2003 20:45:30 -0000 1.310
+++ Makefile.in 9 Jan 2003 18:00:59 -0000
@@ -1561,7 +1561,8 @@
c-valprint.o: c-valprint.c $(defs_h) $(gdb_string_h) $(symtab_h) \
$(gdbtypes_h) $(expression_h) $(value_h) $(valprint_h) $(language_h) \
$(c_lang_h) $(cp_abi_h)
-charset.o: charset.c $(defs_h) $(charset_h) $(gdbcmd_h) gdb_assert.h
+charset.o: charset.c $(defs_h) $(charset_h) $(gdbcmd_h) $(gdb_assert_h) \
+ $(gdb_string_h)
cli-out.o: cli-out.c $(defs_h) $(ui_out_h) $(cli_out_h) $(gdb_string_h) \
$(gdb_assert_h)
coff-solib.o: coff-solib.c $(defs_h) $(frame_h) $(bfd_h) $(gdbcore_h) \
@@ -2496,9 +2497,9 @@
mi-cmd-disas.o: $(srcdir)/mi/mi-cmd-disas.c $(defs_h) $(target_h) $(value_h) \
$(mi_cmds_h) $(mi_getopt_h) $(ui_out_h) $(gdb_string_h) $(disasm_h)
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-disas.c
-mi-cmd-env.o: $(srcdir)/mi/mi-cmd-env.c $(defs_h) $(mi_cmds_h) $(ui_out_h) \
- $(mi_out_h) $(varobj_h) $(value_h) $(gdb_string_h) $(inferior.h) \
- $(mi_getopt_h) $(environ_h) $(gdbcmd_h) $(top_h)
+mi-cmd-env.o: $(srcdir)/mi/mi-cmd-env.c $(defs_h) $(inferior_h) $(value_h) \
+ $(mi_out_h) $(mi_cmds_h) $(mi_getopt_h) $(symtab_h) $(target_h) \
+ $(environ_h) $(command_h) $(ui_out_h) $(top_h) $(gdb_string_h)
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-env.c
mi-cmd-stack.o: $(srcdir)/mi/mi-cmd-stack.c $(defs_h) $(target_h) $(frame_h) \
$(value_h) $(mi_cmds_h) $(ui_out_h) $(symtab_h)
Index: charset.c
===================================================================
RCS file: /cvs/src/src/gdb/charset.c,v
retrieving revision 1.1
diff -u -r1.1 charset.c
--- charset.c 20 Sep 2002 00:24:01 -0000 1.1
+++ charset.c 9 Jan 2003 18:00:59 -0000
@@ -24,7 +24,7 @@
#include "gdb_assert.h"
#include <stddef.h>
-#include <string.h>
+#include "gdb_string.h"
#include <ctype.h>
#ifdef HAVE_ICONV
@@ -442,7 +442,7 @@
static void
-register_iconv_charsets ()
+register_iconv_charsets (void)
{
/* Here we should check whether various character sets were
recognized by the local iconv implementation.
@@ -479,7 +479,7 @@
}
static void
-register_iconv_charsets ()
+register_iconv_charsets (void)
{
}
@@ -1016,7 +1016,7 @@
const char *
-host_charset ()
+host_charset (void)
{
return current_host_charset->name;
}
@@ -1032,7 +1032,7 @@
const char *
-target_charset ()
+target_charset (void)
{
return current_target_charset->name;
}
Index: expprint.c
===================================================================
RCS file: /cvs/src/src/gdb/expprint.c,v
retrieving revision 1.11
diff -u -r1.11 expprint.c
--- expprint.c 2 Jan 2003 14:27:26 -0000 1.11
+++ expprint.c 9 Jan 2003 18:00:59 -0000
@@ -220,7 +220,7 @@
}
fprintf_unfiltered (stream, "]");
/* "selector" was malloc'd by target_read_string. Free it. */
- free (selector);
+ xfree (selector);
return;
}
Index: infrun.c
===================================================================
RCS file: /cvs/src/src/gdb/infrun.c,v
retrieving revision 1.92
diff -u -r1.92 infrun.c
--- infrun.c 18 Dec 2002 18:03:42 -0000 1.92
+++ infrun.c 9 Jan 2003 18:01:00 -0000
@@ -66,7 +66,7 @@
static void build_infrun (void);
-static int follow_fork ();
+static int follow_fork (void);
static void set_schedlock_func (char *args, int from_tty,
struct cmd_list_element *c);
@@ -377,7 +377,7 @@
static int
-follow_fork ()
+follow_fork (void)
{
const char *follow_mode = follow_fork_mode_string;
int follow_child = (follow_mode == follow_fork_mode_child);
Index: mi/mi-cmd-env.c
===================================================================
RCS file: /cvs/src/src/gdb/mi/mi-cmd-env.c,v
retrieving revision 1.1
diff -u -r1.1 mi-cmd-env.c
--- mi/mi-cmd-env.c 13 Dec 2002 17:00:22 -0000 1.1
+++ mi/mi-cmd-env.c 9 Jan 2003 18:01:00 -0000
@@ -19,9 +19,6 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include <string.h>
-#include <sys/stat.h>
-
#include "defs.h"
#include "inferior.h"
#include "value.h"
@@ -34,6 +31,9 @@
#include "command.h"
#include "ui-out.h"
#include "top.h"
+
+#include "gdb_string.h"
+#include <sys/stat.h>
static void env_cli_command (const char *cli, char *args);
static void env_mod_path (char *dirname, char **which_path);