diff --git a/drivers/pci.c b/drivers/pci.c index 2b4e525..f8c6414 100644 --- a/drivers/pci.c +++ b/drivers/pci.c @@ -297,7 +297,7 @@ ob_pci_encode_unit(int *idx) case IO_SPACE: /* [n]i[t]DD,F,RR,NNNNNNNN */ - snprintf(buf, sizeof(buf), "%si%s%x,%x,%x,%x", + snprintf(buf, sizeof(buf), "%si%s%x,%x,%x," FMT_ucellx, n ? "n" : "", /* relocatable */ t ? "t" : "", /* aliased */ dev, fn, reg, t ? lo & 0x03FF : lo); @@ -306,7 +306,7 @@ ob_pci_encode_unit(int *idx) case MEMORY_SPACE_32: /* [n]m[t][p]DD,F,RR,NNNNNNNN */ - snprintf(buf, sizeof(buf), "%sm%s%s%x,%x,%x,%x", + snprintf(buf, sizeof(buf), "%sm%s%s%x,%x,%x," FMT_ucellx, n ? "n" : "", /* relocatable */ t ? "t" : "", /* aliased */ p ? "p" : "", /* prefetchable */ @@ -319,7 +319,7 @@ ob_pci_encode_unit(int *idx) snprintf(buf, sizeof(buf), "%sx%s%x,%x,%x,%llx", n ? "n" : "", /* relocatable */ p ? "p" : "", /* prefetchable */ - dev, fn, reg, ((uint64_t)mid << 32) | (uint64_t)lo ); + dev, fn, reg, ((long long)mid << 32) | (long long)lo); break; } push_str(buf); diff --git a/fs/hfs/hfs_fs.c b/fs/hfs/hfs_fs.c index 731ccab..293dc18 100644 --- a/fs/hfs/hfs_fs.c +++ b/fs/hfs/hfs_fs.c @@ -524,7 +524,7 @@ hfs_files_dir( hfs_info_t *dummy ) forth_printf("\n"); while( !hfs_readdir(common->dir, &ent) ) { - forth_printf("% 10d ", ent.u.file.dsize); + forth_printf("% 10ld ", ent.u.file.dsize); print_date(ent.mddate); if( ent.flags & HFS_ISDIR ) forth_printf("%s\\\n", ent.name); diff --git a/include/libc/vsprintf.h b/include/libc/vsprintf.h index e53c19f..4852274 100644 --- a/include/libc/vsprintf.h +++ b/include/libc/vsprintf.h @@ -20,11 +20,16 @@ #include #include "config.h" -extern int vsprintf(char *buf, const char *fmt, va_list args ); -extern int sprintf(char * buf, const char *fmt, ...); -extern int vsnprintf(char *buf, size_t size, const char *fmt, va_list args); -extern int snprintf(char * buf, size_t size, const char *fmt, ...); +int vsprintf(char *buf, const char *fmt, va_list args) + __attribute__((__format__(__printf__, 2, 0))); +int sprintf(char * buf, const char *fmt, ...) + __attribute__((__format__(__printf__, 2, 3))); +int vsnprintf(char *buf, size_t size, const char *fmt, va_list args) + __attribute__((__format__(__printf__, 3, 0))); +int snprintf(char * buf, size_t size, const char *fmt, ...) + __attribute__((__format__(__printf__, 3, 4))); -extern int forth_printf( const char *fmt, ... ); +int forth_printf(const char *fmt, ...) + __attribute__((__format__(__printf__, 1, 2))); #endif /* _H_VSPRINTF */