This lint was found by GCC 4.6.2 on Fedora 15 x86-64.
* src/buffer.c (buffer_write_global_xheader, mv_end, set_start_time)
(compute_duration, print_total_stats, flush_read, flush_write):
* src/checkpoint.c (checkpoint_finish_compile):
* src/list.c (test_archive_label):
* src/misc.c (chdir_count):
* src/names.c (const):
* src/unlink.c (finish_deferred_unlinks):
Define with (void) instead of with (), for slightly-better C type
checking and to avoid a GCC warning.
* src/compare.c (diff_dumpdir):
* src/tar.c (parse_owner_group): Remove unused local.
* src/misc.c (chdir_do):
* src/tar.c (add_exclude_array): Rename local to avoid shadowing.
(LOW_DENSITY_NUM, MID_DENSITY_NUM, HIGH_DENSITY_NUM):
Define only if needed.
* src/update.c (update_archive): Initialize a local; this fixes
what appears to be a real bug.
static struct tar_stat_info dummy;
void
-buffer_write_global_xheader ()
+buffer_write_global_xheader (void)
{
xheader_write_global (&dummy.xhdr);
}
}
void
-mv_end ()
+mv_end (void)
{
if (multi_volume_option)
bufmap_free (NULL);
double duration;
void
-set_start_time ()
+set_start_time (void)
{
gettime (&start_time);
volume_start_time = start_time;
}
void
-compute_duration ()
+compute_duration (void)
{
struct timespec now;
gettime (&now);
}
void
-print_total_stats ()
+print_total_stats (void)
{
switch (subcommand_option)
{
}
void
-flush_read ()
+flush_read (void)
{
flush_read_ptr ();
}
void
-flush_write ()
+flush_write (void)
{
flush_write_ptr (record_size);
}
}
void
-checkpoint_finish_compile ()
+checkpoint_finish_compile (void)
{
if (checkpoint_option)
{
diff_dumpdir (struct tar_stat_info *dir)
{
const char *dumpdir_buffer;
- dev_t dev = 0;
struct stat stat_data;
if (deref_stat (dir->file_name, &stat_data) != 0)
else
stat_error (dir->file_name);
}
- else
- dev = stat_data.st_dev;
if (dir->fd == 0)
{
}
void
-test_archive_label ()
+test_archive_label (void)
{
base64_init ();
name_gather ();
static size_t wdcache_count;
int
-chdir_count ()
+chdir_count (void)
{
if (wd_count == 0)
return wd_count;
int prev = wdcache[0];
for (ci = 1; prev != i; ci++)
{
- int curr = wdcache[ci];
+ int cur = wdcache[ci];
wdcache[ci] = prev;
- if (curr == i)
+ if (cur == i)
break;
- prev = curr;
+ prev = cur;
}
wdcache[0] = i;
}
struct name *gnu_list_name;
struct name const *
-name_from_list ()
+name_from_list (void)
{
if (!gnu_list_name)
gnu_list_name = namelist;
};
static void
-add_exclude_array (char const * const * fv, int options)
+add_exclude_array (char const * const * fv, int opts)
{
int i;
for (i = 0; fv[i]; i++)
- add_exclude (excluded, fv[i], options);
+ add_exclude (excluded, fv[i], opts);
}
\f
/* Default density numbers for [0-9][lmh] device specifications */
-#ifndef LOW_DENSITY_NUM
-# define LOW_DENSITY_NUM 0
-#endif
+#if defined DEVICE_PREFIX && !defined DENSITY_LETTER
+# ifndef LOW_DENSITY_NUM
+# define LOW_DENSITY_NUM 0
+# endif
-#ifndef MID_DENSITY_NUM
-# define MID_DENSITY_NUM 8
-#endif
+# ifndef MID_DENSITY_NUM
+# define MID_DENSITY_NUM 8
+# endif
-#ifndef HIGH_DENSITY_NUM
-# define HIGH_DENSITY_NUM 16
+# ifndef HIGH_DENSITY_NUM
+# define HIGH_DENSITY_NUM 16
+# endif
#endif
static void
static uintmax_t
parse_owner_group (char *arg, uintmax_t field_max, char const **name_option)
{
- strtol_error err;
uintmax_t u = UINTMAX_MAX;
char *end;
char const *name = 0;
}
void
-finish_deferred_unlinks ()
+finish_deferred_unlinks (void)
{
flush_deferred_unlinks (true);
while (dunlink_avail)
if (S_ISDIR (s.st_mode))
{
char *p, *dirp;
- DIR *stream;
+ DIR *stream = NULL;
int fd = openat (chdir_fd, name->name,
open_read_flags | O_DIRECTORY);
if (fd < 0)