OSDN Git Service

* ifcvt.c: New file.
[pf3gnuchains/gcc-fork.git] / gcc / mkdeps.c
index 7b0f271..08b3b2e 100644 (file)
@@ -58,7 +58,7 @@ munge (filename)
             preceded by 2N backslashes represents N backslashes at
             the end of a file name; and backslashes in other
             contexts should not be doubled.  */
-         for (q = p - 1; q < filename && q[-1] == '\\';  q--)
+         for (q = p - 1; filename <= q && *q == '\\';  q--)
            len++;
          len++;
          break;
@@ -80,7 +80,7 @@ munge (filename)
        {
        case ' ':
        case '\t':
-         for (q = p - 1; filename < q && q[-1] == '\\';  q--)
+         for (q = p - 1; filename <= q && *q == '\\';  q--)
            *dst++ = '\\';
          *dst++ = '\\';
          break;
@@ -102,10 +102,12 @@ munge (filename)
 /* Given a pathname, calculate the non-directory part.  This always
    knows how to handle Unix-style pathnames, and understands VMS and
    DOS paths on those systems.  */
+
 /* Find the base name of a (partial) pathname FNAME.
    Returns a pointer into the string passed in.
    Accepts Unix (/-separated) paths on all systems,
    DOS and VMS paths on those systems.  */
+
 static const char *
 base_name (fname)
      const char *fname;
@@ -133,8 +135,8 @@ deps_init ()
 
   /* Allocate space for the vectors now.  */
 
-  d->targetv = xmalloc (2 * sizeof (const char *));
-  d->depv = xmalloc (8 * sizeof (const char *));
+  d->targetv = (const char **) xmalloc (2 * sizeof (const char *));
+  d->depv = (const char **) xmalloc (8 * sizeof (const char *));
 
   d->ntargets = 0;
   d->targets_size = 2;
@@ -149,8 +151,10 @@ deps_free (d)
      struct deps *d;
 {
   unsigned int i;
+
   for (i = 0; i < d->ntargets; i++)
     free ((PTR) d->targetv[i]);
+
   for (i = 0; i < d->ndeps; i++)
     free ((PTR) d->depv[i]);
 
@@ -169,9 +173,10 @@ deps_add_target (d, t)
   if (d->ntargets == d->targets_size)
     {
       d->targets_size *= 2;
-      d->targetv = xrealloc (d->targetv,
+      d->targetv = (const char **) xrealloc (d->targetv,
                             d->targets_size * sizeof (const char *));
     }
+
   d->targetv[d->ntargets++] = t;
 }
 
@@ -183,7 +188,7 @@ deps_calc_target (d, t)
   char *o, *suffix;
 
   t = base_name (t);
-  o = alloca (strlen (t) + 8);
+  o = (char *) alloca (strlen (t) + 8);
 
   strcpy (o, t);
   suffix = strrchr (o, '.');
@@ -205,7 +210,8 @@ deps_add_dep (d, t)
   if (d->ndeps == d->deps_size)
     {
       d->deps_size *= 2;
-      d->depv = xrealloc (d->depv, d->deps_size * sizeof (const char *));
+      d->depv = (const char **)
+       xrealloc (d->depv, d->deps_size * sizeof (const char *));
     }
   d->depv[d->ndeps++] = t;
 }
@@ -267,7 +273,7 @@ deps_dummy_targets (d, fp)
      const struct deps *d;
      FILE *fp;
 {
-  int i;
+  unsigned int i;
 
   for (i = 1; i < d->ndeps; i++)
     {