2008-03-18 [colin] 3.3.1cvs31

* src/common/utils.c
	* src/common/utils.h
		Handle size_t instead of off_t in to_human_readable
This commit is contained in:
Colin Leroy 2008-03-18 19:18:46 +00:00
parent 95f5207b69
commit f63df46575
5 changed files with 15 additions and 8 deletions

View file

@ -1,3 +1,9 @@
2008-03-18 [colin] 3.3.1cvs31
* src/common/utils.c
* src/common/utils.h
Handle size_t instead of off_t in to_human_readable
2008-03-18 [colin] 3.3.1cvs30
* src/imap.c

View file

@ -3265,3 +3265,4 @@
( cvs diff -u -r 1.274.2.237 -r 1.274.2.238 src/mainwindow.c; ) > 3.3.1cvs28.patchset
( cvs diff -u -r 1.395.2.362 -r 1.395.2.363 src/summaryview.c; ) > 3.3.1cvs29.patchset
( cvs diff -u -r 1.179.2.213 -r 1.179.2.214 src/imap.c; ) > 3.3.1cvs30.patchset
( cvs diff -u -r 1.36.2.135 -r 1.36.2.136 src/common/utils.c; cvs diff -u -r 1.20.2.59 -r 1.20.2.60 src/common/utils.h; ) > 3.3.1cvs31.patchset

View file

@ -11,7 +11,7 @@ MINOR_VERSION=3
MICRO_VERSION=1
INTERFACE_AGE=0
BINARY_AGE=0
EXTRA_VERSION=30
EXTRA_VERSION=31
EXTRA_RELEASE=
EXTRA_GTK2_VERSION=

View file

@ -322,7 +322,7 @@ gchar *itos(gint n)
d = (d*100) >> divisor; \
}
gchar *to_human_readable(off_t size)
gchar *to_human_readable(size_t size)
{
static gchar str[14];
static gchar *b_format = NULL, *kb_format = NULL,
@ -334,20 +334,20 @@ gchar *to_human_readable(off_t size)
mb_format = _("%d.%02dMB");
gb_format = _("%.2fGB");
}
if (size < (off_t)1024) {
if (size < (size_t)1024) {
g_snprintf(str, sizeof(str), b_format, (gint)size);
return str;
} else if (size >> 10 < (off_t)1024) {
} else if (size >> 10 < (size_t)1024) {
divide(size, 10, t, r);
g_snprintf(str, sizeof(str), kb_format, t, r);
return str;
} else if (size >> 20 < (off_t)1024) {
} else if (size >> 20 < (size_t)1024) {
divide(size, 20, t, r);
g_snprintf(str, sizeof(str), mb_format, t, r);
return str;
} else {
g_snprintf(str, sizeof(str), gb_format, (gfloat)size / (1 << 30));
g_snprintf(str, sizeof(str), gb_format, (gfloat)(size) / (1 << 30));
return str;
}
}

View file

@ -243,7 +243,7 @@ gint to_number (const gchar *nstr);
gchar *itos_buf (gchar *nstr,
gint n);
gchar *itos (gint n);
gchar *to_human_readable (off_t size);
gchar *to_human_readable (size_t size);
/* alternative string functions */
gint strcmp2 (const gchar *s1,