2003-02-06 Andrew Cagney <ac131313@redhat.com>
authorAndrew Cagney <cagney@redhat.com>
Fri, 7 Feb 2003 00:27:31 +0000 (00:27 +0000)
committerAndrew Cagney <cagney@redhat.com>
Fri, 7 Feb 2003 00:27:31 +0000 (00:27 +0000)
* linux-proc.c: Include "gdb_stat.h" instead of <sys/stat.h>.
* cp-valprint.c (cp_print_value_fields): Eliminate STREQN.
* jv-typeprint.c (java_type_print_base): Ditto.
* typeprint.c (typedef_print): Eliminate STREQ.
* cli/cli-script.c (define_command, define_command): Ditto.
* main.c (captured_main): Ditto.
* values.c (lookup_internalvar): Ditto.
* utils.c (safe_strerror, parse_escape): Eliminate assignment
within `if' conditional.
* linespec.c (decode_line_2): Ditto.
* cli/cli-dump.c (bfd_openr_with_cleanup): Ditto.
(bfd_openw_with_cleanup): Ditto.

Index: mi/ChangeLog
2003-02-06  Andrew Cagney  <ac131313@redhat.com>

* mi-cmd-env.c: Include "gdb_stat.h" instead of <sys/stat.h>.

13 files changed:
gdb/ChangeLog
gdb/cli/cli-dump.c
gdb/cli/cli-script.c
gdb/cp-valprint.c
gdb/jv-typeprint.c
gdb/linespec.c
gdb/linux-proc.c
gdb/main.c
gdb/mi/ChangeLog
gdb/mi/mi-cmd-env.c
gdb/typeprint.c
gdb/utils.c
gdb/values.c

index 6ec49eafb895331a2831d0c47c6e68e266b18b56..5721310378a107c14188d1ce20a8e460c684c519 100644 (file)
@@ -1,3 +1,18 @@
+2003-02-06  Andrew Cagney  <ac131313@redhat.com>
+
+       * linux-proc.c: Include "gdb_stat.h" instead of <sys/stat.h>.
+       * cp-valprint.c (cp_print_value_fields): Eliminate STREQN.
+       * jv-typeprint.c (java_type_print_base): Ditto.
+       * typeprint.c (typedef_print): Eliminate STREQ.
+       * cli/cli-script.c (define_command, define_command): Ditto.
+       * main.c (captured_main): Ditto.
+       * values.c (lookup_internalvar): Ditto.
+       * utils.c (safe_strerror, parse_escape): Eliminate assignment
+       within `if' conditional.
+       * linespec.c (decode_line_2): Ditto.
+       * cli/cli-dump.c (bfd_openr_with_cleanup): Ditto.
+       (bfd_openw_with_cleanup): Ditto.
+
 2003-02-07  Mark Kettenis  <kettenis@gnu.org>
 
        * x86-64-tdep.c (x86_64_init_abi): Set extract_return_value to
