* screen.c: Changed the return type of ilog10 to unsigned int

and adjusted some variables in format_device_number.
This commit is contained in:
Roland Illig 2005-02-23 19:37:43 +00:00
parent 64afc0126c
commit 476927920b
2 changed files with 9 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2005-02-23 Roland Illig <roland.illig@gmx.de>
* screen.c: Changed the return type of ilog10 to unsigned int
and adjusted some variables in format_device_number.
2005-02-22 Roland Illig <roland.illig@gmx.de>
* unixcompat.h: Added missing parenthesis to the minor() macro.

View File

@ -192,9 +192,9 @@ string_file_name (file_entry *fe, int len)
return buffer;
}
static inline int ilog10(dev_t n)
static inline unsigned int ilog10(dev_t n)
{
int digits = 0;
unsigned int digits = 0;
do {
digits++, n /= 10;
} while (n != 0);
@ -205,8 +205,8 @@ static void format_device_number (char *buf, size_t bufsize, dev_t dev)
{
dev_t major_dev = major(dev);
dev_t minor_dev = minor(dev);
int major_digits = ilog10(major_dev);
int minor_digits = ilog10(minor_dev);
unsigned int major_digits = ilog10(major_dev);
unsigned int minor_digits = ilog10(minor_dev);
g_assert(bufsize >= 1);
if (major_digits + 1 + minor_digits + 1 <= bufsize) {