build: fix some compiler warnings
Most of them catched on 32bit gcc and icc. disk-utils/fsck.cramfs.c: printf format type lib/boottime.c: unused variables misc-utils/cal.c: set but never used sys-utils/losetup.c: set but never used sys-utils/lscpu-dmi.c: defined but not used sys-utils/switch_root.c: comparison between signed and unsigned tests/helpers/test_sysinfo.c: printf format type
This commit is contained in:
parent
27e6e446b9
commit
60cb2c3720
7 changed files with 11 additions and 9 deletions
|
@ -618,11 +618,11 @@ static void test_fs(int start)
|
||||||
if (start_data != ~0UL) {
|
if (start_data != ~0UL) {
|
||||||
if (start_data < (sizeof(struct cramfs_super) + start))
|
if (start_data < (sizeof(struct cramfs_super) + start))
|
||||||
errx(FSCK_EX_UNCORRECTED,
|
errx(FSCK_EX_UNCORRECTED,
|
||||||
_("directory data start (%ld) < sizeof(struct cramfs_super) + start (%ld)"),
|
_("directory data start (%lu) < sizeof(struct cramfs_super) + start (%zu)"),
|
||||||
start_data, sizeof(struct cramfs_super) + start);
|
start_data, sizeof(struct cramfs_super) + start);
|
||||||
if (end_dir != start_data)
|
if (end_dir != start_data)
|
||||||
errx(FSCK_EX_UNCORRECTED,
|
errx(FSCK_EX_UNCORRECTED,
|
||||||
_("directory data end (%ld) != file data start (%ld)"),
|
_("directory data end (%lu) != file data start (%lu)"),
|
||||||
end_dir, start_data);
|
end_dir, start_data);
|
||||||
}
|
}
|
||||||
if (super.flags & CRAMFS_FLAG_FSID_VERSION_2)
|
if (super.flags & CRAMFS_FLAG_FSID_VERSION_2)
|
||||||
|
|
|
@ -9,8 +9,11 @@
|
||||||
|
|
||||||
int get_boot_time(struct timeval *boot_time)
|
int get_boot_time(struct timeval *boot_time)
|
||||||
{
|
{
|
||||||
|
#ifdef CLOCK_BOOTTIME
|
||||||
struct timespec hires_uptime;
|
struct timespec hires_uptime;
|
||||||
struct timeval lores_uptime, now;
|
struct timeval lores_uptime;
|
||||||
|
#endif
|
||||||
|
struct timeval now;
|
||||||
struct sysinfo info;
|
struct sysinfo info;
|
||||||
|
|
||||||
if (gettimeofday(&now, NULL) != 0) {
|
if (gettimeofday(&now, NULL) != 0) {
|
||||||
|
|
|
@ -137,7 +137,6 @@ static void my_putstring(char *s)
|
||||||
|
|
||||||
#if defined(HAVE_LIBNCURSES) || defined(HAVE_LIBNCURSESW) || defined(HAVE_LIBTERMCAP)
|
#if defined(HAVE_LIBNCURSES) || defined(HAVE_LIBNCURSESW) || defined(HAVE_LIBTERMCAP)
|
||||||
static const char *term="";
|
static const char *term="";
|
||||||
static int Slen; /* strlen of Senter+Sexit */
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const char *Senter="", *Sexit="";/* enter and exit standout mode */
|
static const char *Senter="", *Sexit="";/* enter and exit standout mode */
|
||||||
|
@ -304,7 +303,6 @@ int main(int argc, char **argv)
|
||||||
if (ret > 0) {
|
if (ret > 0) {
|
||||||
Senter = my_tgetstr("so","smso");
|
Senter = my_tgetstr("so","smso");
|
||||||
Sexit = my_tgetstr("se","rmso");
|
Sexit = my_tgetstr("se","rmso");
|
||||||
Slen = strlen(Senter) + strlen(Sexit);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -77,7 +77,6 @@ static struct colinfo infos[] = {
|
||||||
|
|
||||||
static int columns[NCOLS] = {-1};
|
static int columns[NCOLS] = {-1};
|
||||||
static int ncolumns;
|
static int ncolumns;
|
||||||
static int verbose;
|
|
||||||
|
|
||||||
static int get_column_id(int num)
|
static int get_column_id(int num)
|
||||||
{
|
{
|
||||||
|
@ -543,7 +542,6 @@ int main(int argc, char **argv)
|
||||||
showdev = 1;
|
showdev = 1;
|
||||||
break;
|
break;
|
||||||
case 'v':
|
case 'v':
|
||||||
verbose = 1;
|
|
||||||
break;
|
break;
|
||||||
case 'V':
|
case 'V':
|
||||||
printf(UTIL_LINUX_VERSION);
|
printf(UTIL_LINUX_VERSION);
|
||||||
|
|
|
@ -168,6 +168,7 @@ done:
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(__x86_64__) || defined(__i386__)
|
||||||
static int hypervisor_decode_legacy(uint8_t *buf, const char *devmem)
|
static int hypervisor_decode_legacy(uint8_t *buf, const char *devmem)
|
||||||
{
|
{
|
||||||
if (!checksum(buf, 0x0F))
|
if (!checksum(buf, 0x0F))
|
||||||
|
@ -177,6 +178,7 @@ static int hypervisor_decode_legacy(uint8_t *buf, const char *devmem)
|
||||||
WORD(buf + 0x0C),
|
WORD(buf + 0x0C),
|
||||||
devmem);
|
devmem);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static int hypervisor_decode_smbios(uint8_t *buf, const char *devmem)
|
static int hypervisor_decode_smbios(uint8_t *buf, const char *devmem)
|
||||||
{
|
{
|
||||||
|
|
|
@ -181,7 +181,8 @@ static int switchroot(const char *newroot)
|
||||||
if (pid <= 0) {
|
if (pid <= 0) {
|
||||||
struct statfs stfs;
|
struct statfs stfs;
|
||||||
if (fstatfs(cfd, &stfs) == 0 &&
|
if (fstatfs(cfd, &stfs) == 0 &&
|
||||||
(stfs.f_type == STATFS_RAMFS_MAGIC || stfs.f_type == STATFS_TMPFS_MAGIC))
|
(stfs.f_type == (__SWORD_TYPE)STATFS_RAMFS_MAGIC ||
|
||||||
|
stfs.f_type == (__SWORD_TYPE)STATFS_TMPFS_MAGIC))
|
||||||
recursiveRemove(cfd);
|
recursiveRemove(cfd);
|
||||||
else
|
else
|
||||||
warn(_("old root filesystem is not an initramfs"));
|
warn(_("old root filesystem is not an initramfs"));
|
||||||
|
|
|
@ -27,7 +27,7 @@ typedef struct {
|
||||||
|
|
||||||
static int hlp_wordsize(void)
|
static int hlp_wordsize(void)
|
||||||
{
|
{
|
||||||
printf("%lu\n", CHAR_BIT * sizeof(void*));
|
printf("%zu\n", CHAR_BIT * sizeof(void*));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue