* src/c99-to-c89.diff: Adjust offsets.
[platform/upstream/coreutils.git] / src / c99-to-c89.diff
1 diff -upr src/remove.c src/remove.c
2 --- src/remove.c        2007-07-23 12:56:20.000000000 +0200
3 +++ src/remove.c        2007-07-23 13:03:12.000000000 +0200
4 @@ -257,9 +257,10 @@ pop_dir (Dirstack_state *ds)
5  {
6    size_t n_lengths = obstack_object_size (&ds->len_stack) / sizeof (size_t);
7    size_t *length = obstack_base (&ds->len_stack);
8 +  size_t top_len;
9
10    assert (n_lengths > 0);
11 -  size_t top_len = length[n_lengths - 1];
12 +  top_len = length[n_lengths - 1];
13    assert (top_len >= 2);
14
15    /* Pop the specified length of file name.  */
16 @@ -391,10 +392,11 @@ AD_stack_top (Dirstack_state const *ds)
17  static void
18  AD_stack_pop (Dirstack_state *ds)
19  {
20 +  struct AD_ent *top;
21    assert (0 < AD_stack_height (ds));
22
23    /* operate on Active_dir.  pop and free top entry */
24 -  struct AD_ent *top = AD_stack_top (ds);
25 +  top = AD_stack_top (ds);
26    if (top->unremovable)
27      hash_free (top->unremovable);
28    obstack_blank (&ds->Active_dir, -(int) sizeof (struct AD_ent));
29 @@ -876,6 +878,7 @@ prompt (int fd_cwd, Dirstack_state const
30             break;
31           }
32
33 +      {
34        char const *quoted_name = quote (full_filename (filename));
35
36        if (0 < write_protected)
37 @@ -915,6 +918,7 @@ prompt (int fd_cwd, Dirstack_state const
38                     : _("%s: remove %s %s? ")),
39                    program_name, file_type (sbuf), quoted_name);
40         }
41 +      }
42
43        if (!yesno ())
44         return RM_USER_DECLINED;
45 @@ -1515,6 +1519,7 @@ rm_1 (Dirstack_state *ds, char const *fi
46        return RM_ERROR;
47      }
48
49 +  {
50    struct stat st;
51    cache_stat_init (&st);
52    cycle_check_init (&ds->cycle_check_state);
53 @@ -1537,6 +1542,7 @@ rm_1 (Dirstack_state *ds, char const *fi
54    AD_push_initial (ds);
55    AD_INIT_OTHER_MEMBERS ();
56
57 +  {
58    enum RM_status status = remove_entry (AT_FDCWD, ds, filename,
59                                         DT_UNKNOWN, &st, x);
60    if (status == RM_NONEMPTY_DIR)
61 @@ -1555,6 +1561,8 @@ rm_1 (Dirstack_state *ds, char const *fi
62    ds_clear (ds);
63    return status;
64  }
65 +  }
66 +}
67
68  /* Remove all files and/or directories specified by N_FILES and FILE.
69     Apply the options in X.  */
70 diff -upr src/rm.c src/rm.c
71 --- src/rm.c    2007-07-23 12:56:20.000000000 +0200
72 +++ src/rm.c    2007-07-23 13:03:12.000000000 +0200
73 @@ -354,6 +354,7 @@ main (int argc, char **argv)
74                quote ("/"));
75      }
76
77 +  {
78    size_t n_files = argc - optind;
79    char const *const *file = (char const *const *) argv + optind;
80
81 @@ -367,7 +368,10 @@ main (int argc, char **argv)
82        if (!yesno ())
83         exit (EXIT_SUCCESS);
84      }
85 +  {
86    enum RM_status status = rm (n_files, file, &x);
87    assert (VALID_STATUS (status));
88    exit (status == RM_ERROR ? EXIT_FAILURE : EXIT_SUCCESS);
89 +  }
90 +  }
91  }
92 diff -upr src/seq.c src/seq.c
93 --- src/seq.c   2007-07-23 12:56:20.000000000 +0200
94 +++ src/seq.c   2007-07-23 13:03:12.000000000 +0200
95 @@ -156,6 +156,7 @@ scan_arg (const char *arg)
96                         : (decimal_point == arg                /* .#  -> 0.# */
97                            || ! ISDIGIT (decimal_point[-1]))); /* -.# -> 0.# */
98         }
99 +      {
100        char const *e = strchr (arg, 'e');
101        if (! e)
102         e = strchr (arg, 'E');
103 @@ -164,6 +165,7 @@ scan_arg (const char *arg)
104           long exponent = strtol (e + 1, NULL, 10);
105           ret.precision += exponent < 0 ? -exponent : 0;
106         }
107 +      }
108      }
109
110    return ret;
111 @@ -292,6 +294,7 @@ get_default_format (operand first, opera
112           size_t last_width = last.width + (prec - last.precision);
113           if (last.precision && prec == 0)
114             last_width--;  /* don't include space for '.' */
115 +         {
116           size_t width = MAX (first_width, last_width);
117           if (width <= INT_MAX)
118             {
119 @@ -299,6 +302,7 @@ get_default_format (operand first, opera
120               sprintf (format_buf, "%%0%d.%dLf", w, prec);
121               return format_buf;
122             }
123 +         }
124         }
125        else
126         {
127 diff -upr src/shred.c src/shred.c
128 --- src/shred.c 2007-07-23 12:56:20.000000000 +0200
129 +++ src/shred.c 2007-07-23 13:03:12.000000000 +0200
130 @@ -462,7 +462,7 @@ dopass (int fd, char const *qname, off_t
131                      out.  Thus, it shouldn't give up on bad blocks.  This
132                      code works because lim is always a multiple of
133                      SECTOR_SIZE, except at the end.  */
134 -                 verify (sizeof r % SECTOR_SIZE == 0);
135 +                 { verify (sizeof r % SECTOR_SIZE == 0); }
136                   if (errnum == EIO && 0 <= size && (soff | SECTOR_MASK) < lim)
137                     {
138                       size_t soff1 = (soff | SECTOR_MASK) + 1;