mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-01 22:25:22 +00:00
Replace the use of %qd with intmax_t/%jd and fix a number of -Wall
and -Wformat warnings: o Include timeconv.h for the time conversion functions. o Remove unused variables. o Correct a few cases where %d was used when printing longs.
This commit is contained in:
parent
64ca701084
commit
617dbd3c84
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=99562
|
@ -52,6 +52,7 @@ static const char rcsid[] =
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <timeconv.h>
|
||||
|
||||
#include "dump.h"
|
||||
|
||||
|
|
|
@ -59,10 +59,12 @@ static const char rcsid[] =
|
|||
#include <err.h>
|
||||
#include <fcntl.h>
|
||||
#include <fstab.h>
|
||||
#include <inttypes.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <timeconv.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "dump.h"
|
||||
|
@ -102,7 +104,6 @@ main(int argc, char *argv[])
|
|||
int just_estimate = 0;
|
||||
ino_t maxino;
|
||||
char *tmsg;
|
||||
time_t t;
|
||||
|
||||
spcl.c_date = _time_to_time64(time(NULL));
|
||||
|
||||
|
@ -359,7 +360,7 @@ main(int argc, char *argv[])
|
|||
dev_bsize = sblock->fs_fsize / fsbtodb(sblock, 1);
|
||||
dev_bshift = ffs(dev_bsize) - 1;
|
||||
if (dev_bsize != (1 << dev_bshift))
|
||||
quit("dev_bsize (%d) is not a power of 2", dev_bsize);
|
||||
quit("dev_bsize (%ld) is not a power of 2", dev_bsize);
|
||||
tp_bshift = ffs(TP_BSIZE) - 1;
|
||||
if (TP_BSIZE != (1 << tp_bshift))
|
||||
quit("TP_BSIZE (%d) is not a power of 2", TP_BSIZE);
|
||||
|
@ -492,19 +493,19 @@ main(int argc, char *argv[])
|
|||
for (i = 0; i < ntrec; i++)
|
||||
writeheader(maxino - 1);
|
||||
if (pipeout)
|
||||
msg("DUMP: %qd tape blocks\n", spcl.c_tapea);
|
||||
msg("DUMP: %jd tape blocks\n", (intmax_t)spcl.c_tapea);
|
||||
else
|
||||
msg("DUMP: %qd tape blocks on %d volume%s\n",
|
||||
spcl.c_tapea, spcl.c_volume,
|
||||
msg("DUMP: %jd tape blocks on %d volume%s\n",
|
||||
(intmax_t)spcl.c_tapea, spcl.c_volume,
|
||||
(spcl.c_volume == 1) ? "" : "s");
|
||||
|
||||
/* report dump performance, avoid division through zero */
|
||||
if (tend_writing - tstart_writing == 0)
|
||||
msg("finished in less than a second\n");
|
||||
else
|
||||
msg("finished in %d seconds, throughput %qd KBytes/sec\n",
|
||||
tend_writing - tstart_writing,
|
||||
spcl.c_tapea / (tend_writing - tstart_writing));
|
||||
msg("finished in %d seconds, throughput %jd KBytes/sec\n",
|
||||
tend_writing - tstart_writing, (intmax_t)(spcl.c_tapea /
|
||||
(tend_writing - tstart_writing)));
|
||||
|
||||
putdumptime();
|
||||
trewind();
|
||||
|
|
|
@ -781,6 +781,7 @@ doslave(int cmd, int slave_number)
|
|||
eot_count = 0;
|
||||
size = 0;
|
||||
|
||||
wrote = 0;
|
||||
while (eot_count < 10 && size < writesize) {
|
||||
#ifdef RDUMP
|
||||
if (host)
|
||||
|
|
|
@ -49,11 +49,13 @@ static const char rcsid[] =
|
|||
#include <protocols/dumprestore.h>
|
||||
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <timeconv.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "dump.h"
|
||||
|
||||
|
@ -388,8 +390,6 @@ searchdir(
|
|||
void
|
||||
dumpino(union dinode *dp, ino_t ino)
|
||||
{
|
||||
struct ufs1_dinode *dp1;
|
||||
struct ufs2_dinode *dp2;
|
||||
int ind_level, cnt;
|
||||
off_t size;
|
||||
char buf[TP_BSIZE];
|
||||
|
@ -705,11 +705,11 @@ bread(ufs2_daddr_t blkno, char *buf, int size)
|
|||
goto loop;
|
||||
}
|
||||
if (cnt == -1)
|
||||
msg("read error from %s: %s: [block %qd]: count=%d\n",
|
||||
disk, strerror(errno), blkno, size);
|
||||
msg("read error from %s: %s: [block %jd]: count=%d\n",
|
||||
disk, strerror(errno), (intmax_t)blkno, size);
|
||||
else
|
||||
msg("short read error from %s: [block %qd]: count=%d, got=%d\n",
|
||||
disk, blkno, size, cnt);
|
||||
msg("short read error from %s: [block %jd]: count=%d, got=%d\n",
|
||||
disk, (intmax_t)blkno, size, cnt);
|
||||
if (++breaderrors > BREADEMAX) {
|
||||
msg("More than %d block read errors from %s\n",
|
||||
BREADEMAX, disk);
|
||||
|
@ -730,11 +730,11 @@ bread(ufs2_daddr_t blkno, char *buf, int size)
|
|||
((off_t)blkno << dev_bshift))) == dev_bsize)
|
||||
continue;
|
||||
if (cnt == -1) {
|
||||
msg("read error from %s: %s: [sector %qd]: count=%d\n",
|
||||
disk, strerror(errno), blkno, dev_bsize);
|
||||
msg("read error from %s: %s: [sector %jd]: count=%ld\n",
|
||||
disk, strerror(errno), (intmax_t)blkno, dev_bsize);
|
||||
continue;
|
||||
}
|
||||
msg("short read error from %s: [sector %qd]: count=%d, got=%d\n",
|
||||
disk, blkno, dev_bsize, cnt);
|
||||
msg("short read from %s: [sector %jd]: count=%ld, got=%d\n",
|
||||
disk, (intmax_t)blkno, dev_bsize, cnt);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue