Fix format warnings due to ino_t changes

This commit is contained in:
Sebastian Huber
2019-01-10 09:05:49 +01:00
parent 3a5c71dea4
commit 7bde91bd5f
5 changed files with 16 additions and 8 deletions

View File

@@ -127,8 +127,11 @@ extern "C" {
/* rtems_signal_set is a typedef to uint32_t */
#define PRIxrtems_signal_set PRIx32
/* newlib's ino_t is a typedef to "unsigned long" */
#define PRIxino_t "lx"
/* newlib's ino_t is a typedef to __uint64_t */
#define PRIuino_t PRIu64
/* newlib's ino_t is a typedef to __uint64_t */
#define PRIxino_t PRIx64
/* ioctl_command_t */
#define PRIdioctl_command_t "ld"

View File

@@ -622,7 +622,8 @@ rtems_rfs_dir_read (rtems_rfs_file_system* fs,
dirent->d_namlen = elength;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_READ))
printf ("rtems-rfs: dir-read: found off:%" PRIooff_t " ino:%ld name=%s\n",
printf ("rtems-rfs: dir-read: found off:%" PRIooff_t
" ino:%" PRIuino_t " name=%s\n",
dirent->d_off, dirent->d_ino, dirent->d_name);
break;
}

View File

@@ -48,6 +48,7 @@ __FBSDID("$FreeBSD: src/bin/rm/rm.c,v 1.58 2006/10/31 02:22:36 delphij Exp $");
#endif
#include <rtems.h>
#include <rtems/inttypes.h>
#include <rtems/shell.h>
#include <rtems/shellconfig.h>
#define __need_getopt_newlib
@@ -493,8 +494,9 @@ rm_overwrite_rm(rtems_shell_rm_globals* globals, char *file, struct stat *sbp)
if (!S_ISREG(sbp->st_mode))
return (1);
if (sbp->st_nlink > 1 && !fflag) {
warnx("%s (inode %lu): not overwritten due to multiple links",
file, sbp->st_ino);
warnx("%s (inode %" PRIuino_t
"): not overwritten due to multiple links", file,
sbp->st_ino);
return (0);
}
if ((fd = open(file, O_WRONLY, 0)) == -1)

View File

@@ -50,6 +50,7 @@ __RCSID("$NetBSD: print.c,v 1.40 2004/11/17 17:00:00 mycroft Exp $");
#include <inttypes.h>
#include <rtems.h>
#include <rtems/inttypes.h>
#include <rtems/libio.h>
#include <sys/param.h>
@@ -135,7 +136,8 @@ printlong(rtems_shell_ls_globals* globals, DISPLAY *dp)
continue;
sp = p->fts_statp;
if (f_inode)
(void)printf("%*lu ", dp->s_inode, sp->st_ino);
(void)printf("%*" PRIuino_t " ", dp->s_inode,
sp->st_ino);
if (f_size && !f_humanize) {
(void)printf("%*llu ", dp->s_block,
(unsigned long long)howmany(sp->st_blocks, blocksize));
@@ -385,7 +387,7 @@ printaname(rtems_shell_ls_globals* globals,
sp = p->fts_statp;
chcnt = 0;
if (f_inode)
chcnt += printf("%*lu ", inodefield, sp->st_ino);
chcnt += printf("%*" PRIuino_t " ", inodefield, sp->st_ino);
if (f_size) {
#if RTEMS_REMOVED
if (f_humanize) {

View File

@@ -80,7 +80,7 @@ void printdir( DIR *directory )
d = readdir(directory);
while (d) {
printf( "%-20s %8ld %8" PRIdoff_t " %6d 0x%04x\n",
printf( "%-20s %8" PRIuino_t " %8" PRIdoff_t " %6d 0x%04x\n",
d->d_name, d->d_ino, d->d_off, d->d_reclen, d->d_type );
d = readdir(directory);