index 7a58fcbbd7ba145f731a16da16c2c3357ddc07c0..6bd40e033b128d90585df4aaf11940b449462807 100644 (file)
@@ -132,7 +132,8 @@ bfd_openr_with_cleanup (const char *filename, const char *target)
 {
   bfd *ibfd;
 
-  if ((ibfd = bfd_openr (filename, target)) == NULL)
+  ibfd = bfd_openr (filename, target);
+  if (ibfd == NULL)
     error ("Failed to open %s: %s.", filename, 
           bfd_errmsg (bfd_get_error ()));
 
@@ -150,7 +151,8 @@ bfd_openw_with_cleanup (char *filename, const char *target, char *mode)
 
   if (*mode == 'w')    /* Write: create new file */
     {
-      if ((obfd = bfd_openw (filename, target)) == NULL)
+      obfd = bfd_openw (filename, target);
+      if (obfd == NULL)
        error ("Failed to open %s: %s.", filename, 
               bfd_errmsg (bfd_get_error ()));
       make_cleanup_bfd_close (obfd);
index 6b7bec68e4a8907681f04203e47a082d031d380b..d68c365959dc875cbdb58e1248454dc0c9ccefc2 100644 (file)
@@ -1093,7 +1093,7 @@ define_command (char *comname, int from_tty)
 
   /* Look it up, and verify that we got an exact match.  */
   c = lookup_cmd (&tem, cmdlist, "", -1, 1);
-  if (c && !STREQ (comname, c->name))
+  if (c && strcmp (comname, c->name) != 0)
     c = 0;
 
   if (c)
@@ -1126,7 +1126,7 @@ define_command (char *comname, int from_tty)
       /* Look up cmd it hooks, and verify that we got an exact match.  */
       tem = comname + hook_name_size;
       hookc = lookup_cmd (&tem, cmdlist, "", -1, 0);
-      if (hookc && !STREQ (comname + hook_name_size, hookc->name))
+      if (hookc && strcmp (comname + hook_name_size, hookc->name) != 0)
        hookc = 0;
       if (!hookc)
        {
index a2ccbdbf77caf680e6dee98b03685757c4c17201..a260144d04f493da03e150bd5f83f7f9535e58f1 100644 (file)
@@ -260,8 +260,8 @@ cp_print_value_fields (struct type *type, struct type *real_type, char *valaddr,
   if ((len == n_baseclasses)
       || ((len - n_baseclasses == 1)
          && TYPE_HAS_VTABLE (type)
-         && STREQN (TYPE_FIELD_NAME (type, n_baseclasses),
-                    hpacc_vtbl_ptr_name, 5))
+         && strncmp (TYPE_FIELD_NAME (type, n_baseclasses),
+                     hpacc_vtbl_ptr_name, 5) == 0)
       || !len)
     fprintf_filtered (stream, "<No data fields>");
   else
@@ -285,7 +285,8 @@ cp_print_value_fields (struct type *type, struct type *real_type, char *valaddr,
 
          /* If a vtable pointer appears, we'll print it out later */
          if (TYPE_HAS_VTABLE (type)
-             && STREQN (TYPE_FIELD_NAME (type, i), hpacc_vtbl_ptr_name, 5))
+             && strncmp (TYPE_FIELD_NAME (type, i), hpacc_vtbl_ptr_name,
+                         5) == 0)
            continue;
 
          if (fields_seen)
@@ -408,9 +409,8 @@ cp_print_value_fields (struct type *type, struct type *real_type, char *valaddr,
     }                          /* if there are data fields */
   /* Now print out the virtual table pointer if there is one */
   if (TYPE_HAS_VTABLE (type)
-      && STREQN (TYPE_FIELD_NAME (type, n_baseclasses),
-                hpacc_vtbl_ptr_name, 
-                5))
+      && strncmp (TYPE_FIELD_NAME (type, n_baseclasses),
+                 hpacc_vtbl_ptr_name, 5) == 0)
     {
       struct value *v;
       /* First get the virtual table pointer and print it out */
index b6dac57d48c282b309b905dfbbb83d3785f1731a..0d4c187648624d8ed77d0bbe2cd1b75cf5c0747a 100644 (file)
@@ -166,12 +166,12 @@ java_type_print_base (struct type *type, struct ui_file *stream, int show,
            {
              QUIT;
              /* Don't print out virtual function table.  */
-             if (STREQN (TYPE_FIELD_NAME (type, i), "_vptr", 5)
+             if (strncmp (TYPE_FIELD_NAME (type, i), "_vptr", 5) == 0
                  && is_cplus_marker ((TYPE_FIELD_NAME (type, i))[5]))
                continue;
 
              /* Don't print the dummy field "class". */
-             if (STREQN (TYPE_FIELD_NAME (type, i), "class", 5))
+             if (strncmp (TYPE_FIELD_NAME (type, i), "class", 5) == 0)
                continue;
 
              print_spaces_filtered (level + 4, stream);
index 4b36d864c255a2fb846039c438d46346fcdc60f4..4c0e3c12753136cda182a1b398128288f214d87d 100644 (file)
@@ -438,7 +438,8 @@ decode_line_2 (struct symbol *sym_arr[], int nelts, int funfirstline,
       i++;
     }
 
-  if ((prompt = getenv ("PS2")) == NULL)
+  prompt = getenv ("PS2");
+  if (prompt == NULL)
     {
       prompt = "> ";
     }
index 2f43ae61f97004f3bfd968271037e8af05935052..00383e9a6eeecb4d1db2a160a05e23ae1d18e617 100644 (file)
@@ -23,7 +23,7 @@
 #include "inferior.h"
 #include <sys/param.h> /* for MAXPATHLEN */
 #include <sys/procfs.h>        /* for elf_gregset etc. */
-#include <sys/stat.h>  /* for struct stat */
+#include "gdb_stat.h"  /* for struct stat */
 #include <ctype.h>     /* for isdigit */
 #include <unistd.h>    /* for open, pread64 */
 #include <fcntl.h>     /* for O_RDONLY */
index 73c17f573ccbc0256cfc0cbdfa3d20d99b554ff3..b10277bb7ee4edea9672fc36c702c0256bba9b57 100644 (file)
@@ -638,7 +638,7 @@ extern int gdbtk_test (char *);
 
   if (execarg != NULL
       && symarg != NULL
-      && STREQ (execarg, symarg))
+      && strcmp (execarg, symarg) == 0)
     {
       /* The exec file and the symbol-file are the same.  If we can't
          open it, better only print one error message.
index e79398c15a758025c908c5bcfccf9df21a35aa09..93b55d7dd9b7aa3806bda95defc0dfef64c5dad7 100644 (file)
@@ -1,3 +1,7 @@
+2003-02-06  Andrew Cagney  <ac131313@redhat.com>
+
+       * mi-cmd-env.c: Include "gdb_stat.h" instead of <sys/stat.h>.
+
 2003-02-04  Jim Ingham <jingham@apple.com>
            Keith Seitz  <keiths@redhat.com>
             Elena Zannoni  <ezannoni@redhat.com>
index 8fc673fe59b544d88faf87765969a3edcaa4264c..55fcba10c9dcc514342c41b97f0f680a85559545 100644 (file)
@@ -35,7 +35,7 @@
 #include "top.h"
 
 #include "gdb_string.h"
-#include <sys/stat.h>
+#include "gdb_stat.h"
 
 static void env_cli_command (const char *cli, char *args);
 static void env_mod_path (char *dirname, char **which_path);
index 8e517a0659901a899d32b0815d0fef46b6681882..b18410322a98c3a25e6177017019ab371ae582fe 100644 (file)
@@ -67,15 +67,15 @@ typedef_print (struct type *type, struct symbol *new, struct ui_file *stream)
       fprintf_filtered (stream, "typedef ");
       type_print (type, "", stream, 0);
       if (TYPE_NAME ((SYMBOL_TYPE (new))) == 0
-         || !STREQ (TYPE_NAME ((SYMBOL_TYPE (new))), SYMBOL_NAME (new)))
+         || strcmp (TYPE_NAME ((SYMBOL_TYPE (new))), SYMBOL_NAME (new)) != 0)
        fprintf_filtered (stream, " %s", SYMBOL_SOURCE_NAME (new));
       break;
 #endif
 #ifdef _LANG_m2
     case language_m2:
       fprintf_filtered (stream, "TYPE ");
-      if (!TYPE_NAME (SYMBOL_TYPE (new)) ||
-         !STREQ (TYPE_NAME (SYMBOL_TYPE (new)), SYMBOL_NAME (new)))
+      if (!TYPE_NAME (SYMBOL_TYPE (new))
+         || strcmp (TYPE_NAME ((SYMBOL_TYPE (new))), SYMBOL_NAME (new)) != 0)
        fprintf_filtered (stream, "%s = ", SYMBOL_SOURCE_NAME (new));
       else
        fprintf_filtered (stream, "<builtin> = ");
index 6d9e42906eb85a5f9e912709e5e5a67491892948..0d9fb318a96d88ddd336ac90fc7c1b066cc3b2e9 100644 (file)
@@ -831,7 +831,8 @@ safe_strerror (int errnum)
   char *msg;
   static char buf[32];
 
-  if ((msg = strerror (errnum)) == NULL)
+  msg = strerror (errnum);
+  if (msg == NULL)
     {
       sprintf (buf, "(undocumented errno %d)", errnum);
       msg = buf;
@@ -1447,14 +1448,15 @@ parse_escape (char **string_ptr)
          register int count = 0;
          while (++count < 3)
            {
-             if ((c = *(*string_ptr)++) >= '0' && c <= '7')
+             c = (**string_ptr);
+             if (c >= '0' && c <= '7')
                {
+                 (*string_ptr)++;
                  i *= 8;
                  i += c - '0';
                }
              else
                {
-                 (*string_ptr)--;
                  break;
                }
            }
index 0ce7dfdccd6d57054e17854f6c72dc70f267d67a..2dfaee9aad687377581ca2ac7bf8e7e51704f7fe 100644 (file)
@@ -406,7 +406,7 @@ lookup_internalvar (char *name)
   register struct internalvar *var;
 
   for (var = internalvars; var; var = var->next)
-    if (STREQ (var->name, name))
+    if (strcmp (var->name, name) == 0)
       return var;
 
   var = (struct internalvar *) xmalloc (sizeof (struct internalvar));
This page took 0.030742 seconds and 4 git commands to generate.